]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/py/PyAlaCarte.py
Script updates
[wxWidgets.git] / wxPython / wx / py / PyAlaCarte.py
index f7ecb0740e23642eec9cd4475e1efac2e3661f76..c665e4f4b608f2b80d27044409c5355c84bad0c6 100644 (file)
@@ -1,11 +1,37 @@
+"""PyAlaCarte is a simple programmer's editor."""
 
-"""Renamer stub: provides a way to drop the wx prefix from wxPython objects."""
+__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
+__cvsid__ = "$Id$"
+__revision__ = "$Revision$"[11:-2]
 
-from wx import _rename
-from wxPython.py import PyAlaCarte
-_rename(globals(), PyAlaCarte.__dict__, modulename='py.PyAlaCarte')
-del PyAlaCarte
-del _rename
+import wx
+
+import os
+import sys
+
+import editor
+
+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()
+        self.frame = editor.EditorFrame(filename=self.filename)
+        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()
 
 if __name__ == '__main__':
     main()