예제 #1
0
    def verify_custom_hook_classname(classname):
        # Don't wrap the load_class() in a try/except block; just let the
        # error propagate back to the caller such that they're given the
        # maximum amount of information to assist in debugging.
        from .custom_hook import CustomHook

        cls = load_class(classname)
        if not isinstance(cls(), CustomHook):
            raise CommandError("custom hook class '%s' does not derive from " "evn.custom_hook.CustomHook" % classname)
예제 #2
0
파일: config.py 프로젝트: tpn/enversion
 def verify_custom_hook_classname(classname):
     # Don't wrap the load_class() in a try/except block; just let the
     # error propagate back to the caller such that they're given the
     # maximum amount of information to assist in debugging.
     from .custom_hook import CustomHook
     cls = load_class(classname)
     if not isinstance(cls(), CustomHook):
         raise CommandError("custom hook class '%s' does not derive from "
                            "evn.custom_hook.CustomHook" % classname)
예제 #3
0
 def custom_hook_class(self):
     return load_class(self.custom_hook_classname)
예제 #4
0
파일: config.py 프로젝트: tpn/enversion
 def custom_hook_class(self):
     return load_class(self.custom_hook_classname)