mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-08 23:57:14 +01:00
Change to fix to make the value unicode in format_field_extended. This is a more general fix. Note that the orig_field has not been changed.
This commit is contained in:
parent
f280cc956f
commit
8a9ae38ebf
1 changed files with 3 additions and 3 deletions
|
|
@ -45,7 +45,7 @@ def get_value(self, key, args, mi):
|
|||
return ''
|
||||
if v == '':
|
||||
return ''
|
||||
return prefix + unicode(v) + suffix
|
||||
return prefix + v + suffix
|
||||
except:
|
||||
return key
|
||||
|
||||
|
|
@ -444,7 +444,7 @@ def format_field_extended(self, key, series_with_index=True):
|
|||
res = format_date(res, cmeta['display'].get('date_format','dd MMM yyyy'))
|
||||
elif datatype == 'bool':
|
||||
res = _('Yes') if res else _('No')
|
||||
return (name, res, orig_res, cmeta)
|
||||
return (name, unicode(res), orig_res, cmeta)
|
||||
|
||||
if key in field_metadata and field_metadata[key]['kind'] == 'field':
|
||||
res = self.get(key, None)
|
||||
|
|
@ -462,7 +462,7 @@ def format_field_extended(self, key, series_with_index=True):
|
|||
res = res + ' [%s]'%self.format_series_index()
|
||||
elif datatype == 'datetime':
|
||||
res = format_date(res, fmeta['display'].get('date_format','dd MMM yyyy'))
|
||||
return (name, res, orig_res, fmeta)
|
||||
return (name, unicode(res), orig_res, fmeta)
|
||||
|
||||
return (None, None, None, None)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue