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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Steinlechner
pykat
Commits
5a585425
Commit
5a585425
authored
Dec 14, 2013
by
Andreas Freise
Browse files
Options
Downloads
Patches
Plain Diff
adding pkex to a lot of exception calls.
parent
fed6f816
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
+9
-8
9 additions, 8 deletions
pykat/finesse.py
with
9 additions
and
8 deletions
pykat/finesse.py
+
9
−
8
View file @
5a585425
...
@@ -146,7 +146,7 @@ class kat(object):
...
@@ -146,7 +146,7 @@ class kat(object):
self
.
__time_code
=
None
self
.
__time_code
=
None
if
kat_code
!=
None
and
kat_file
!=
None
:
if
kat_code
!=
None
and
kat_file
!=
None
:
raise
BasePyKatException
(
"
Specify either a Kat file or some Kat code, not both.
"
)
raise
pkex
.
BasePyKatException
(
"
Specify either a Kat file or some Kat code, not both.
"
)
if
kat_code
!=
None
:
if
kat_code
!=
None
:
self
.
parseCommands
(
kat_code
)
self
.
parseCommands
(
kat_code
)
...
@@ -304,7 +304,7 @@ class kat(object):
...
@@ -304,7 +304,7 @@ class kat(object):
katfile
.
flush
()
katfile
.
flush
()
katfile
.
close
()
katfile
.
close
()
except
BasePyKatException
as
ex
:
except
pkex
.
BasePyKatException
as
ex
:
print
ex
print
ex
def
run
(
self
,
printout
=
0
,
printerr
=
0
,
save_output
=
False
,
save_kat
=
False
,
kat_name
=
None
)
:
def
run
(
self
,
printout
=
0
,
printerr
=
0
,
save_output
=
False
,
save_kat
=
False
,
kat_name
=
None
)
:
...
@@ -313,6 +313,8 @@ class kat(object):
...
@@ -313,6 +313,8 @@ class kat(object):
It returns a katRun object which is populated with the various
It returns a katRun object which is populated with the various
data from the simulation run.
data from the simulation run.
"""
"""
start
=
datetime
.
datetime
.
now
()
try
:
try
:
if
not
hasattr
(
self
,
"
xaxis
"
):
if
not
hasattr
(
self
,
"
xaxis
"
):
...
@@ -342,7 +344,6 @@ class kat(object):
...
@@ -342,7 +344,6 @@ class kat(object):
raise
MissingFinesse
()
raise
MissingFinesse
()
print
"
--------------------------------------------------------------
"
print
"
--------------------------------------------------------------
"
start
=
datetime
.
datetime
.
now
()
print
"
Running kat - Started at
"
+
str
(
start
)
print
"
Running kat - Started at
"
+
str
(
start
)
if
hasattr
(
self
,
"
x2axis
"
):
if
hasattr
(
self
,
"
x2axis
"
):
...
@@ -467,7 +468,7 @@ class kat(object):
...
@@ -467,7 +468,7 @@ class kat(object):
else
:
else
:
return
r
return
r
except
FinesseRunError
as
fe
:
except
pkex
.
BasePyKatException
as
fe
:
print
fe
print
fe
finally
:
finally
:
print
""
print
""
...
@@ -482,7 +483,7 @@ class kat(object):
...
@@ -482,7 +483,7 @@ class kat(object):
if
isinstance
(
obj
,
Component
):
if
isinstance
(
obj
,
Component
):
if
obj
.
name
in
self
.
__components
:
if
obj
.
name
in
self
.
__components
:
raise
BasePyKatException
(
"
A component with name
'
{0}
'
has already been added
"
.
format
([
obj
.
name
]))
raise
pkex
.
BasePyKatException
(
"
A component with name
'
{0}
'
has already been added
"
.
format
([
obj
.
name
]))
self
.
__components
[
obj
.
name
]
=
obj
self
.
__components
[
obj
.
name
]
=
obj
self
.
__add_component
(
obj
)
self
.
__add_component
(
obj
)
...
@@ -490,7 +491,7 @@ class kat(object):
...
@@ -490,7 +491,7 @@ class kat(object):
elif
isinstance
(
obj
,
Detector
):
elif
isinstance
(
obj
,
Detector
):
if
obj
.
name
in
self
.
__detectors
:
if
obj
.
name
in
self
.
__detectors
:
raise
BasePyKatException
(
"
A detector
'
{0}
'
has already been added
"
.
format
(
obj
.
name
))
raise
pkex
.
BasePyKatException
(
"
A detector
'
{0}
'
has already been added
"
.
format
(
obj
.
name
))
self
.
__detectors
[
obj
.
name
]
=
obj
self
.
__detectors
[
obj
.
name
]
=
obj
self
.
__add_detector
(
obj
)
self
.
__add_detector
(
obj
)
...
@@ -501,11 +502,11 @@ class kat(object):
...
@@ -501,11 +502,11 @@ class kat(object):
self
.
__add_command
(
obj
)
self
.
__add_command
(
obj
)
else
:
else
:
raise
BasePyKatException
(
"
Object {0} could not be added
"
.
format
(
obj
))
raise
pkex
.
BasePyKatException
(
"
Object {0} could not be added
"
.
format
(
obj
))
obj
.
_on_kat_add
(
self
)
obj
.
_on_kat_add
(
self
)
except
BasePyKatException
as
ex
:
except
pkex
.
BasePyKatException
as
ex
:
print
ex
print
ex
def
readOutFile
(
self
,
filename
):
def
readOutFile
(
self
,
filename
):
...
...
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