2003-11-12 16:34:20 -05:00
|
|
|
"""PyAlaCarte is a simple programmer's editor."""
|
2003-07-02 19:13:10 -04:00
|
|
|
|
2003-11-12 16:34:20 -05:00
|
|
|
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
|
|
|
|
__cvsid__ = "$Id$"
|
|
|
|
__revision__ = "$Revision$"[11:-2]
|
2003-07-02 19:13:10 -04:00
|
|
|
|
2003-11-12 16:34:20 -05:00
|
|
|
import wx
|
2004-03-15 08:42:37 -05:00
|
|
|
from wx import py
|
2003-11-12 16:34:20 -05:00
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
class App(wx.App):
|
|
|
|
"""PyAlaCarte standalone application."""
|
|
|
|
|
|
|
|
def __init__(self, filename=None):
|
|
|
|
self.filename = filename
|
|
|
|
wx.App.__init__(self, redirect=False)
|
|
|
|
|
|
|
|
def OnInit(self):
|
|
|
|
wx.InitAllImageHandlers()
|
2004-03-15 08:42:37 -05:00
|
|
|
self.frame = py.editor.EditorFrame(filename=self.filename)
|
2003-11-12 16:34:20 -05:00
|
|
|
self.frame.Show()
|
|
|
|
self.SetTopWindow(self.frame)
|
|
|
|
return True
|
|
|
|
|
|
|
|
def main(filename=None):
|
|
|
|
if not filename and len(sys.argv) > 1:
|
|
|
|
filename = sys.argv[1]
|
|
|
|
if filename:
|
|
|
|
filename = os.path.realpath(filename)
|
|
|
|
app = App(filename)
|
|
|
|
app.MainLoop()
|
2003-10-01 20:58:06 -04:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|