Commit bda39443 authored by Floreal Cabanettes's avatar Floreal Cabanettes
Browse files

Merge remote-tracking branch 'origin' into dev

parents 425a3025 fd99b07a
......@@ -16,6 +16,7 @@
#
import os
import re
import sys
import inspect
import logging
......@@ -29,7 +30,7 @@ class JFlowConfigReader(object):
"""
CONFIG_FILE_PATH = "../../application.properties"
USER_PATTERN = re.compile("###USER###")
def __init__(self):
"""
"""
......@@ -37,12 +38,18 @@ class JFlowConfigReader(object):
self.reader.read(os.path.join(os.path.dirname(inspect.getfile(self.__class__)), self.CONFIG_FILE_PATH))
def get_tmp_directory(self):
if not os.path.isdir(self.reader.get("storage", "tmp_directory").replace("###USER###",os.getenv("USER"))):
os.makedirs(self.reader.get("storage", "tmp_directory").replace("###USER###",os.getenv("USER")), 0o751)
return self.reader.get("storage", "tmp_directory").replace("###USER###",os.getenv("USER"))
tmp_dir=self.reader.get("storage", "tmp_directory")
if self.USER_PATTERN.search(self.reader.get("storage", "tmp_directory")) is not None :
tmp_dir=tmp_dir.replace("###USER###",os.getenv("USER"))
if not os.path.isdir(tmp_dir):
os.makedirs(tmp_dir, 0o751)
return tmp_dir
def get_work_directory(self):
return self.reader.get("storage", "work_directory").replace("###USER###",os.getenv("USER"))
if self.USER_PATTERN.search(self.reader.get("storage", "work_directory")) is None :
return self.reader.get("storage", "work_directory")
else:
return self.reader.get("storage", "work_directory").replace("###USER###",os.getenv("USER"))
def get_exec(self, software):
try:
......@@ -59,9 +66,13 @@ class JFlowConfigReader(object):
@return: the path to the log file
"""
try:
return self.reader.get('storage', 'log_file').replace("###USER###",os.getenv("USER"))
if self.USER_PATTERN.search(self.reader.get("storage", "log_file")) is None :
return self.reader.get('storage', 'log_file')
else :
return self.reader.get('storage', 'log_file').replace("###USER###",os.getenv("USER"))
except :
raise NoOptionError("Failed when parsing the config file, no section logging found!")
def get_makeflow_path(self):
try:
......
......@@ -383,24 +383,38 @@ class Workflow(threading.Thread):
all_nodes[ioparameter.name] = None
elif issubclass(ioparameter.__class__, MultiParameter):
for subparam in ioparameter.sub_parameters:
gr.add_node(subparam.name)
all_nodes[subparam.name] = None
if issubclass(subparam.__class__, InputFile):
all_nodes[subparam.name] = None
gr.add_node(subparam.name)
gr.add_node_attribute(subparam.name, self.INPUTFILE_GRAPH_LABEL)
gr.add_node_attribute(subparam.name, subparam.display_name)
elif issubclass(subparam.__class__, InputFileList):
all_nodes[subparam.name] = None
gr.add_node(subparam.name)
gr.add_node_attribute(subparam.name, self.INPUTFILES_GRAPH_LABEL)
gr.add_node_attribute(subparam.name, subparam.display_name)
elif issubclass(subparam.__class__, InputDirectory):
all_nodes[subparam.name] = None
gr.add_node(subparam.name)
gr.add_node_attribute(subparam.name, self.INPUTDIRECTORY_GRAPH_LABEL)
gr.add_node_attribute(subparam.name, subparam.display_name)
gr.add_node_attribute(subparam.name, subparam.display_name)
elif issubclass(ioparameter.__class__, MultiParameterList):
for subparam in ioparameter.sub_parameters:
gr.add_node(subparam.name)
all_nodes[subparam.name] = None
if issubclass(subparam.__class__, InputDirectory):
gr.add_node_attribute(subparam.name, self.INPUTDIRECTORY_GRAPH_LABEL)
else:
if issubclass(subparam.__class__, InputFile):
all_nodes[subparam.name] = None
gr.add_node(subparam.name)
gr.add_node_attribute(subparam.name, self.INPUTFILE_GRAPH_LABEL)
gr.add_node_attribute(subparam.name, subparam.display_name)
elif issubclass(subparam.__class__, InputFileList):
all_nodes[subparam.name] = None
gr.add_node(subparam.name)
gr.add_node_attribute(subparam.name, self.INPUTFILES_GRAPH_LABEL)
gr.add_node_attribute(subparam.name, subparam.display_name)
gr.add_node_attribute(subparam.name, subparam.display_name)
elif issubclass(subparam.__class__, InputDirectory):
all_nodes[subparam.name] = None
gr.add_node(subparam.name)
gr.add_node_attribute(subparam.name, self.INPUTDIRECTORY_GRAPH_LABEL)
gr.add_node_attribute(subparam.name, subparam.display_name)
for cpt in self.components:
gr.add_node(cpt.get_nameid())
gr.add_node_attribute(cpt.get_nameid(), self.COMPONENT_GRAPH_LABEL)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment