jhbuild r2129 - in trunk: . jhbuild jhbuild/frontends
- From: fpeters svn gnome org
- To: svn-commits-list gnome org
- Subject: jhbuild r2129 - in trunk: . jhbuild jhbuild/frontends
- Date: Wed, 4 Jun 2008 07:24:02 +0000 (UTC)
Author: fpeters
Date: Wed Jun 4 07:24:02 2008
New Revision: 2129
URL: http://svn.gnome.org/viewvc/jhbuild?rev=2129&view=rev
Log:
* jhbuild/frontends/terminal.py: removed occurence of locale.
getpreferredencoding() that fails on Mac OS X.
* jhbuild/main.py: added convenience uencode() function.
Modified:
trunk/ChangeLog
trunk/jhbuild/frontends/terminal.py
trunk/jhbuild/main.py
Modified: trunk/jhbuild/frontends/terminal.py
==============================================================================
--- trunk/jhbuild/frontends/terminal.py (original)
+++ trunk/jhbuild/frontends/terminal.py Wed Jun 4 07:24:02 2008
@@ -265,8 +265,7 @@
for altstate in altstates:
uprint(_(' [%d] go to stage %s') % (i, altstate))
i = i + 1
- val = raw_input(_('choice: ').encode(
- locale.getpreferredencoding(), 'replace'))
+ val = raw_input(uencode(_('choice: ')))
val = val.strip()
if val == '1':
return state
Modified: trunk/jhbuild/main.py
==============================================================================
--- trunk/jhbuild/main.py (original)
+++ trunk/jhbuild/main.py Wed Jun 4 07:24:02 2008
@@ -51,20 +51,21 @@
except (locale.Error, AssertionError):
_encoding = 'ascii'
+def uencode(s):
+ if type(s) is unicode:
+ return s.encode(_encoding, 'replace')
+ else:
+ return s
+
def uprint(*args):
'''Print Unicode string encoded for the terminal'''
for s in args[:-1]:
- if type(s) is unicode:
- print s.encode(_encoding, 'replace'),
- else:
- print s,
+ print uencode(s),
s = args[-1]
- if type(s) is unicode:
- print s.encode(_encoding, 'replace')
- else:
- print s
+ print uencode(s)
__builtin__.__dict__['uprint'] = uprint
+__builtin__.__dict__['uencode'] = uencode
def help_commands(option, opt_str, value, parser):
thisdir = os.path.abspath(os.path.dirname(__file__))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]