diff options
author | Tomás Touceda <chiiph@leap.se> | 2014-01-20 13:52:30 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2014-01-20 13:52:30 -0300 |
commit | 98ecb0421d8f5cc2f1420ad39c514315fd048118 (patch) | |
tree | 2c5f5a2af54e8a4c0ef22c569b274d1831ae54a0 /src/launcher.py | |
parent | 5aa163f1519e96bdc16892d4073a86bd19df3bd3 (diff) |
Do not try/except sections in the config, explicitly check for their existence
This avoids adding useless tracebacks to the real exceptions caught by
Twisted. Possible tx bug here.
Diffstat (limited to 'src/launcher.py')
-rw-r--r-- | src/launcher.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/launcher.py b/src/launcher.py index b62bd23..2a43e54 100644 --- a/src/launcher.py +++ b/src/launcher.py @@ -4,21 +4,22 @@ import time import threading import ConfigParser -from leap.bitmask.app import main as leap_client +from leap.bitmask.app import main as bitmask_client from leap.common.events import server from thandy.ClientCLI import update as thandy_update bundles_per_platform = { - "Windows" : "/bundleinfo/LEAPClient-win/", - "Darwin" : "", - "Linux" : "/bundleinfo/LEAPClient/", + "Windows": "/bundleinfo/LEAPClient-win/", + "Darwin": "", + "Linux": "/bundleinfo/LEAPClient/", } GENERAL_SECTION = "General" UPDATES_KEY = "Updates" + class Thandy(threading.Thread): def run(self): while True: @@ -50,16 +51,16 @@ if __name__ == "__main__": config.read("launcher.conf") launch_thandy = False - try: + + has_config = config.has_section(GENERAL_SECTION) and \ + config.has_option(GENERAL_SECTION, UPDATES_KEY) + + if has_config: launch_thandy = config.getboolean(GENERAL_SECTION, UPDATES_KEY) - except ConfigParser.NoSectionError as ns: - pass - except ConfigParser.NoOptionError as no: - pass if launch_thandy: thandy_thread = Thandy() thandy_thread.daemon = True thandy_thread.start() - leap_client() + bitmask_client() |