def OnInit(self): ClientCenter.__init__(self) self.config = {} # = { 'uin' : 'psyc://blah/~user', 'foo': 'bar'} self.config[u'uni'] = u'psyc://ve.symlynx.com/~betatim3' self.config[u'password'] = u'tim' self.config[u'action'] = u'brabbel' self.config[u'bgcolour'] = (255, 236, 191) self.config[u'fontcolour'] = (34, 63, 92) self.config[u'fontsize'] = 8 self.config[u'prompt'] = u'* ' print sys.getdefaultencoding() print os.name #print self.config self.frame = wxPFrame(logic_parent=self) # nen frame um die tabs aufzuheben self.client = PClient(self.config['uni'], self) self.create_server_place(netLocation(self.config['uni'])) # eignetlich is es kein place aber naja self.default_connection = netLocation(self.config['uni']) self.client.online() self.client.create_display(self) self.SetTopWindow(self.client.display) self.client.display.Show() self.timer = wxPyTimer(self.socket_check) self.timer.Start(100) # alle 100 ms return True
def __init__(self, config): self.config = config self.default_uni = config.get("main", "uni") u = parseUNL(self.default_uni) self.nick = u["resource"][1:] self.default_connection = netLocation(self.default_uni) if self.config.has_section("library"): for option in self.config.options("library"): self.options[option] = self.config.getboolean("library", option)
def find_remote(self, netname): """find a remote location where netname may be located""" address = netLocation(netname) if self.remote_connections.has_key(address): return self.remote_connections[address] return None
def find_remote(self, netname): address = netLocation(netname) return self.remote_connections.get(address, None)
def is_local_object(self, location): return netLocation(location) == netLocation(self.location)
def set_default_connection(self, uni): #netLocation(self.uni) print 'set_default_connect: ' + netLocation(uni) self.default_connection = netLocation(uni)