Skip to content

Commit

Permalink
refine goagent-gtk.py
Browse files Browse the repository at this point in the history
  • Loading branch information
phuslu committed Oct 25, 2012
1 parent c98646e commit 3c984a7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions local/goagent-gtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Contributor:
# Phus Lu <phus.lu@gmail.com>

__version__ = '1.0'
__version__ = '1.1'

import sys
import os
Expand All @@ -13,8 +13,11 @@
import pygtk
pygtk.require('2.0')
import gtk
import appindicator

try:
import appindicator
except ImportError:
sys.exit(gtk.MessageDialog (None, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, u'\u8bf7\u5b89\u88c5 python-appindicator').run())
try:
import vte
except ImportError:
Expand Down Expand Up @@ -63,7 +66,10 @@ def quit(self, widget, data=None):


def main():
os.chdir(os.path.abspath(os.path.dirname(__file__)))
global __file__
if os.path.islink(__file__):
__file__ = getattr(os, 'readlink', lambda x:x)(__file__)
os.chdir(os.path.dirname(os.path.abspath(__file__)))
os.system('chmod +x proxy.py')
v = vte.Terminal ()
v.connect ("child-exited", lambda term: gtk.main_quit())
Expand Down

0 comments on commit 3c984a7

Please sign in to comment.