201 print "The working directory :",self.workdir |
201 print "The working directory :",self.workdir |
202 |
202 |
203 # Configure and publish service |
203 # Configure and publish service |
204 # Not publish service if localhost in address params |
204 # Not publish service if localhost in address params |
205 if self.ip != "localhost" and self.ip != "127.0.0.1": |
205 if self.ip != "localhost" and self.ip != "127.0.0.1": |
206 print "Publish service on local network" |
206 print "Publish service on local network" |
|
207 self.servicepublisher = ServicePublisher.ServicePublisher() |
207 self.servicepublisher.RegisterService(self.name, self.ip, self.port) |
208 self.servicepublisher.RegisterService(self.name, self.ip, self.port) |
208 |
209 |
209 sys.stdout.flush() |
210 sys.stdout.flush() |
210 |
211 |
211 self.daemon.requestLoop() |
212 self.daemon.requestLoop() |
212 |
213 |
213 def Stop(self): |
214 def Stop(self): |
214 self.servicepublisher.UnRegisterService() |
215 if self.servicepublisher is not None: |
|
216 self.servicepublisher.UnRegisterService() |
|
217 del self.servicepublisher |
215 self.daemon.shutdown(True) |
218 self.daemon.shutdown(True) |
216 |
219 |
217 class ParamsEntryDialog(wx.TextEntryDialog): |
220 class ParamsEntryDialog(wx.TextEntryDialog): |
218 if wx.VERSION < (2, 6, 0): |
221 if wx.VERSION < (2, 6, 0): |
219 def Bind(self, event, function, id = None): |
222 def Bind(self, event, function, id = None): |
333 pyroserver.Restart() |
336 pyroserver.Restart() |
334 |
337 |
335 def OnTaskBarQuit(self,evt): |
338 def OnTaskBarQuit(self,evt): |
336 pyroserver.Quit() |
339 pyroserver.Quit() |
337 self.RemoveIcon() |
340 self.RemoveIcon() |
|
341 wx.GetApp().ExitMainLoop() |
338 |
342 |
339 pyroserver = Server(name, ip, port, WorkingDir, args) |
343 pyroserver = Server(name, ip, port, WorkingDir, args) |
340 |
344 |
341 if havewx: |
345 if havewx: |
342 app=wx.App(redirect=False) |
346 app=wx.App(redirect=False) |