File: PyAlaModeTest.py

package info (click to toggle)
wxwidgets2.6 2.6.3.2.2-3%2Blenny1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 81,112 kB
  • ctags: 130,304
  • sloc: cpp: 820,106; ansic: 113,030; python: 107,469; makefile: 43,013; sh: 10,300; lex: 194; yacc: 128; xml: 95; pascal: 74
file content (35 lines) | stat: -rwxr-xr-x 886 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""PyAlaModeTest is a programmer's editor."""

__author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
__cvsid__ = "$Id: PyAlaModeTest.py,v 1.4 2004/03/15 13:42:37 PKO Exp $"
__revision__ = "$Revision: 1.4 $"[11:-2]

import wx
from wx import py

import os
import sys

class App(wx.App):
    """PyAlaModeTest 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.EditorShellNotebookFrame(filename=self.filename)
        self.frame.Show()
        self.SetTopWindow(self.frame)
        return True

def main(filename=None):
    app = App(filename)
    app.MainLoop()

if __name__ == '__main__':
    filename = None
    if len(sys.argv) > 1:
        filename = os.path.realpath(sys.argv[1])
    main(filename)