Beispiel #1
0
 def __init__(self, printer, host, port=21567, bufsize=1024):
     printer.setTcpClient(self)
     self.HOST = host
     self.PORT = port
     self.BUFSIZE = bufsize
     self.ADDR = (self.HOST, self.PORT)
     self.stop = False
     self.printer = printer
     
     self.keyfile = keyfile.load_client_keyfile(raw_input('key file path: '))
     self.password = raw_input('password: ')
     
     commGeneric = SocketGeneric(host, port, bufsize)
     
     super(tcpClient, self).__init__(commGeneric, self.keyfile, PillowTalkLink, PillowTalkActivator, \
                                     usr_processor=ChatClientProcessor(self.printer))
     self.link.secret = self.password
     
     def customExit():
         try:
             gui.root.destroy()
             gui.root.quit()
             sys.exit()
         except: pass
     self.exit = customExit
Beispiel #2
0
 def __init__(self, printer, host, port=21567, bufsize=1024):
     self.HOST = host
     self.PORT = port
     self.BUFSIZE = bufsize
     self.ADDR = (self.HOST, self.PORT)
     self.stop = False
     self.printer = printer
     
     self.keyfile = keyfile.load_client_keyfile('user1_keyfile')
     self.password = '******'
     
     commGeneric = SocketGeneric(host, port, bufsize)
     
     super(tcpClient, self).__init__(commGeneric, self.keyfile, PillowTalkLink, PillowTalkActivator, \
                                     usr_processor=ChatClientProcessor(self.printer))
     self.link.secret = self.password