コード例 #1
0
 def test_reload_code_change(self):
     from plone.reload.code import reload_code
     from plone.reload.code import MOD_TIMES
     our_package = os.path.abspath(
         os.path.join(TESTS, os.pardir, '__init__.pyc'))
     our_entry = MOD_TIMES[our_package]
     try:
         MOD_TIMES[our_package] = (our_entry[0] - 10, our_entry[1])
         self.assertEqual(len(reload_code()), 1)
     finally:
         MOD_TIMES[our_package] = our_entry
コード例 #2
0
ファイル: test_code.py プロジェクト: Vinsurya/Plone
 def test_reload_code_change(self):
     from plone.reload.code import reload_code
     from plone.reload.code import MOD_TIMES
     our_package = os.path.abspath(
         os.path.join(TESTS, os.pardir, '__init__.pyc'))
     our_entry = MOD_TIMES[our_package]
     try:
         MOD_TIMES[our_package] = (our_entry[0] - 10, our_entry[1])
         self.assertEqual(len(reload_code()), 1)
     finally:
         MOD_TIMES[our_package] = our_entry
コード例 #3
0
ファイル: test_code.py プロジェクト: plone/plone.reload
 def test_reload_code_change(self):
     from plone.reload.code import reload_code
     from plone.reload.code import get_mod_times
     our_package = os.path.abspath(
         os.path.join(TESTS, os.pardir, '__init__.py'))
     times = get_mod_times()
     our_entry = times[our_package]
     try:
         times[our_package] = (our_entry[0] - 10, our_entry[1])
         self.assertEqual(len(reload_code()), 1)
     finally:
         times[our_package] = our_entry
コード例 #4
0
ファイル: browser.py プロジェクト: plone/plone.reload
    def code_reload(self):
        if not self.available():
            return

        reloaded = reload_code()

        result = ''
        if reloaded:
            result += 'Code reloaded:\n\n'
            result += '\n'.join(reloaded)
        else:
            result = 'No code reloaded!'
        return result
コード例 #5
0
    def code_reload(self):
        if not self.available():
            return

        reloaded = reload_code()

        result = ''
        if reloaded:
            result += 'Code reloaded:\n\n'
            result += '\n'.join(reloaded)
        else:
            result = 'No code reloaded!'
        return result
コード例 #6
0
ファイル: browser.py プロジェクト: plone/plone.reload
    def zcml_reload(self):
        if not self.available():
            return

        # We always do an implicit code reload so we can register all newly
        # added classes.
        reloaded = reload_code()
        reload_zcml()

        # TODO Minimize all caches, we only really want to invalidate the
        # local site manager from all caches
        self.context._p_jar.db().cacheMinimize()
        result = ''
        if reloaded:
            result += 'Code reloaded:\n\n'
            result += '\n'.join(reloaded)
        else:
            result = 'No code reloaded!'
        result += '\n\nGlobal ZCML reloaded.'
        return result
コード例 #7
0
    def zcml_reload(self):
        if not self.available():
            return

        # We always do an implicit code reload so we can register all newly
        # added classes.
        reloaded = reload_code()
        reload_zcml()

        # TODO Minimize all caches, we only really want to invalidate the
        # local site manager from all caches
        self.context._p_jar.db().cacheMinimize()
        result = ''
        if reloaded:
            result += 'Code reloaded:\n\n'
            result += '\n'.join(reloaded)
        else:
            result = 'No code reloaded!'
        result += '\n\nGlobal ZCML reloaded.'
        return result
コード例 #8
0
ファイル: test_code.py プロジェクト: Vinsurya/Plone
 def test_reload_code(self):
     from plone.reload.code import reload_code
     self.assertEqual(len(reload_code()), 0)
コード例 #9
0
 def test_reload_code(self):
     from plone.reload.code import reload_code
     self.assertEqual(len(reload_code()), 0)