X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1fded56b375bf7a4687af1cdb182899614c1b2a8..2abd8d78a69cbe726f957de91929feeeac21cfb0:/wxPython/wx/py/PyAlaCarte.py diff --git a/wxPython/wx/py/PyAlaCarte.py b/wxPython/wx/py/PyAlaCarte.py index 64c8b6304e..561224489c 100644 --- a/wxPython/wx/py/PyAlaCarte.py +++ b/wxPython/wx/py/PyAlaCarte.py @@ -1,11 +1,36 @@ +"""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 " __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 +from wx import py + +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() + self.frame = py.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()