Ejemplo n.º 1
0
 def __init__(self, options):
     AsyncClient.__init__(self)
     try:
         self.connect(options.host, options.port)
     except socket_error, err:
         writeError(err, "Connection error")
         exit(1)
Ejemplo n.º 2
0
 def __init__(self):
     AsyncClient.__init__(self)
     try:
         self.connect(HOST, PORT)
     except socket_error, err:
         writeError(err, "Connection error")
         exit(1)
Ejemplo n.º 3
0
 def showtraceback(self):
     info = exc_info()
     errtype, err, tb = info
     if isinstance(err, KeyboardInterrupt):
         self.logger.error("Keyboard interrupt.")
     else:
         writeError(err, "Error", logger=self.logger, traceback=info)
Ejemplo n.º 4
0
 def createInterpreter(self):
     sys.ps1 = PROMPT1
     sys.ps2 = PROMPT2
     readline.parse_and_bind("tab: complete")
     commands = self.client.getCommands()
     locals = dict((command.__name__, command) for command in commands)
     locals['pyhelp'] = help
     try:
         proxies = self.client.createProxies(locals)
     except Exception, err:
         writeError(err, "Error on getting the component list", logger=self.logger)
         proxies = None
Ejemplo n.º 5
0
 def writeError(self, error, *args, **options):
     options['logger'] = self
     writeError(error, *args, **options)