Ejemplo n.º 1
0
 def test_module_file(self):
     m1 = Mock()
     m1.__file__ = "/opt/foo/xyz.pyc"
     self.assertEqual(module_file(m1), "/opt/foo/xyz.py")
     m2 = Mock()
     m2.__file__ = "/opt/foo/xyz.py"
     self.assertEqual(module_file(m1), "/opt/foo/xyz.py")
Ejemplo n.º 2
0
 def test_module_file(self):
     m1 = Mock()
     m1.__file__ = '/opt/foo/xyz.pyc'
     self.assertEqual(module_file(m1), '/opt/foo/xyz.py')
     m2 = Mock()
     m2.__file__ = '/opt/foo/xyz.py'
     self.assertEqual(module_file(m1), '/opt/foo/xyz.py')
Ejemplo n.º 3
0
def test_module_file():
    m1 = Mock()
    m1.__file__ = '/opt/foo/xyz.pyc'
    assert module_file(m1) == '/opt/foo/xyz.py'
    m2 = Mock()
    m2.__file__ = '/opt/foo/xyz.py'
    assert module_file(m1) == '/opt/foo/xyz.py'
Ejemplo n.º 4
0
 def test_module_file(self):
     m1 = Mock()
     m1.__file__ = "/opt/foo/xyz.pyc"
     self.assertEqual(module_file(m1), "/opt/foo/xyz.py")
     m2 = Mock()
     m2.__file__ = "/opt/foo/xyz.py"
     self.assertEqual(module_file(m1), "/opt/foo/xyz.py")
Ejemplo n.º 5
0
 def on_init(self):
     files = [module_file(sys.modules[m]) for m in self.modules]
     self._hashes = dict((f, file_hash(f)) for f in files)
     self._monitor = self.Monitor(files,
                                  self.on_change,
                                  shutdown_event=self._is_shutdown,
                                  **self.options)
Ejemplo n.º 6
0
    def on_init(self):
        files = self.file_to_module
        files.update(dict((module_file(sys.modules[m]), m)
                        for m in self.modules))

        self._monitor = self.Monitor(files, self.on_change,
                shutdown_event=self._is_shutdown, **self.options)
        self._hashes = dict([(f, file_hash(f)) for f in files])
Ejemplo n.º 7
0
    def on_init(self):
        files = self.file_to_module
        files.update(dict((module_file(sys.modules[m]), m)
                        for m in self.modules))

        self._monitor = self.Monitor(files, self.on_change,
                shutdown_event=self._is_shutdown, **self.options)
        self._hashes = dict([(f, file_hash(f)) for f in files])
Ejemplo n.º 8
0
    def on_init(self):
        files = self.file_to_module
        files.update({module_file(sys.modules[m]): m for m in self.modules})

        self._monitor = self.Monitor(files,
                                     self.on_change,
                                     shutdown_event=self._is_shutdown,
                                     **self.options)
        self._hashes = {f: file_hash(f) for f in files}
Ejemplo n.º 9
0
 def body(self):
     files = [module_file(sys.modules[m]) for m in self.modules]
     self._monitor = self.Monitor(files, self.on_change, shutdown_event=self._is_shutdown, **self.options)
     self._hashes = dict([(f, file_hash(f)) for f in files])
     try:
         self._monitor.start()
     except OSError, exc:
         if exc.errno not in (errno.EINTR, errno.EAGAIN):
             raise
Ejemplo n.º 10
0
    def on_init(self):
        files = self.file_to_module
        files.update({
            module_file(sys.modules[m]): m for m in self.modules
        })

        self._monitor = self.Monitor(
            files, self.on_change,
            shutdown_event=self._is_shutdown, **self.options)
        self._hashes = {f: file_hash(f) for f in files}
Ejemplo n.º 11
0
 def body(self):
     files = [module_file(sys.modules[m]) for m in self.modules]
     self._monitor = self.Monitor(files,
                                  self.on_change,
                                  shutdown_event=self._is_shutdown,
                                  **self.options)
     self._hashes = dict([(f, file_hash(f)) for f in files])
     try:
         self._monitor.start()
     except OSError, exc:
         if exc.errno not in (errno.EINTR, errno.EAGAIN):
             raise
Ejemplo n.º 12
0
 def on_init(self):
     files = [module_file(sys.modules[m]) for m in self.modules]
     self._hashes = dict((f, file_hash(f)) for f in files)
     self._monitor = self.Monitor(files, self.on_change,
             shutdown_event=self._is_shutdown, **self.options)