def run(self): import e3_io current_tap = e3_io.get_current_tap() if current_tap: print "Tap: %s" % e3_io.get_tap_id_and_name(current_tap) else: print "Tap: None" while True: input = raw_input('e3 > ') command = self.commandProvider.provide(input) self.executeCommand(command)
def get_command(self, input): match = self.is_command(input) if match: tap = e3_io.get_current_tap() if match.group(1) and match.group(2): tap = e3_io.get_tap_from_id_or_name(match.group(2)) if tap: return e3_command.PrintFix(tap) else: raise Exception('Tap %s not found' % match.group(2)) else: raise Exception('Unrecognized command line')
def get_command(self, input): match = self.is_command(input) if match: tap = e3_io.get_current_tap() if match.group(2) and match.group(3): tap = e3_io.get_tap_from_id_or_name(match.group(3)) if tap: return e3_command.SetSiblingDisjointness(tap, match.group(1)) else: raise Exception('Tap %s not found' % match.group(3)) else: raise Exception('Unrecognized command line')
def get_command(self, input): match = self.is_command(input) if match: tap = e3_io.get_current_tap() if match.group(2) and match.group(3): tap = e3_io.get_tap_from_id_or_name(match.group(3)) if tap: return e3_command.MoreWorldsOrEqualThan( tap, int(match.group(1))) else: raise Exception('Tap %s not found' % match.group(3)) else: raise Exception('Unrecognized command line')