Changeset 107 for pykoticon/trunk
- Timestamp:
- 02/02/06 16:13:01 (19 years ago)
- Location:
- pykoticon/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykoticon/trunk/bin/pykoticon
r106 r107 84 84 def export_quitApplication(self) : 85 85 """Makes the application quit.""" 86 self.logDebug("Remote host asked to close the application.")87 86 self.frame.quitEvent.set() 88 87 wx.CallAfter(self.frame.OnClose, None) … … 91 90 def export_askDatas(self, labels, varnames, varvalues) : 92 91 """Asks some textual datas defined by a list of labels, a list of variables' names and a list of variables values in a mapping.""" 93 wx.CallAfter(self.frame.askDatas, labels, varnames, varvalues) 92 values = {} 93 for (k, v) in varvalues.items() : 94 values[k] = v.data 95 wx.CallAfter(self.frame.askDatas, [ v.data for v in labels ], \ 96 varnames, \ 97 values) 98 # ugly, isn't it ? 99 while self.frame.dialogAnswer is None : 100 time.sleep(0.1) 101 retcode = self.frame.dialogAnswer 102 for (k, v) in retcode.items() : 103 if k != "isValid" : 104 retcode[k] = xmlrpclib.Binary(v) 105 self.frame.dialogAnswer = None # prepare for next call, just in case 106 return retcode 107 108 def export_showDialog(self, message, yesno) : 109 """Opens a notification or confirmation dialog.""" 110 wx.CallAfter(self.frame.showDialog, message.data, yesno) 94 111 # ugly, isn't it ? 95 112 while self.frame.dialogAnswer is None : … … 99 116 return retcode 100 117 101 def export_showDialog(self, message, yesno) :102 """Opens a notification or confirmation dialog."""103 wx.CallAfter(self.frame.showDialog, message, yesno)104 # ugly, isn't it ?105 while self.frame.dialogAnswer is None :106 time.sleep(0.1)107 retcode = self.frame.dialogAnswer108 self.frame.dialogAnswer = None # prepare for next call, just in case109 return retcode110 111 118 def export_nop(self) : 112 119 """Does nothing, but allows a clean shutdown from the frame itself.""" 113 self.logDebug("No operation !")114 120 return True 115 121 -
pykoticon/trunk/tests/test.py
r106 r107 50 50 51 51 server = xmlrpclib.ServerProxy("http://%s:%s" % (arguments[0], arguments[1])) 52 #result = server.showDialog( message, yesno)52 #result = server.showDialog(xmlrpclib.Binary(message), yesno) 53 53 #""" 54 result = server.askDatas([ "Username", "Password", "Billing code"], \54 result = server.askDatas([xmlrpclib.Binary(v) for v in ["Username", "Password", "Billing code"]], \ 55 55 ["username", "password", "billingcode"], \ 56 {"username": username, \57 "password": "cccccc", \58 "billingcode" : billingcode})56 {"username": xmlrpclib.Binary(username), \ 57 "password": xmlrpclib.Binary(""), \ 58 "billingcode" : xmlrpclib.Binary(billingcode)}) 59 59 #""" 60 60 #server.quitApplication() 61 61 if result["isValid"] : 62 print result # printing OK is safe.62 print "\n".join(["%s => '%s'" % (k, v.data) for (k, v) in result.items() if k != "isValid"]) 63 63 else : 64 64 print "the end user closed the dialog box !"