]>
Commit | Line | Data |
---|---|---|
d14a1e28 | 1 | """PyAlaCarte is a simple 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 RD |
7 | import wx |
8 | ||
9 | import os | |
10 | import sys | |
11 | ||
12 | import editor | |
13 | ||
d14a1e28 RD |
14 | class App(wx.App): |
15 | """PyAlaCarte standalone application.""" | |
16 | ||
17 | def __init__(self, filename=None): | |
18 | self.filename = filename | |
19 | wx.App.__init__(self, redirect=False) | |
20 | ||
21 | def OnInit(self): | |
22 | wx.InitAllImageHandlers() | |
23 | self.frame = editor.EditorFrame(filename=self.filename) | |
24 | self.frame.Show() | |
25 | self.SetTopWindow(self.frame) | |
26 | return True | |
27 | ||
28 | def main(filename=None): | |
29 | if not filename and len(sys.argv) > 1: | |
30 | filename = sys.argv[1] | |
31 | if filename: | |
32 | filename = os.path.realpath(filename) | |
33 | app = App(filename) | |
34 | app.MainLoop() | |
8b9a4190 RD |
35 | |
36 | if __name__ == '__main__': | |
37 | main() |