Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 0.8, 0.8.1, and 0.8.2

serve: fix shutdown logic

Changeset 1c82d05cecc6

Parent f2e267185ef0

by Steve Borho

Changes to one file · Browse files at 1c82d05cecc6 Showing diff from parent f2e267185ef0 Diff from another changeset...

Change 1 of 3 Show Entire File hggtk/​serve.py Stacked
 
16
17
18
 
19
20
21
22
23
24
25
26
27
 
32
33
34
 
 
35
36
37
 
133
134
135
136
137
 
 
 
 
138
139
140
 
 
 
141
142
143
 
16
17
18
19
20
21
22
23
24
 
25
26
27
 
32
33
34
35
36
37
38
39
 
135
136
137
 
 
138
139
140
141
142
 
 
143
144
145
146
147
148
@@ -16,12 +16,12 @@
 import threading  import time  import hglib +import shlib  from dialog import question_dialog, error_dialog  from mercurial.i18n import _  from mercurial import hg, ui, commands, cmdutil, util  from mercurial.hgweb import server  from mercurial.i18n import _ -from shlib import set_tortoise_icon    gservice = None  class ServeDialog(gtk.Window): @@ -32,6 +32,8 @@
  shlib.set_tortoise_icon(self, 'proxy.ico')   shlib.set_tortoise_keys(self)   + self.connect('delete-event', self._delete) +   # Pipe stderr, stdout to self.write   self._queue = Queue.Queue()   sys.stdout = self @@ -133,11 +135,14 @@
  tbutton.connect('clicked', handler, userdata)   return tbutton   - def should_live(self, widget, event): - if self._server_stopped(): + def _delete(self, widget, event): + if not self.should_live(): + self.destroy() + else:   return True - else: - return False + + def should_live(self): + return not self._server_stopped()     def _server_stopped(self):   '''