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