378 if modified_on <= self._lastmodifs[filepath]: |
378 if modified_on <= self._lastmodifs[filepath]: |
379 return |
379 return |
380 # if it was modified, raise RegistryOutOfDate to reload everything |
380 # if it was modified, raise RegistryOutOfDate to reload everything |
381 self.info('File %s changed since last visit', filepath) |
381 self.info('File %s changed since last visit', filepath) |
382 raise RegistryOutOfDate() |
382 raise RegistryOutOfDate() |
|
383 # set update time before module loading, else we get some reloading |
|
384 # weirdness in case of syntax error or other error while importing the |
|
385 # module |
|
386 self._lastmodifs[filepath] = modified_on |
383 # load the module |
387 # load the module |
384 module = load_module_from_name(modname, use_sys=not force_reload) |
388 module = load_module_from_name(modname, use_sys=not force_reload) |
385 self.load_module(module) |
389 self.load_module(module) |
386 self._lastmodifs[filepath] = modified_on |
|
387 return True |
390 return True |
388 |
391 |
389 def load_module(self, module): |
392 def load_module(self, module): |
390 self.info('loading %s', module) |
393 self.info('loading %s', module) |
391 if hasattr(module, 'registration_callback'): |
394 if hasattr(module, 'registration_callback'): |