Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
genotoul-bioinfo
jflow
Commits
98a85464
Commit
98a85464
authored
Jul 04, 2017
by
Floreal Cabanettes
Browse files
Merge dev
parents
548ab5f1
4e2f1031
Changes
4
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
98a85464
...
...
@@ -3,3 +3,5 @@ application.properties
<path>
*__pycache__*
docs/data
*.pyc
*.bak
bin/jflow_admin.py
View file @
98a85464
...
...
@@ -79,6 +79,11 @@ if __name__ == '__main__':
sub_parser
.
add_argument
(
"--errors"
,
action
=
"store_true"
,
help
=
"Display failed commands"
,
default
=
False
,
dest
=
"display_errors"
)
sub_parser
.
set_defaults
(
cmd_object
=
"status"
)
# Add tools workflow availability
sub_parser
=
subparsers
.
add_parser
(
"tools"
,
help
=
"Show tools used in a workflow"
)
sub_parser
.
add_argument
(
"workflow_name"
,
help
=
"Name of the workflow"
)
sub_parser
.
set_defaults
(
cmd_object
=
"tools"
)
args
=
vars
(
parser
.
parse_args
())
...
...
@@ -130,4 +135,9 @@ if __name__ == '__main__':
if
i
<
len
(
workflows
)
-
1
:
status
+=
"
\n
"
else
:
status
=
"no workflow available"
print
(
status
)
\ No newline at end of file
elif
args
[
"cmd_object"
]
==
"tools"
:
workflow
=
wfmanager
.
get_workflow_by_name
(
args
[
"workflow_name"
])
if
workflow
is
not
None
:
print
(
workflow
.
tools_description
)
else
:
print
(
"Workflow not found: "
+
args
[
"workflow_name"
])
src/jflow/workflow.py
View file @
98a85464
...
...
@@ -153,6 +153,7 @@ class Workflow(threading.Thread):
self
.
id
=
id
self
.
name
=
self
.
get_name
()
self
.
description
=
self
.
get_description
()
self
.
tools_description
=
self
.
get_tools_description
()
self
.
__group
=
self
.
jflow_config_reader
.
get_workflow_group
(
self
.
__class__
.
__name__
)
or
Workflow
.
DEFAULT_GROUP
# define the parameters
...
...
@@ -913,6 +914,12 @@ class Workflow(threading.Thread):
"""
raise
NotImplementedError
(
"Workflow.get_description() must be implemented in "
+
self
.
__class__
.
__name__
)
def
get_tools_description
(
self
):
"""
Return the workflow description, has to be implemented by subclasses
"""
return
""
def
get_summary
(
self
):
"""
Return a workflow summary, if implemented by subclasses
...
...
src/jflow/workflows_manager.py
View file @
98a85464
...
...
@@ -194,6 +194,20 @@ class WorkflowsManager(object):
if
class_name
==
workflow_class
:
return
obj
()
return
None
def
get_workflow_by_name
(
self
,
workflow_name
):
"""
Get workflow by name, case insensitive
:param workflow_name: workflow name
:return: workflow object
"""
for
importer
,
modname
,
ispkg
in
pkgutil
.
iter_modules
(
workflows
.
__path__
,
workflows
.
__name__
+
"."
):
__import__
(
modname
)
# Search for Workflow classes
for
class_name
,
obj
in
inspect
.
getmembers
(
sys
.
modules
[
modname
],
inspect
.
isclass
):
if
class_name
.
lower
()
==
workflow_name
.
lower
():
return
obj
()
return
None
def
get_workflow
(
self
,
workflow_id
):
rworkflow_id
=
utils
.
get_nb_string
(
workflow_id
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment