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
Tom Harke
pystencils
Commits
f04008e1
Commit
f04008e1
authored
Mar 15, 2019
by
Martin Bauer
Browse files
fields() function regex parsing now works also with python < 3.6
parent
7c6bcb00
Changes
1
Hide whitespace changes
Inline
Side-by-side
field.py
View file @
f04008e1
...
...
@@ -763,7 +763,7 @@ def _parse_description(description):
def
parse_part1
(
d
):
result
=
field_description_regex
.
match
(
d
)
while
result
:
name
,
index_str
=
result
[
1
],
result
[
2
]
name
,
index_str
=
result
.
group
(
1
),
result
.
group
(
2
)
index
=
tuple
(
int
(
e
)
for
e
in
index_str
.
split
(
","
))
if
index_str
else
()
yield
name
,
index
d
=
d
[
result
.
end
():]
...
...
@@ -772,7 +772,7 @@ def _parse_description(description):
def
parse_part2
(
d
):
result
=
type_description_regex
.
match
(
d
)
if
result
:
data_type_str
,
size_info
=
result
[
1
],
result
[
2
]
.
strip
().
lower
()
data_type_str
,
size_info
=
result
.
group
(
1
),
result
.
group
(
2
)
.
strip
().
lower
()
if
data_type_str
is
None
:
data_type_str
=
'float64'
data_type_str
=
data_type_str
.
lower
().
strip
()
...
...
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