From e8a06741465702163977c638c5d11ff4419e7c75 Mon Sep 17 00:00:00 2001 From: emkael Date: Fri, 23 Feb 2018 16:34:18 +0100 Subject: Converting command line argument parsing to argparse --- jfr_playoff/settings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'jfr_playoff') diff --git a/jfr_playoff/settings.py b/jfr_playoff/settings.py index 9d727a7..021253f 100644 --- a/jfr_playoff/settings.py +++ b/jfr_playoff/settings.py @@ -11,12 +11,12 @@ def complete_filename(text, state): class PlayoffSettings(object): - def __init__(self): + def __init__(self, config_file): self.settings = None self.interactive = False self.settings_file = None - if len(sys.argv) > 1: - self.settings_file = sys.argv[1].decode( + if config_file is not None: + self.settings_file = config_file.decode( sys.getfilesystemencoding()) else: self.interactive = True -- cgit v1.2.3