@ -50,18 +50,18 @@ def getCompAttr(comp, topic, attr, table=""):
def getTool ( technicType , comp , job ) :
if technicType == B . TOPIC_NODE_DB :
return getDbTool ( comp , job )
return getDbTool ( job , comp )
if technicType == B . TOPIC_NODE_CLI :
return getCliTool ( comp , job )
return getCliTool ( job , comp )
if technicType == B . TOPIC_NODE_API :
return getApiTool ( comp , job )
return getApiTool ( job , comp )
if technicType == B . TOPIC_NODE_FILE :
# TODO im Allgemeinen keine konrete Implementierung aufrufen,
# denn zu einer Komponente koennen unterschiedliche Dateien vorkommen
return getFileTool ( job , comp , " " )
# class ToolManager:
def getDbTool ( comp , job ) :
def getDbTool ( job , comp , dbtype = " " ) :
verify = int ( job . getDebugLevel ( " db_tool " ) )
dbtype = getCompAttr ( comp , B . TOPIC_NODE_DB , B . ATTR_TYPE , " " )
toolname = " db " + dbtype + " _tool "
@ -75,7 +75,7 @@ def getDbTool(comp, job):
c . setComp ( comp )
return c
def getCliTool ( comp , job ) :
def getCliTool ( job , comp ) :
verify = int ( job . getDebugLevel ( " db_tool " ) )
clitype = getCompAttr ( comp , B . TOPIC_NODE_CLI , B . ATTR_TYPE , " " )
toolname = " cli " + clitype + " _tool "
@ -89,7 +89,7 @@ def getCliTool(comp, job):
c . setComp ( comp )
return c
def getApiTool ( comp , job ) :
def getApiTool ( job , comp ) :
verify = int ( job . getDebugLevel ( " db_tool " ) )
apitype = getCompAttr ( comp , B . TOPIC_NODE_API , B . ATTR_TYPE , " " )
toolname = " api " + apitype + " _tool "
@ -104,9 +104,11 @@ def getApiTool(comp, job):
return c
def getFileTool ( job , comp , filenode = " " ) :
verify = int ( job . getDebugLevel ( " db _tool" ) )
if len ( filenode ) > 3 and filenode [ - 1 : ] != " . " :
verify = int ( job . getDebugLevel ( " file _tool" ) )
if len ( filenode ) > 3 and " . " in filenode and filenode [ - 1 : ] != " . " :
filetype = utils . config_tool . getAttribute ( comp , filenode , B . ATTR_ARTS_TYPE , job )
elif len ( filenode ) > 2 and len ( filenode ) < 5 :
filetype = filenode
else :
filetype = getCompAttr ( comp , B . TOPIC_NODE_FILE , B . ATTR_TYPE , " " )
toolname = " file " + filetype + " _tool "