]>
Commit | Line | Data |
---|---|---|
d14a1e28 | 1 | """PyAlaMode is a programmer's editor.""" |
1fded56b | 2 | |
d14a1e28 RD |
3 | __author__ = "Patrick K. O'Brien <pobrien@orbtech.com>" |
4 | __cvsid__ = "$Id$" | |
5 | __revision__ = "$Revision$"[11:-2] | |
1fded56b | 6 | |
d14a1e28 | 7 | import wx |
d40bbd4d | 8 | from wx import py |
d14a1e28 RD |
9 | |
10 | import os | |
11 | import sys | |
12 | ||
d14a1e28 RD |
13 | class App(wx.App): |
14 | """PyAlaMode standalone application.""" | |
15 | ||
16 | def __init__(self, filename=None): | |
17 | self.filename = filename | |
18 | wx.App.__init__(self, redirect=False) | |
19 | ||
20 | def OnInit(self): | |
21 | wx.InitAllImageHandlers() | |
d40bbd4d | 22 | self.frame = py.editor.EditorNotebookFrame(filename=self.filename) |
d14a1e28 RD |
23 | self.frame.Show() |
24 | self.SetTopWindow(self.frame) | |
25 | return True | |
26 | ||
27 | def main(filename=None): | |
28 | if not filename and len(sys.argv) > 1: | |
29 | filename = sys.argv[1] | |
30 | if filename: | |
31 | filename = os.path.realpath(filename) | |
32 | app = App(filename) | |
33 | app.MainLoop() | |
8b9a4190 RD |
34 | |
35 | if __name__ == '__main__': | |
36 | main() |