From a4667d498e91106e4040515590c96e997e7dbe6d Mon Sep 17 00:00:00 2001 From: flyingrub Date: Mon, 8 Dec 2014 00:15:04 +0100 Subject: [PATCH] some fix --- scdl/scdl.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/scdl/scdl.py b/scdl/scdl.py index d05b0054..ccd3f332 100755 --- a/scdl/scdl.py +++ b/scdl/scdl.py @@ -61,7 +61,7 @@ def main(): # Parse argument arguments = docopt(__doc__, version='0.1') - print(arguments) + #print(arguments) if arguments["-o"] is not None: try: @@ -72,18 +72,15 @@ def main(): if arguments["--hidewarnings"]: warnings.filterwarnings("ignore") - # print("no warnings!") # Warn about no warnings...? if arguments["--path"] is not None: if os.path.exists(arguments["--path"]): - print('Downloading to '+arguments["--path"]+'...') os.chdir(arguments["--path"]) - else: - if path is not None: - print('Downloading to '+path+'...') - os.chdir(path) else: - print('Downloading to current directory...') + print('Invalid path in option...') + sys.exit() + + print('Downloading to '+os.getcwd()+'...') print('') if arguments["-l"]: @@ -104,7 +101,6 @@ def get_config(): read the path where to store music """ global token - global path config = configparser.ConfigParser() config.read(os.path.join(os.path.expanduser('~'), '.config/scdl/scdl.cfg')) try: @@ -116,7 +112,7 @@ def get_config(): if os.path.exists(path): os.chdir(path) else: - print('Invalid path...') + print('Invalid path in scdl.cfg...') sys.exit()