-
Notifications
You must be signed in to change notification settings - Fork 2
/
piedit.py
49 lines (40 loc) · 1.12 KB
/
piedit.py
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python
"""Piet IDE, written in Python. It's badass."""
import sys
import os.path
import threading
import signal
import pygtk
import gtk
import gtk.glade
import gnome
import piedit.ui
import piedit.interpreter
pygtk.require("2.0")
__author__ = "Steven Anderson"
__copyright__ = "Steven Anderson 2008"
__credits__ = ["Steven Anderson"]
__license__ = "GPL"
__version__ = "0.0.1"
__maintainer__ = "Steven Anderson"
__email__ = "[email protected]"
__status__ = "Production"
class Program:
"""Class that runs the main program"""
def __init__(self):
"""Loads the glade XML and creates the ui object"""
gnome.init("Piedit", "0.1")
gladeui = gtk.glade.XML(os.path.join('glade', 'piedit.glade'))
ui = piedit.ui.UI(gladeui)
class GuiThread(threading.Thread):
def run(self):
gtk.main()
def key_interrupt(num,frame):
print "Termieffnated"
raise SystemExit
if __name__ == "__main__":
signal.signal(signal.SIGINT,key_interrupt)
program = Program()
gtk.gdk.threads_init()
gui_thread = GuiThread()
gui_thread.start()