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
finesse
pykat
Commits
e940d8bf
Commit
e940d8bf
authored
Dec 01, 2013
by
Andreas Freise
Browse files
starting to add reading of FTblock/FTend feature.
parent
8223e4ab
Changes
1
Hide whitespace changes
Inline
Side-by-side
pykat/finesse.py
View file @
e940d8bf
...
...
@@ -31,6 +31,7 @@ import numpy as np
import
datetime
import
pickle
import
pykat
import
warnings
from
pykat.exceptions
import
*
...
...
@@ -120,10 +121,23 @@ class kat(object):
def
parseCommands
(
self
,
commands
):
blockComment
=
False
currentTag
=
""
for
line
in
commands
.
split
(
"
\n
"
):
if
len
(
line
.
strip
())
>=
2
:
line
=
line
.
strip
()
# Looking for block start or end
if
line
[
0
:
3
]
==
"%%%"
:
values
=
text
.
split
(
" "
)
if
values
[
1
]
==
"FTblock"
:
newTag
=
values
[
2
]
if
values
[
1
]
==
"FTend"
:
if
currentTag
!=
values
[
2
]:
warnings
.
warn
(
"Found FTend {0} but expected block {1) to end"
.
format
(
values
[
2
],
currentTag
))
currentTag
=
""
continue
# don't read comment lines
if
line
[
0
]
==
"#"
or
line
[
0
]
==
"%"
:
continue
...
...
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