Exemple #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)
Exemple #2
0
 def __init__(self):
     AsyncClient.__init__(self)
     try:
         self.connect(HOST, PORT)
     except socket_error, err:
         writeError(err, "Connection error")
         exit(1)
Exemple #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)
Exemple #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
Exemple #5
0
 def writeError(self, error, *args, **options):
     options['logger'] = self
     writeError(error, *args, **options)