models/watcher.py
def process_IN_MODIFY(self, event):
        "A file of interest has changed"

        # Is it a file I know about?
        if event.path not in self.mod_map:
            return

        # Find out which module is using that file
        modname = self.mod_map[event.path]

        # Reload the module
        (fd, pathname, description) = imp.find_module(modname)
        try:
            imp.load_module(modname, fd, pathname, description)
        finally:
            if fd:
                fd.close()

        print ('Reload', modname)
A file of interest has changed
A file of interest has changed
A file of interest has changed
def process_IN_MODIFY(self, event):
        if event.path not in self.mod_map:
            return
        modname = self.mod_map[event.path]
        (fd, pathname, description) = imp.find_module(modname)
        try:
            imp.load_module(modname, fd, pathname, description)
        finally:
            if fd:
                fd.close()
        print ('Reload', modname)
def process_IN_MODIFY ( self , event ) : if event . path not in self . mod_map : return modname = self . mod_map [ event . path ] ( fd , pathname , description ) = imp . find_module ( modname ) try : imp . load_module ( modname , fd , pathname , description ) finally : if fd : fd . close ( ) print ( 'Reload' , modname )
A file of interest has changed
A file of interest has changed
"A file of interest has changed" # Is it a file I know about? # Find out which module is using that file # Reload the module
self
event