File tree 2 files changed +15
-5
lines changed
2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -179,6 +179,18 @@ def _get_names(self):
179
179
return [ x for x in super (Root , self )._get_names () if x ]
180
180
181
181
182
+ ########################################################################
183
+ # Start / Stop API
184
+ ########################################################################
185
+ def launch_at_start (self , context ):
186
+ """Method called at instance start"""
187
+ pass
188
+
189
+
190
+ def launch_at_stop (self , context ):
191
+ """Method called at instance stop"""
192
+ pass
193
+
182
194
########################################################################
183
195
# API
184
196
########################################################################
@@ -190,11 +202,6 @@ def get_default_edit_languages(self):
190
202
return [self .get_default_language ()]
191
203
192
204
193
- def launch_at_start (self , context ):
194
- """Method called at instance start"""
195
- pass
196
-
197
-
198
205
def before_traverse (self , context , min = Decimal ('0.000001' ),
199
206
zero = Decimal ('0.0' )):
200
207
# Set the language cookie if specified by the query.
Original file line number Diff line number Diff line change @@ -293,6 +293,9 @@ def run(self):
293
293
294
294
def stop (self , signum , frame ):
295
295
print 'Shutting down the server...'
296
+ context = get_context ()
297
+ if context and context .root :
298
+ context .root .launch_at_stop (context )
296
299
self .server .close ()
297
300
self .quit ()
298
301
You can’t perform that action at this time.
0 commit comments