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
8eb10f39
Commit
8eb10f39
authored
Mar 20, 2015
by
Jerome Mariette
Browse files
better handle of choices
parent
e67ed994
Changes
3
Show whitespace changes
Inline
Side-by-side
src/jflow/parameter.py
View file @
8eb10f39
...
...
@@ -357,6 +357,9 @@ class AbstractParameter(object):
except
:
self
.
type
=
types
.
StringType
# Set parameter value
if
choices
!=
None
and
default
==
None
:
self
.
default
=
choices
[
0
]
else
:
self
.
default
=
default
def
export_to_argparse
(
self
):
...
...
src/jflow/workflow.py
View file @
8eb10f39
...
...
@@ -292,7 +292,7 @@ class Workflow(threading.Thread):
# Retrieve value
if
args
.
has_key
(
parameter
.
__getattribute__
(
key
)):
value
=
args
[
parameter
.
__getattribute__
(
key
)]
elif
parameter
!=
None
:
elif
parameter
.
default
!=
None
:
value
=
parameter
.
default
else
:
value
=
None
...
...
src/js/jflow-wfform.js
View file @
8eb10f39
...
...
@@ -733,8 +733,7 @@ Handsontable.cellTypes["bootdate"] = Handsontable.BootstrapDateCell;
}
else
if
(
params_per_name
[
param_name
].
sub_parameters
[
i
].
type
==
"
date
"
)
{
columns
.
push
({
data
:
params_per_name
[
param_name
].
sub_parameters
[
i
].
name
,
type
:
"
bootdate
"
,
dateFormat
:
params_per_name
[
param_name
].
sub_parameters
[
i
].
format
});
}
else
if
(
params_per_name
[
param_name
].
sub_parameters
[
i
].
choices
!=
null
)
{
var
all_choices
=
$
.
merge
(
[
""
],
params_per_name
[
param_name
].
sub_parameters
[
i
].
choices
);
columns
.
push
({
data
:
params_per_name
[
param_name
].
sub_parameters
[
i
].
name
,
type
:
"
dropdown
"
,
source
:
all_choices
.
map
(
String
)});
columns
.
push
({
data
:
params_per_name
[
param_name
].
sub_parameters
[
i
].
name
,
type
:
"
dropdown
"
,
source
:
params_per_name
[
param_name
].
sub_parameters
[
i
].
choices
.
map
(
String
)});
}
else
{
// TODO handle file types selection
allTypes
[
params_per_name
[
param_name
].
sub_parameters
[
i
].
name
]
=
params_per_name
[
param_name
].
sub_parameters
[
i
].
type
;
...
...
@@ -893,9 +892,10 @@ Handsontable.cellTypes["bootdate"] = Handsontable.BootstrapDateCell;
,
i
,
ilen
=
changes
.
length
,
c
,
clen
=
instance
.
co
lCo
unt
,
clen
=
instance
.
count
Cols
()
,
rowColumnSeen
=
{}
,
rowsToFill
=
{};
for
(
i
=
0
;
i
<
ilen
;
i
++
)
{
if
(
changes
[
i
][
2
]
===
null
&&
changes
[
i
][
3
]
!==
null
)
{
//if oldVal is empty
if
(
isEmptyRow
(
instance
,
changes
[
i
][
0
]))
{
...
...
@@ -907,12 +907,13 @@ Handsontable.cellTypes["bootdate"] = Handsontable.BootstrapDateCell;
for
(
var
r
in
rowsToFill
)
{
if
(
rowsToFill
.
hasOwnProperty
(
r
))
{
for
(
c
=
0
;
c
<
clen
;
c
++
)
{
if
(
!
rowColumnSeen
[
r
+
'
/
'
+
c
])
{
//if it is not provided by user in this change set, take value from template
changes
.
push
([
r
,
c
,
null
,
rowTemplate
[
c
]]);
if
(
!
rowColumnSeen
[
r
+
'
/
'
+
instance
.
colToProp
(
c
)
])
{
//if it is not provided by user in this change set, take value from template
changes
.
push
([
parseInt
(
r
),
instance
.
colToProp
(
c
)
,
null
,
rowTemplate
[
c
]]);
}
}
}
}
}
});
});
...
...
@@ -1181,11 +1182,6 @@ Handsontable.cellTypes["bootdate"] = Handsontable.BootstrapDateCell;
'
{{else}}
'
,
// if it's a single choice parameter, add a simple select
'
<select id="${param.name}" name="${param.name}" class="form-control">
'
,
'
{{/if}}
'
,
'
{{if param.default != null}}
'
,
'
<option></option>
'
,
'
{{else}}
'
,
'
<option selected></option>
'
,
'
{{/if}}
'
,
'
{{each(j, choice) param.choices}}
'
,
'
{{if choice == param.default}}
'
,
'
<option selected>${choice}</option>
'
,
...
...
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