Пример #1
0
    def test_confs(self):
        self.assert_(self.app.QueryConf(IRootConf))
        self.assert_(self.app.QueryConf("nive.definitions.IRootConf"))
        self.assert_(self.app.QueryConf(IToolConf, _GlobalObject()))
        self.assertFalse(self.app.QueryConf("nive.definitions.no_conf"))
        
        self.assert_(self.app.QueryConfByName(IRootConf, "root"))
        self.assert_(self.app.QueryConfByName("nive.definitions.IRootConf", "root"))
        self.assert_(self.app.QueryConfByName(IToolConf, "tool", _GlobalObject()))
        self.assertFalse(self.app.QueryConfByName("nive.definitions.no_conf", "root"))

        self.assert_(self.app.Factory(IRootConf, "root"))
        self.assert_(self.app.Factory("nive.definitions.IRootConf", "root"))
        self.assert_(self.app.Factory(IToolConf, "tool", _GlobalObject()))
        self.assertFalse(self.app.Factory("nive.definitions.no_conf", "root"))
Пример #2
0
    def test_confs(self):
        self.assert_(self.app.QueryConf(IRootConf))
        self.assert_(self.app.QueryConf("nive.definitions.IRootConf"))
        self.assert_(self.app.QueryConf(IToolConf, _GlobalObject()))
        self.assertFalse(self.app.QueryConf("nive.definitions.no_conf"))

        self.assert_(self.app.QueryConfByName(IRootConf, "root"))
        self.assert_(self.app.QueryConfByName("nive.definitions.IRootConf", "root"))
        self.assert_(self.app.QueryConfByName(IToolConf, "tool", _GlobalObject()))
        self.assertFalse(self.app.QueryConfByName("nive.definitions.no_conf", "root"))

        self.assert_(self.app.Factory(IRootConf, "root"))
        self.assert_(self.app.Factory("nive.definitions.IRootConf", "root"))
        self.assert_(self.app.Factory(IToolConf, "tool", _GlobalObject()))
        self.assertFalse(self.app.Factory("nive.definitions.no_conf", "root"))
Пример #3
0
 def GetTool(self, toolID, contextObject=None):
     """
     Load tool object. *toolID* must be the tool.id or dotted python name.
     
     returns the tool object.
     """
     return self._GetToolObj(toolID, contextObject or _GlobalObject())
Пример #4
0
 def GetTool(self, toolID, contextObject=None):
     """
     Load tool object. *toolID* must be the tool.id or dotted python name.
     
     returns the tool object.
     """
     return self._GetToolObj(toolID, contextObject or _GlobalObject())
Пример #5
0
 def GetWorkflow(self, wfProcID, contextObject=None):
     """
     Load workflow process. *wfProcID* must be the wf.id or dotted python name.
     
     returns the workflow object
     """
     if not self.configuration.workflowEnabled:
         return None
     return self._GetWfObj(wfProcID, contextObject or _GlobalObject())
Пример #6
0
 def GetWorkflow(self, wfProcID, contextObject=None):
     """
     Load workflow process. *wfProcID* must be the wf.id or dotted python name.
     
     returns the workflow object
     """
     if not self.configuration.workflowEnabled:
         return None
     return self._GetWfObj(wfProcID, contextObject or _GlobalObject())
Пример #7
0
 def GetWorkflowConf(self, processID, contextObject=None):
     """
     Get the workflow process configuration.
     
     returns configuration or None
     """
     v = self.registry.queryAdapter(contextObject or _GlobalObject(), IWfProcessConf, name=processID)
     if v:
         return v[0]
     return None
Пример #8
0
 def GetToolConf(self, toolID, contextObject=None):
     """
     Get the tool configuration.
     
     returns configuration or None
     """
     if not contextObject:
         contextObject = _GlobalObject()
     v = self.registry.queryAdapter(contextObject, IToolConf, name=toolID)
     if v:
         return v[0]
     return None
Пример #9
0
 def GetWorkflowConf(self, processID, contextObject=None):
     """
     Get the workflow process configuration.
     
     returns configuration or None
     """
     v = self.registry.queryAdapter(contextObject or _GlobalObject(),
                                    IWfProcessConf,
                                    name=processID)
     if v:
         return v[0]
     return None
Пример #10
0
 def GetToolConf(self, toolID, contextObject=None):
     """
     Get the tool configuration.
     
     returns configuration or None
     """
     if not contextObject:
         contextObject = _GlobalObject()
     v = self.registry.queryAdapter(contextObject, IToolConf, name=toolID)
     if v:
         return v[0]
     return None