]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/wx/py/PyAlaMode.py
Docstring tweaks
[wxWidgets.git] / wxPython / wx / py / PyAlaMode.py
index 6acf8f83e018baf5518aa788fe03af8d5edd3001..06d1583657669f9891162436d3c2170ab154daf1 100644 (file)
@@ -1,11 +1,37 @@
+"""PyAlaMode is a 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]
 
 __cvsid__ = "$Id$"
 __revision__ = "$Revision$"[11:-2]
 
-from wx import _rename
-from wxPython.py import PyAlaMode
-_rename(globals(), PyAlaMode.__dict__, modulename='py.PyAlaMode')
-del PyAlaMode
-del _rename
+import wx
+
+import os
+import sys
+
+import editor
+
+class App(wx.App):
+    """PyAlaMode standalone application."""
+
+    def __init__(self, filename=None):
+        self.filename = filename
+        wx.App.__init__(self, redirect=False)
+
+    def OnInit(self):
+        wx.InitAllImageHandlers()
+        self.frame = editor.EditorNotebookFrame(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()