[tuxdroid-svn] r315 - software/tuxgi/trunk
Status: Beta
Brought to you by:
ks156
From: jaguarondi <c2m...@c2...> - 2007-05-11 22:03:30
|
Author: jaguarondi Date: 2007-05-12 00:03:29 +0200 (Sat, 12 May 2007) New Revision: 315 Modified: software/tuxgi/trunk/tuxgi.py Log: - BUG: this is an attempt to solve bug #21 in order to support terminals in gnome, kde, xfce and X Modified: software/tuxgi/trunk/tuxgi.py =================================================================== --- software/tuxgi/trunk/tuxgi.py 2007-05-11 21:04:09 UTC (rev 314) +++ software/tuxgi/trunk/tuxgi.py 2007-05-11 22:03:29 UTC (rev 315) @@ -57,10 +57,16 @@ status_list_changed=False toggled_by_event=False -for term in ["gnome-terminal", "konsole", "Terminal", "xterm"]: - if not os.popen('type %s'%term).close(): - terminal_app=term - break +terminal_shells = [ + ('gnome-terminal','gnome-terminal -x python -i /opt/tuxdroid/api/python/tux.py'), # gnome + ('konsole','konsole -e python -i /opt/tuxdroid/api/python/tux.py'), # kde + ('Terminal',' -x python -i /opt/tuxdroid/api/python/tux.py'), # xfce + ('xterm','xterm -e python -i /opt/tuxdroid/api/python/tux.py'), # X + ] # list of tuple instead of a dictionary as the order matters +for term in terminal_shells: + if not os.popen('type %s'%term[0]).close(): + xterm_cmd = term[1] + break #============================================================================== # Main window class #============================================================================== @@ -379,7 +385,7 @@ # On "Tux Droid shell" button clicked #-------------------------------------------------------------------------- def on_tdshell_bt_clicked(self, widget, *args): - tux.sys.shell_free(terminal_app + ' -e "tuxsh"') + tux.sys.shell_free(xterm_cmd) #-------------------------------------------------------------------------- # On "Get light level" button clicked |