Esempio n. 1
0
def enableExplicitMode():
    """ZCML startup hook to put the ruleset registry into explict mode.
    This means we require people to declare ruleset types before using them.
    """
    from z3c.caching.registry import getGlobalRulesetRegistry
    registry = getGlobalRulesetRegistry()
    if registry is not None:
        registry.explicit = True
Esempio n. 2
0
def enableExplicitMode():
    """ZCML startup hook to put the ruleset registry into explict mode.
    This means we require people to declare ruleset types before using them.
    """
    from z3c.caching.registry import getGlobalRulesetRegistry
    registry = getGlobalRulesetRegistry()
    if registry is not None:
        registry.explicit = True
Esempio n. 3
0
def register(for_, ruleset):
    getGlobalRulesetRegistry().register(for_, ruleset)
Esempio n. 4
0
def register(for_, ruleset):
    getGlobalRulesetRegistry().register(for_, ruleset)
Esempio n. 5
0
def declareType(name, title, description):
    getGlobalRulesetRegistry().declareType(name, title, description)
Esempio n. 6
0
 def setUp(self):
     provideAdapter(RulesetRegistry)
     self.registry = getGlobalRulesetRegistry()
Esempio n. 7
0
def declareType(name, title, description):
    getGlobalRulesetRegistry().declareType(name, title, description)
Esempio n. 8
0
 def test_getGlobalRulesetRegistry(self):
     from z3c.caching.registry import getGlobalRulesetRegistry
     self.assertEquals(None, getGlobalRulesetRegistry())
Esempio n. 9
0
 def reset_explicit_mode(self):
     registry = getGlobalRulesetRegistry()
     if registry is not None:
         registry.explicit = self._explicit_mode_cache
Esempio n. 10
0
 def disable_explicit_mode(self):
     registry = getGlobalRulesetRegistry()
     self._explicit_mode_cache = registry.explicit
     registry.explicit = False
Esempio n. 11
0
 def setUp(self):
     provideAdapter(RulesetRegistry)
     self.registry = getGlobalRulesetRegistry()
Esempio n. 12
0
 def test_getGlobalRulesetRegistry(self):
     from z3c.caching.registry import getGlobalRulesetRegistry
     self.assertEquals(None, getGlobalRulesetRegistry())