diff options
author | Ignacio ROdrÃguez <ignaciorodriguez@sugarlabs.org> | 2013-05-14 16:19:58 (GMT) |
---|---|---|
committer | Ignacio ROdrÃguez <ignaciorodriguez@sugarlabs.org> | 2013-05-14 16:19:58 (GMT) |
commit | f164f2ceb46329525e59b648618755d6404dfe78 (patch) | |
tree | 5a6f704f737f4d05d605f70a4149b3d7d90b85f3 | |
parent | ef814c1aa27263ee37439b91a770453fa5846134 (diff) |
Internalization
-rwxr-xr-x | vnclauncher.py | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/vnclauncher.py b/vnclauncher.py index 6c60ef0..7e99d47 100755 --- a/vnclauncher.py +++ b/vnclauncher.py @@ -1,5 +1,6 @@ # Copyright (C) 2007, Eduardo Silva <edsiper@gmail.com>. # Copyright (C) 2008, One Laptop Per Child +# Copyright (C) 2013, SomosAzucar # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -38,6 +39,7 @@ import sys import platform import logging + class VncLauncherActivity(activity.Activity): def _ipaddr_(self,button): @@ -47,7 +49,7 @@ class VncLauncherActivity(activity.Activity): cmd="%s %s" % (ifconfig, iface) output=commands.getoutput(cmd) ipaddr="Error!!" - error="Error!! check wireless connection" + error=_("Error!! check wireless connection") inet = output.find('inet') if inet >= 0: print iface @@ -61,7 +63,7 @@ class VncLauncherActivity(activity.Activity): else: ipaddr=error - button.set_label('Please Click to find current IP address \n\n' + + button.set_label(_('Please Click to find current IP address \n\n') + ipaddr) def __init__(self, handle): @@ -72,24 +74,24 @@ class VncLauncherActivity(activity.Activity): self.set_title(_('X11 VNC Server Activity')) self.connect('key-press-event', self.__key_press_cb) - args="Please Click to find current IP address" + args=_("Please Click to find current IP address") box = gtk.HBox(False, 10) table=gtk.Table(4,1,True) button=gtk.Button(args) button.connect("clicked",self._ipaddr_) table.attach(button,0,1,0,1,gtk.FILL|gtk.EXPAND,gtk.EXPAND|gtk.FILL,25,25) button.show() - button=gtk.Button("Start X11 VNC Server") + button=gtk.Button(_("Start X11 VNC Server")) button.connect("clicked",self.connectVNC) table.attach(button,0,1,1,2,gtk.FILL|gtk.EXPAND,gtk.FILL|gtk.EXPAND,25,25) button.show() - button=gtk.Button("Stop X11 VNC Server") + button=gtk.Button(_("Stop X11 VNC Server")) button.connect("clicked",self.stopVNC) table.attach(button,0,1,2,3,gtk.FILL,gtk.FILL,25,25) button.show() - button=gtk.Button("Exit VncLauncherActivity") + button=gtk.Button(_("Exit VncLauncherActivity")) button.connect("clicked",lambda w:gtk.main_quit()) table.attach(button,0,1,3,4,gtk.FILL,gtk.FILL,25,25) button.show() @@ -113,20 +115,24 @@ class VncLauncherActivity(activity.Activity): self._vte.grab_focus() # check if x11vnc is installed cmd = '/usr/bin/x11vnc' - if os.path.isfile(cmd) and os.access(cmd, os.X_OK): + if os.path.isfile(cmd) and os.access(cmd, os.X_OK) and os.path.exists(cmd): logging.error('Using x11vnc installed in the system') + self.env = "/usr/lib" else: - # check platform if platform.machine().startswith('arm'): path = os.path.join(activity.get_bundle_path(), 'bin/arm') + elif platform.machine().startswith('x86_64'): + path = os.path.join(activity.get_bundle_path(), + 'bin/x86') else: path = os.path.join(activity.get_bundle_path(), 'bin/i586') - env = {'LD_LIBRARY_PATH':'%s/lib' % path} + self.env = {'LD_LIBRARY_PATH':'%s/lib' % path} cmd = os.path.join(path, 'x11vnc') logging.error('Using %s', cmd) - self._vte.fork_command(cmd, envv=env) + + self._vte.fork_command(cmd, envv=self.env) def __key_press_cb(self, window, event): return False |