Changeset 138
- Timestamp:
- 06/06/06 22:05:36 (18 years ago)
- Location:
- pykoticon/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykoticon/trunk/bin/pykoticon
r137 r138 4 4 """PyKotIcon is a generic, networked, cross-platform dialog box manager.""" 5 5 6 # PyKotIcon - Client side helper for PyKota 6 # PyKotIcon - Client side helper for PyKota and other applications 7 7 # 8 8 # (c) 2003, 2004, 2005, 2006 Jerome Alet <alet@librelogiciel.com> … … 23 23 # 24 24 25 __version__ = "1.0 1"25 __version__ = "1.02" 26 26 __author__ = "Jerome Alet" 27 27 __author_email__ = "alet@librelogiciel.com" … … 148 148 return True 149 149 150 def _dispatch(self, method, params) : 151 """Ensure that only export_* methods are available.""" 152 return getattr(self, "export_%s" % method)(*params) 153 154 def handle_error(self, request, client_address) : 155 """Doesn't display an ugly traceback in case an error occurs.""" 156 self.logDebug("An exception occured while handling an incoming request from %s:%s" % (client_address[0], client_address[1])) 157 150 158 def verify_request(self, request, client_address) : 151 159 """Ensures that requests which don't come from the print server are rejected.""" … … 158 166 self.logDebug("%s rejected." % client) 159 167 return False 160 161 def _dispatch(self, method, params) :162 """Ensure that only export_* methods are available."""163 return getattr(self, "export_%s" % method)(*params)164 168 165 169 def mainloop(self) : … … 248 252 249 253 wx.EVT_ICONIZE(self, self.OnIconify) 250 wx.EVT_CLOSE(self, self. FakeOnClose)254 wx.EVT_CLOSE(self, self.OnClose) 251 255 self.Show(True) 252 256 … … 277 281 def OnClose(self, event) : 278 282 """Cleanly quit the application.""" 279 self.closeServer() 280 self.menu.Destroy() 281 self.tbicon.Destroy() 282 self.Destroy() 283 if (event is None) or self.options.allowquit : 284 self.closeServer() 285 self.menu.Destroy() 286 self.tbicon.Destroy() 287 self.Destroy() 288 else : 289 self.quitIsForbidden() 283 290 284 291 def OnTaskBarMenu(self, event) : … … 286 293 self.tbicon.PopupMenu(self.menu) 287 294 288 def FakeOnClose(self, event) :289 """React to close from windows corner."""290 if self.options.allowquit :291 self.Close()292 else :293 self.quitIsForbidden()294 295 295 def OnTaskBarClose(self, event) : 296 296 """React to close from the taskbar.""" … … 302 302 def quitIsForbidden(self) : 303 303 """Displays a message indicating that quitting the application is not allowed.""" 304 #�message = _("Sorry, this was forbidden by your system administrator.") 305 #�caption = _("Information") 306 #�style = wx.OK | wx.ICON_INFORMATION | wx.STAY_ON_TOP 307 # dialog = wx.MessageDialog(self, message, caption, style) 308 # dialog.ShowModal() 309 #�dialog.Destroy() 310 pass 304 message = _("Sorry, this was forbidden by your system administrator.") 305 caption = _("Information") 306 style = wx.OK | wx.ICON_INFORMATION | wx.STAY_ON_TOP 307 dialog = wx.MessageDialog(self, message, caption, style) 308 dialog.ShowModal() 309 dialog.Destroy() 311 310 312 311 def OnAbout(self, event) : … … 473 472 474 473 475 def crashed() :476 """Minimal crash method."""477 import traceback478 lines = []479 for line in traceback.format_exception(*sys.exc_info()) :480 lines.extend([l for l in line.split("\n") if l])481 msg = "ERROR: ".join(["%s\n" % l for l in (["ERROR: PyKotIcon"] + lines)])482 sys.stderr.write(msg)483 sys.stderr.flush()484 485 486 474 if __name__ == '__main__': 487 475 main() -
pykoticon/trunk/NEWS
r126 r138 22 22 PyKotIcon NEWS : 23 23 24 - 1.02 (2006-06-06) : 25 26 - Now displays an error message when the end user wants to quit 27 and it is forbidden. 28 29 - Doesn't display the ugly traceback anymore when the client 30 disconnects before the server has sent the answer back 31 (pknotify --timeout). 32 24 33 - 1.01 (2006-05-01) : 25 34