[tuxdroid-svn] r427 - software/tuxgi/trunk
Status: Beta
Brought to you by:
ks156
From: neimad <c2m...@c2...> - 2007-06-24 11:44:15
|
Author: neimad Date: 2007-06-24 13:44:13 +0200 (Sun, 24 Jun 2007) New Revision: 427 Modified: software/tuxgi/trunk/tuxgi.py Log: * Hide the shell's error message when it doesn't find ipython or one of the known terminals. * Print a warning on stderr if no known terminal is found. Todo: we should disable the "Tux Droid Shell" button in that case. Modified: software/tuxgi/trunk/tuxgi.py =================================================================== --- software/tuxgi/trunk/tuxgi.py 2007-06-23 19:55:50 UTC (rev 426) +++ software/tuxgi/trunk/tuxgi.py 2007-06-24 11:44:13 UTC (rev 427) @@ -69,16 +69,21 @@ voice_list = gtk.ListStore(gobject.TYPE_STRING) voice_dic = {} current_voice = "" -if not os.popen('type ipython').close(): +if not os.popen('type ipython 2>/dev/null').close(): py_cmd = 'ipython' else: py_cmd = 'python' for term in terminal_shells: - if not os.popen('type %s'%term[0]).close(): + if not os.popen('type %s 2>/dev/null' % term[0]).close(): xterm_cmd = '%s %s %s -i /opt/tuxdroid/api/python/tux.py' \ % (term[0], term[1], py_cmd) break + +if xterm_cmd is None: + sys.stderr.write("Warning: couldn't find any suitable terminal" + " to use as Tux Droid shell\n") + #============================================================================== # Main window class #============================================================================== |