def main(args): if len(args) == 2 and args[1] in ["help", "-h", "--help"]: usage(args[0]) return if len(args) == 3: do_operation(args[2], args[1]) return prj = None for item in args[1:]: if not item.startswith("-"): prj = item args.remove(item) import gui # Qt messes with args, so a copy of it is passed gui.gui_main(args[:], prj)
def main(): """ docstring """ headlightFlash_o = HeadlightControl() config_o = Config() def pit_limiter(): return config_o.get('miscellaneous', 'pit_limiter') == '1' def pit_lane(): return config_o.get('miscellaneous', 'pit_lane') == '1' def flash_duration(): return int(config_o.get('miscellaneous', 'flash_duration')) def pit_flash_duration(): return int(config_o.get('miscellaneous', 'pit_flash_duration')) def default_to_on(): return config_o.get('miscellaneous', 'default_to_on') == '1' def on_automatically(): return int(config_o.get('miscellaneous', 'on_automatically')) _root, tabConfigureFlash = gui_main() _player_is_driving = False _o_run = run(_root, tabConfigureFlash) _o_run.controller_o.start_pit_check_timer() # Start the 1 second timer while True: _cmd = _o_run.running() if headlightFlash_o.player_is_driving(): if not _player_is_driving: # First time player takes control _player_is_driving = True if default_to_on(): status_poker_fn('default_to_on') headlightFlash_o.on() if _cmd == 'Headlights off': headlightFlash_o.on() if _cmd == 'Headlights on': headlightFlash_o.off() if _cmd == 'Flash headlights': headlightFlash_o.four_flashes(flash_duration()) if _cmd == 'Toggle headlights': headlightFlash_o.toggle() if _cmd == TIMER_EVENT: if pit_limiter(): headlightFlash_o.check_pit_limiter(pit_flash_duration()) if pit_lane(): headlightFlash_o.check_pit_lane(pit_flash_duration()) headlightFlash_o.automatic_headlights(on_automatically()) else: _player_is_driving = False if _cmd == 'QUIT': break
def __init__(self): # instantiate self.config = ConfigParser() # set default values for _section in SECTIONS: self.set(_section, 'Controller', 'Not yet selected') self.set(_section, 'Control', '0') self.set('rFactor Toggle', 'Controller', 'keyboard') self.set('rFactor Toggle', 'Control', 'DIK_H') for _val, default in MISC_VALUES.items(): self.set('miscellaneous', _val, default) # if there is an existing file parse values over those if os.path.exists(CONFIG_FILE_NAME): self.config.read(CONFIG_FILE_NAME) else: self.write() # then configure the controller(s) from gui import gui_main gui_main() self.config.read(CONFIG_FILE_NAME)
def main(): print '$' * 60 print '\t\tLive IPv6 BGP Route Monitoring' print '$' * 60 obj = analysis() obj.comp = compa.compare_module() count = 0 while True: count += 1 print 'Iteration #' + str(count) obj.constructor() obj.Securesh.ssh_connection_open() obj.sorting() obj.dict1 = obj.data_merger() obj.comp.compare_me(obj.dict1) print 'time to sleep for 30s' #time.sleep (5) print '*' * 20 if count == 15: break obj.plot.prep_data(obj.comp.Total_flaps) gui.gui_main(obj.plot.max_add_list, obj.comp.Aspath_change)
def main(): print '$'*60 print '\t\tLive IPv6 BGP Route Monitoring' print '$'*60 obj = analysis() obj.comp = compa.compare_module() count = 0 while True: count += 1 print 'Iteration #'+str(count) obj.constructor() obj.Securesh.ssh_connection_open() obj.sorting() obj.dict1 = obj.data_merger() obj.comp.compare_me(obj.dict1) print 'time to sleep for 30s' #time.sleep (5) print '*'*20 if count == 15: break obj.plot.prep_data(obj.comp.Total_flaps) gui.gui_main(obj.plot.max_add_list, obj.comp.Aspath_change)
def main(): gui.gui_main()
from gui import gui_main if __name__ == "__main__": gui_main()