equal
deleted
inserted
replaced
223 atexit=self.set_needreload, filelist_path=filelist_path) |
223 atexit=self.set_needreload, filelist_path=filelist_path) |
224 mon_thread = threading.Thread(target=mon.periodic_reload) |
224 mon_thread = threading.Thread(target=mon.periodic_reload) |
225 mon_thread.daemon = True |
225 mon_thread.daemon = True |
226 mon_thread.start() |
226 mon_thread.start() |
227 |
227 |
|
228 def i18nfiles(self, cwconfig): |
|
229 """Return instance i18n files""" |
|
230 i18ndir = os.path.join(cwconfig.apphome, 'i18n') |
|
231 if os.path.exists(i18ndir): |
|
232 for lang in cwconfig.available_languages(): |
|
233 f = os.path.join(i18ndir, lang, 'LC_MESSAGES', 'cubicweb.mo') |
|
234 if os.path.exists(f): |
|
235 yield f |
|
236 |
228 def pyramid_instance(self, appid): |
237 def pyramid_instance(self, appid): |
229 self._needreload = False |
238 self._needreload = False |
230 |
239 |
231 if self['reload'] and not os.environ.get(self._reloader_environ_key): |
240 if self['reload'] and not os.environ.get(self._reloader_environ_key): |
232 return self.restart_with_reloader() |
241 return self.restart_with_reloader() |
235 |
244 |
236 if self['reload']: |
245 if self['reload']: |
237 _turn_sigterm_into_systemexit() |
246 _turn_sigterm_into_systemexit() |
238 self.debug('Running reloading file monitor') |
247 self.debug('Running reloading file monitor') |
239 extra_files = [sys.argv[0], cwconfig.main_config_file()] |
248 extra_files = [sys.argv[0], cwconfig.main_config_file()] |
|
249 extra_files.extend(self.i18nfiles(cwconfig)) |
240 self.install_reloader( |
250 self.install_reloader( |
241 self['reload-interval'], extra_files, |
251 self['reload-interval'], extra_files, |
242 filelist_path=os.environ.get( |
252 filelist_path=os.environ.get( |
243 self._reloader_filelist_environ_key)) |
253 self._reloader_filelist_environ_key)) |
244 |
254 |