Skip to content
GitLab
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
8536ddb2
Commit
8536ddb2
authored
Jun 29, 2016
by
Céline Noirot
Browse files
Add ###USER### placeholder in storage section.
parent
a0b8de25
Changes
3
Hide whitespace changes
Inline
Side-by-side
application.properties
View file @
8536ddb2
...
...
@@ -47,6 +47,7 @@ from_password =
#message =
[storage]
# In this section, ###USER### (if it's used) is replaced by $USER environment variable.
# where should be written the log file
log_file
=
<path>/jflow.log
# Where should the pipelines write results, should be accessible
...
...
docs/jflow_advanced_configuration.html
View file @
8536ddb2
...
...
@@ -219,8 +219,13 @@
<section
id=
"storage"
class=
"group"
>
<h1
class=
"page-header"
>
Storage
<small>
section
</small></h1>
<p>
This section configure the paths used by all workflows.
This section configure the paths used by all workflows.
</p>
<p>
On a multi-user computer or cluster you can use placeholder
<code>
###USER###
</code>
.
<code>
###USER###
</code>
will be replace by the environment variable
<code>
$USER
</code>
.
</p>
<div
class=
"table-responsive"
>
<table
class=
"table table-bordered table-striped"
>
<thead>
...
...
src/jflow/config_reader.py
View file @
8536ddb2
...
...
@@ -37,12 +37,12 @@ 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"
)):
os
.
makedirs
(
self
.
reader
.
get
(
"storage"
,
"tmp_directory"
),
0o751
)
return
self
.
reader
.
get
(
"storage"
,
"tmp_directory"
)
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"
))
def
get_work_directory
(
self
):
return
self
.
reader
.
get
(
"storage"
,
"work_directory"
)
return
self
.
reader
.
get
(
"storage"
,
"work_directory"
)
.
replace
(
"###USER###"
,
os
.
getenv
(
"USER"
))
def
get_exec
(
self
,
software
):
try
:
...
...
@@ -59,7 +59,7 @@ class JFlowConfigReader(object):
@return: the path to the log file
"""
try
:
return
self
.
reader
.
get
(
'storage'
,
'log_file'
)
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!"
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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