示例#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")
示例#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')
示例#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'
示例#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")
示例#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)
示例#6
0
文件: autoreload.py 项目: Fak3/celery
    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])
示例#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])
示例#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}
示例#9
0
文件: autoreload.py 项目: psnj/celery
 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
示例#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}
示例#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
示例#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)