Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pykat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Steinlechner
pykat
Commits
1745f726
Commit
1745f726
authored
11 years ago
by
Andreas Freise
Browse files
Options
Downloads
Patches
Plain Diff
adding tags to commands based on FTblock/FTend.
parent
e940d8bf
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
pykat/finesse.py
+11
-7
11 additions, 7 deletions
pykat/finesse.py
with
11 additions
and
7 deletions
pykat/finesse.py
+
11
−
7
View file @
1745f726
...
...
@@ -121,22 +121,24 @@ class kat(object):
def
parseCommands
(
self
,
commands
):
blockComment
=
False
currentTag
=
""
self
.
__
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
(
"
"
)
values
=
line
.
split
(
"
"
)
if
values
[
0
]
==
"
%%%
"
:
if
values
[
1
]
==
"
FTblock
"
:
newTag
=
values
[
2
]
if
newTag
!=
self
.
__currentTag
and
self
.
__currentTag
:
warnings
.
warn
(
"
found block {0} before block {1} ended
"
.
format
(
newTag
,
self
.
__currentTag
))
self
.
__currentTag
=
newTag
if
values
[
1
]
==
"
FTend
"
:
if
currentTag
!=
values
[
2
]:
warnings
.
warn
(
"
Found FTend {0} but expected block {1) to end
"
.
format
(
values
[
2
],
currentTag
))
currentTag
=
""
self
.
__currentTag
=
""
continue
#warnings.warn("current tag {0}".format(self.__currentTag))
# don't read comment lines
if
line
[
0
]
==
"
#
"
or
line
[
0
]
==
"
%
"
:
...
...
@@ -163,6 +165,7 @@ class kat(object):
else
:
print
"
Parsing `{0}` into pykat object not implemented yet, added as extra line.
"
.
format
(
line
)
self
.
__extra_lines
.
append
(
line
+
"
\n
"
)
self
.
__currentTag
=
""
def
run
(
self
,
printout
=
1
,
printerr
=
1
,
save_output
=
False
,
save_kat
=
False
,
kat_name
=
None
)
:
"""
...
...
@@ -295,6 +298,7 @@ class kat(object):
def
add
(
self
,
obj
)
:
try
:
obj
.
tag
=
self
.
__currentTag
if
isinstance
(
obj
,
Component
):
if
obj
.
name
in
self
.
__components
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment