d14a1e2856
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24541 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
44 lines
909 B
Python
44 lines
909 B
Python
"""PyAlaCarte is a simple programmer's editor."""
|
|
|
|
__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
|
|
__cvsid__ = "$Id$"
|
|
__revision__ = "$Revision$"[11:-2]
|
|
|
|
import wx
|
|
|
|
import os
|
|
import sys
|
|
|
|
import editor
|
|
|
|
try:
|
|
True
|
|
except NameError:
|
|
True = 1==1
|
|
False = 1==0
|
|
|
|
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()
|