64 |
self.session.Destroy() |
self.session.Destroy() |
65 |
Publisher.Destroy(self) |
Publisher.Destroy(self) |
66 |
|
|
|
def MainLoop(self): |
|
|
"""Call the inherited MainLoop method and then call OnExit. |
|
|
|
|
|
In wxPython OnExit isn't called automatically, unfortunately, so |
|
|
we do it here. |
|
|
""" |
|
|
wxApp.MainLoop(self) |
|
|
self.OnExit() |
|
|
|
|
67 |
def read_startup_files(self): |
def read_startup_files(self): |
68 |
"""Read the startup files.""" |
"""Read the startup files.""" |
69 |
# for now the startup file is ~/.thuban/thubanstart.py |
# for now the startup file is ~/.thuban/thubanstart.py |
79 |
# The ImportError exception was raised from |
# The ImportError exception was raised from |
80 |
# inside the thubanstart module. |
# inside the thubanstart module. |
81 |
sys.stderr.write(_("Cannot import the thubanstart" |
sys.stderr.write(_("Cannot import the thubanstart" |
82 |
"module\n")) |
" module\n")) |
83 |
traceback.print_exc(None, sys.stderr) |
traceback.print_exc(None, sys.stderr) |
84 |
else: |
else: |
85 |
# There's no thubanstart module. |
# There's no thubanstart module. |
182 |
self.SetSession(create_empty_session()) |
self.SetSession(create_empty_session()) |
183 |
|
|
184 |
def OpenSession(self, filename): |
def OpenSession(self, filename): |
185 |
|
"""Open the session in the file named filename""" |
186 |
|
# Make sure we deal with an absolute pathname. Otherwise we can |
187 |
|
# get problems when saving because the saving code expects an |
188 |
|
# absolute directory name |
189 |
|
filename = os.path.abspath(filename) |
190 |
session = load_session(filename) |
session = load_session(filename) |
191 |
session.SetFilename(filename) |
session.SetFilename(filename) |
192 |
session.UnsetModified() |
session.UnsetModified() |