Skip to content

Commit

Permalink
[musicscan-7] Code should accomodate for empty environmental variable…
Browse files Browse the repository at this point in the history
… (redo)
  • Loading branch information
cjcodeproj committed Apr 7, 2024
1 parent 55571d9 commit 0534e1b
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/musicscan/tools/id3scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
'''

# pylint: disable=invalid-name

import argparse
import os
import os.path
Expand Down Expand Up @@ -148,15 +146,14 @@ def show_debug_data(in_data):
help='write debug info in XML files')

args = parser.parse_args()
musicpath = ''
if 'MUSICPATH' in os.environ:
musicpath = os.environ['MUSICPATH']
if args.musicpath:
musicpath = args.musicpath
musicpath = args.musicpath
if not musicpath:
print("\nFAILURE: Can't find a source path of music files.\n")
parser.print_help()
sys.exit(2)
if 'MUSICPATH' in os.environ:
musicpath = os.environ['MUSICPATH']
else:
print("\nFAILURE: Can't find a source path for music files.\n")
parser.print_help()
sys.exit(2)
stats = Stats()
all_files = get_files(musicpath, stats)
data = scan_files(all_files)
Expand Down

0 comments on commit 0534e1b

Please sign in to comment.