1 |
# Copyright (c) 2001, 2002, 2003, 2004 by Intevation GmbH |
# Copyright (c) 2001-2005 by Intevation GmbH |
2 |
# Authors: |
# Authors: |
3 |
# Jonathan Coles <[email protected]> |
# Jonathan Coles <[email protected]> |
4 |
# Bernhard Reiter <[email protected]> |
# Bernhard Reiter <[email protected]> |
15 |
|
|
16 |
from wxPython.wx import * |
from wxPython.wx import * |
17 |
|
|
18 |
from locale import getlocale |
from locale import getdefaultlocale |
19 |
|
|
20 |
from Thuban import _ |
from Thuban import _ |
21 |
from Thuban.version import versions |
from Thuban.version import versions |
125 |
for author in ext.authors: |
for author in ext.authors: |
126 |
text+= '\t%s\n' % author |
text+= '\t%s\n' % author |
127 |
text += ext.desc |
text += ext.desc |
128 |
|
text += '\n' |
129 |
|
text += 'Status: %s' % ext.status |
130 |
text += '\n\n' |
text += '\n\n' |
131 |
else: |
else: |
132 |
text += _('\tNone registered.\n') |
text += _('\tNone registered.\n') |
167 |
|
|
168 |
def unicodeToLocale(unicodeStr): |
def unicodeToLocale(unicodeStr): |
169 |
"Function to convert unicode to the user's locale encoding" |
"Function to convert unicode to the user's locale encoding" |
170 |
|
# Under a german windows 2000 getlocale returns an encoding name |
171 |
return unicodeStr.encode(getlocale()[1]) |
# that's not direcly usable (it's missing a "cp" at the beginning). |
172 |
|
# getdefaultlocale does return a usable encoding name so we use that |
173 |
|
# instead. |
174 |
|
locale=getdefaultlocale()[1] |
175 |
|
if locale is None: |
176 |
|
locale = 'ascii' |
177 |
|
return unicodeStr.encode(locale,'replace') |