Commit 5a585425 authored by Andreas Freise's avatar Andreas Freise
Browse files

adding pkex to a lot of exception calls.

parent fed6f816
......@@ -146,7 +146,7 @@ class kat(object):
self.__time_code = 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:
self.parseCommands(kat_code)
......@@ -304,7 +304,7 @@ class kat(object):
katfile.flush()
katfile.close()
except BasePyKatException as ex:
except pkex.BasePyKatException as ex:
print ex
def run(self, printout=0, printerr=0, save_output=False, save_kat=False,kat_name=None) :
......@@ -313,6 +313,8 @@ class kat(object):
It returns a katRun object which is populated with the various
data from the simulation run.
"""
start = datetime.datetime.now()
try:
if not hasattr(self, "xaxis"):
......@@ -342,7 +344,6 @@ class kat(object):
raise MissingFinesse()
print "--------------------------------------------------------------"
start = datetime.datetime.now()
print "Running kat - Started at " + str(start)
if hasattr(self, "x2axis"):
......@@ -467,7 +468,7 @@ class kat(object):
else:
return r
except FinesseRunError as fe:
except pkex.BasePyKatException as fe:
print fe
finally:
print ""
......@@ -482,7 +483,7 @@ class kat(object):
if isinstance(obj, Component):
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.__add_component(obj)
......@@ -490,7 +491,7 @@ class kat(object):
elif isinstance(obj, Detector):
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.__add_detector(obj)
......@@ -501,11 +502,11 @@ class kat(object):
self.__add_command(obj)
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)
except BasePyKatException as ex:
except pkex.BasePyKatException as ex:
print ex
def readOutFile(self, filename):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment