Changeset 92 for pykoticon/trunk

Show
Ignore:
Timestamp:
01/27/06 09:46:13 (19 years ago)
Author:
jerome
Message:

Now exit is really clean

Location:
pykoticon/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykoticon/trunk/bin/pykoticon

    r91 r92  
    8787        self.logDebug("Remote host asked to close the application.") 
    8888        self.frame.quitEvent.set() 
     89        wx.CallAfter(self.frame.OnClose, None) 
    8990        return True 
    9091         
     
    9596        """    
    9697        wx.CallAfter(self.frame.askConfirmation, printername, username, jobid, jobtitle, jobsize) 
     98         
     99        # ugly, isn't it ? 
    97100        while self.frame.askConfirmationResult is None : 
    98101            time.sleep(0.5) 
    99102        retcode = self.frame.askConfirmationResult     
    100         self.frame.askConfirmationResult = None 
     103        self.frame.askConfirmationResult = None # prepare for next call, just in case 
    101104        return retcode 
    102105         
     
    127130        self.register_function(self.export_nop) 
    128131        while not self.frame.quitEvent.isSet() : 
    129             self.logDebug("Loop!") 
    130132            self.handle_request() 
    131133        self.server_close()     
    132         try :     
    133             if not self.frame.closing : 
    134                 self.frame.Close()   
    135         except :     
    136             # Probably already closed 
    137             pass 
    138134        sys.exit(0) 
    139135     
     
    142138    def __init__(self, parent, id): 
    143139        self.askConfirmationResult = None 
    144         self.closing = False 
    145140        wx.Frame.__init__(self, parent, wx.ID_ANY, \ 
    146                _("PyKota for user %s") % getCurrentUserName(), \ 
     141               _("PyKota info for %s") % getCurrentUserName(), \ 
    147142               size = (-1, -1), \ 
    148143               style = wxPython.wx.wxDEFAULT_FRAME_STYLE \ 
     
    186181        server = xmlrpclib.ServerProxy("http://localhost:%s" % self.port)     
    187182        try : 
     183            # wake the server with an empty request  
     184            # for it to see the event object 
     185            # which has just been set 
    188186            server.nop() 
    189187        except :     
     
    209207    def OnClose(self, event) : 
    210208        sys.stderr.write("Close event !\n") 
    211         self.closing = True 
    212209        self.closeServer() 
    213210        if hasattr(self, "menu") : 
     
    231228        message = _("""Hello %(username)s, 
    232229         
    233                      You sent job %(jobid)s (%(jobtitle)s) to printer %(printername)s. 
    234                                      
    235                      This job seems to be %(jobsize)s pages long.  
    236                                      
    237                      Please confirm or cancel.""") % locals() 
     230You sent job %(jobid)s (%(jobtitle)s) to printer %(printername)s. 
     231 
     232This job seems to be %(jobsize)s pages long.  
     233 
     234Please confirm or cancel.""") % locals() 
    238235                      
    239236        dialog = wx.MessageDialog(self, message, _("Confirmation"), wx.OK | wx.CANCEL) 
  • pykoticon/trunk/setup.py

    r89 r92  
    4848      author_email = "alet@librelogiciel.com", 
    4949      url = "http://www.librelogiciel.com/software/", 
    50       windows=[os.path.join("bin", "pykoticon")], 
     50      # windows=[os.path.join("bin", "pykoticon")], 
    5151      scripts=[os.path.join("bin", "pykoticon")], 
    5252      data_files=[(directory, glob.glob(os.path.join("icons", "*.ico")))])