diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index 48277583..7a97837d 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -773,7 +773,7 @@ Gives a brief list of PiSi components published in the repository. pstr = p if p in installed_list: pstr = colorize(p, "cyan") - ctx.ui.info('%15s - %s ' % (pstr, package.summary)) + ctx.ui.info('%15s - %s ' % (pstr, unicode(package.summary))) class ListUpgrades(Command): diff --git a/pisi/xmlfile.py b/pisi/xmlfile.py index d391f295..d21c8358 100644 --- a/pisi/xmlfile.py +++ b/pisi/xmlfile.py @@ -116,6 +116,7 @@ class LocalText(dict): langs = [ locale.getlocale()[0][0:2], 'tr', 'en' ] if not util.any(lambda x : self.has_key(x), langs): errs.append( where + _("Tag should have at least an English or Turkish version")) + #FIXME: check if all entries are unicode return errs def format(self, f, errs): @@ -142,11 +143,18 @@ class LocalText(dict): ctx.ui.warning(x) def __str__(self): - strfile = StringIO() - self.print_text(strfile) - str = strfile.getvalue() - strfile.close() - return str + L = locale.getlocale()[0][0:2] # try to read language, pathetic isn't it? + if self.has_key(L): + return unicode(self[L]) + elif self.has_key('en'): + # fallback to English, blah + return unicode(self['en']) + elif self.has_key('tr'): + # fallback to Turkish + return unicode(self['tr']) + else: + return '' + #ctx.ui.warning(_("Tag should have at least an English or Turkish version")) class Writer(formatter.DumbWriter): """adds unicode support"""