def lookup_command(command_name):
 BASE_COMMANDS = {'help': print_help}
 REPLICATION_COMMANDS = {'compare': replication_compare, 'dump': replication_dump, 'livecopy': replication_livecopy, 'load': replication_load, 'size': replication_size}
 commands = {}
 for command_set in (BASE_COMMANDS, REPLICATION_COMMANDS):
  commands.update(command_set)
 try:
  command = commands[command_name]
 except KeyError:
  if command_name:
   sys.exit((_('Unknown command: %s') % command_name))
  else:
   command = commands['help']
 return command

def lookup_command ( command_name ) : BASE_COMMANDS = { 'help' : print_help } REPLICATION_COMMANDS = { 'compare' : replication_compare , 'dump' : replication_dump , 'livecopy' : replication_livecopy , 'load' : replication_load , 'size' : replication_size } commands = { } for command_set in ( BASE_COMMANDS , REPLICATION_COMMANDS ) : commands . update ( command_set ) try : command = commands [ command_name ] except KeyError : if command_name : sys . exit ( ( _ ( 'Unknown command: %s' ) % command_name ) ) else : command = commands [ 'help' ] return command
lookup a command .