コード例 #1
0
ファイル: test_imports.py プロジェクト: AdrianRibao/celery
 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
ファイル: test_imports.py プロジェクト: wiennat/celery
 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
ファイル: test_imports.py プロジェクト: c0ns0le/zenoss-4
 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
ファイル: autoreload.py プロジェクト: wiennat/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])
コード例 #8
0
ファイル: autoreload.py プロジェクト: yangkf1985/celery
    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
ファイル: autoreload.py プロジェクト: 343829084/celery
    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
ファイル: autoreload.py プロジェクト: AdrianRibao/celery
 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)