diff options
Diffstat (limited to 'src/config.py')
-rw-r--r-- | src/config.py | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/config.py b/src/config.py index ac52063..dc7d507 100644 --- a/src/config.py +++ b/src/config.py @@ -34,13 +34,13 @@ CONFIG_DEFAULT_RELAY_LINES = 50 CONFIG_DEFAULT_SECTIONS = ('relay', 'look', 'color', 'ssh', 'upload') CONFIG_DEFAULT_OPTIONS = (('relay.hostname', ''), - ('relay.port', ''), - ('relay.ssl', 'off'), + ('relay.port', 0), + ('relay.ssl', False), ('relay.password', ''), - ('relay.autoconnect', 'off'), + ('relay.autoconnect', False), ('relay.lines', str(CONFIG_DEFAULT_RELAY_LINES)), ('ssh.host', ''), - ('ssh.port', ''), + ('ssh.port', 0), ('ssh.username', ''), ('ssh.key', ''), ('upload.url', ''), @@ -139,3 +139,13 @@ def color_options(): """Return color options.""" global config_options return config_options["color"] + +def str_to_bool(value): + truthy = ["true", "1", "on", "y", "yes", "t", "i"] + #falsy = ["false", "0", "off", "n", "no", "f", "o"] + + lower_val = value.lower() + if lower_val in truthy: + return True + else: + return False |