def main(command): try: load_on = command.split(' ', 1)[1] load_on = generator_id_parser.main(load_on, 'encoders') load_on = map(str, load_on) for i in load_on: more_enc(str(i)) except (IndexError, KeyError): print config.neg + 'Please specify a valid encoder to show more info for'
def main(command): try: load_on = command.split(' ', 1)[1] load_on = generator_id_parser.main(load_on, 'encoders', 'load') load_on = list(map(str, load_on)) for i in load_on: print(config.inf + 'Loading : ' + i) load_enc(str(i)) except (KeyError, IndexError): print(config.neg + 'Please specify a valid encoder to load')
def main(command): try: load_on = command.split(' ', 1)[1] load_on = generator_id_parser.main(load_on) load_on = map(str, load_on) for i in load_on: print config.inf + 'Loading : ' + i load_com(str(i)) except (KeyError, IndexError): print config.neg + 'Please specify a valid component to load or "all" to load all components. Note : the default component, */base is loaded by default'
def main(command): try: load_off = command.split(' ', 1)[1] load_off = generator_id_parser.main(load_off, operation='unload') load_off = map(str, load_off) for i in load_off: print config.inf + 'Unloading : ' + str(i) unload_com(str(i)) except (KeyError, IndexError): print config.neg + 'Please specify a valid component to unload or "all" to load all components. Note : "base" component cannot be unloaded'
def main(command): try: load_on = command.split(' ', 1)[1] if load_on == 'all': for i in config.encoders.values(): more_enc(str(i)) else: load_on = generator_id_parser.main(load_on, 'encoders', None) load_on = list(map(str, load_on)) for i in load_on: more_enc(str(i)) except (IndexError, KeyError): print(config.neg + 'Please specify a valid encoder to show more info for')
def main(command): try: load_off = command.split(' ', 1)[1] load_off = generator_id_parser.main(load_off, operation='unload') load_off = map(str, load_off) snapshot = config.loaded_encoders snapshot_dict = OrderedDict() for i in range(len(snapshot)): snapshot_dict[str(i)] = snapshot[i] for i in load_off: print config.inf + 'Unloading : ' + i snapshot_dict = unload_enc(str(i), snapshot_dict) config.loaded_encoders = snapshot_dict.values() except (KeyError, IndexError, TypeError): print config.neg + 'Please specify a valid encoder to unload'
def main(command): try: load_on = command.split(' ', 1)[1] if load_on == 'all': sample_space = list( set(tmp_win + list(config.loaded_components.values()))) for i in sample_space: if i in sample_space: exec(i.replace('/', '_') + '.main("info")') else: i = dict( list(config.win_components.items()) + list(config.loaded_components.items()))[i] exec(i.replace('/', '_') + '.main("info")') else: load_on = generator_id_parser.main(load_on, 'components', None) load_on = list(map(str, load_on)) for i in load_on: more_com(str(i)) except (IndexError, KeyError): print(config.neg + 'Please specify a valid component to show more info for')