Permalink
Browse files

Add Linux PythonGTK wrapper script by lucassmagal

  • Loading branch information...
1 parent 0786cac commit 0d8cbee057f67cba9463ad35f6677b6eb5085b32 @unconed committed Jun 13, 2011
Showing with 50 additions and 0 deletions.
  1. +8 −0 Linux/Readme.txt
  2. +42 −0 Linux/termkit
View
8 Linux/Readme.txt
@@ -0,0 +1,8 @@
+Follow these steps to run TermKit on Linux:
+ http://blog.easytech.com.ar/2011/05/21/playing-with-termkit-with-chrome/
+
+Then, execute "termkit" running one of these:
+ "./termkit"
+ "python termkit"
+
+That's it!
View
42 Linux/termkit
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+
+import gtk
+import webkit
+import os
+from threading import Thread
+
+class TermKitView(object):
+ def __init__(self):
+ self.thread = Thread(target=self.__startProcess)
+ self.thread.start()
+
+ self.view = webkit.WebView()
+
+ self.container = gtk.ScrolledWindow()
+ self.container.add(self.view)
+
+ self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
+ self.window.set_title("TermKit")
+ self.window.set_position(gtk.WIN_POS_CENTER)
+ self.window.set_default_size(600, 500)
+ self.window.connect("destroy", self.destroy)
+
+ self.window.add(self.container)
+ self.window.show_all()
+
+ self.view.open("http://localhost:2222")
+
+ def start(self):
+ gtk.main()
+
+ def destroy(self, widget, data=None):
+ print "> trying to quit....."
+ self.thread._Thread__stop()
+ gtk.main_quit()
+
+ def __startProcess(self):
+ os.system("node ../Node/nodekit.js")
+
+if __name__ == '__main__':
+ termkit = TermKitView()
+ termkit.start()

0 comments on commit 0d8cbee

Please sign in to comment.