r81405 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81404‎ | r81405 | r81406 >
Date:19:14, 2 February 2011
Author:diederik
Status:deferred
Tags:
Comment:
Fixed some more Unicode printing issues.
Modified paths:
  • /trunk/tools/editor_trends/classes/languages.py (modified) (history)
  • /trunk/tools/editor_trends/classes/projects.py (modified) (history)
  • /trunk/tools/editor_trends/manage.py (modified) (history)

Diff [purge]

Index: trunk/tools/editor_trends/manage.py
@@ -287,6 +287,7 @@
288288 settings = configuration.Settings()
289289 language = languages.init()
290290 project = projects.init()
 291+ pjc = projects.ProjectContainer()
291292 rts = runtime_settings.RunTimeSettings(project, language, settings)
292293
293294 #Init Argument Parser
@@ -386,12 +387,13 @@
387388 action='store',
388389 help='Example of valid languages.',
389390 choices=project.supported_languages(),
390 - default=language.name)
 391+ default=unicode(language.name)
 392+ )
391393
392394 parser.add_argument('-p', '--project',
393395 action='store',
394396 help='Specify the Wikimedia project that you would like to download',
395 - choices=projects,
 397+ choices=pjc.supported_projects(),
396398 default='wiki')
397399
398400 parser.add_argument('-c', '--collection',
Index: trunk/tools/editor_trends/classes/projects.py
@@ -41,10 +41,11 @@
4242 if lang in self.valid_languages:
4343 if output == 'parser':
4444 lang = lnc.languages.get(lang, 'Unknown language')
45 - choices.append(lang.name)
 45+ choices.append(lang.name.encode('utf-8'))
4646 elif output == 'django':
4747 lang = lnc.languages.get(lang, languages.Language('Unknown language', lang, None))
4848 choices.append((lang.code, lang.name))
 49+ #choices = [choice.decode('utf-8') for choice in choices]
4950 return choices
5051
5152
Index: trunk/tools/editor_trends/classes/languages.py
@@ -43,6 +43,7 @@
4444 print '%s' % language.decode(settings.encoding)
4545 except UnicodeEncodeError:
4646 print '%s' % language
 47+
4748
4849 class LanguageContainer:
4950 def __init__(self):

Status & tagging log