Package wtf :: Module autoreload :: Class Autoreload
[hide private]
[frames] | no frames]

Class Autoreload

source code

object --+
         |
        Autoreload

Autoreload logic container
Instance Methods [hide private]
 
__init__(self, config, opts, args)
Initialization
source code
iterable
_check(self)
Check the need of reloading in case autoreload has been turned on
source code
number
_mtime(self, mod)
Determine the mtime of a module
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  _before = None
  _check_mtime = None
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, config, opts, args)
(Constructor)

source code 
Initialization
Parameters:
  • config (wtf.config.Config) - Configuration
  • opts (optparse.OptionContainer) - Command line options
  • args (list) - Positioned command line arguments
Overrides: object.__init__

_check(self)

source code 

Check the need of reloading in case autoreload has been turned on

This method takes a snapshot of the current sys.modules, mtimes are compared with an older snapshot and on differences true is returned. False otherwise.

Returns: iterable
Names of the changed modules (empty if nothing's changed)

_mtime(self, mod)

source code 
Determine the mtime of a module
Parameters:
  • mod (module) - The module to inspect
Returns: number
The mtime or None if it couldn't be determined (float or int, depending on the os.stat_float_times setting)