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
groupe-calcul
website
Commits
3d67d0ab
Commit
3d67d0ab
authored
Mar 20, 2020
by
Roland Denis
Browse files
Missing meso attributes and adding type of multiline list items
parent
97b84d9c
Pipeline
#6596
passed with stages
in 55 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
plugins/meso_list/directives.py
View file @
3d67d0ab
...
...
@@ -8,13 +8,15 @@ from . import json
###############################################################################
# Directive's options converter
def
csv_list
(
s
):
def
csv_list
(
items_type
=
str
):
""" Comma separated values as a list. """
return
[
value
.
strip
()
for
value
in
s
.
split
(
','
)]
def
multiline_list
(
s
):
return
lambda
s
:
[
items_type
(
value
.
strip
())
for
value
in
s
.
split
(
','
)]
def
multiline_list
(
items_type
=
str
):
""" List formatted as a multi-line string """
return
s
.
splitlines
()
return
lambda
s
:
list
(
map
(
items_type
,
s
.
splitlines
()))
###############################################################################
...
...
@@ -82,20 +84,22 @@ class Meso(Directive):
required_arguments
=
0
optional_arguments
=
10
final_argument_whitespace
=
True
option_spec
=
{
'institutesname'
:
multiline_list
,
option_spec
=
{
# Option name in lowercase!
'institutesname'
:
multiline_list
(
str
)
,
'url'
:
directives
.
uri
,
'financersname'
:
multiline_list
,
'financersname'
:
multiline_list
(
str
)
,
'location'
:
str
,
'gpscoordinates'
:
multiline_list
,
'gpscoordinates'
:
multiline_list
(
float
)
,
'contactname'
:
str
,
'contactaddress'
:
str
,
'totalcorenumber'
:
int
,
'totalstorage'
:
int
,
'totalgpunumber'
:
int
,
'totalram'
:
int
,
'accesspolicy'
:
multiline_list
,
'distributedinfra'
:
multiline_list
(
str
),
'servicename'
:
multiline_list
(
str
),
'etptnumber'
:
float
,
'accesspolicy'
:
multiline_list
(
str
),
}
has_content
=
True
...
...
Write
Preview
Supports
Markdown
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