1) Remove a print statement

2) fix series formatting
This commit is contained in:
Charles Haley 2010-09-26 14:51:25 +01:00
parent f6870bd14b
commit 66ed343b11
2 changed files with 8 additions and 5 deletions

View File

@ -455,6 +455,8 @@ class Metadata(object):
res = format_date(res, cmeta['display'].get('date_format','dd MMM yyyy'))
elif datatype == 'bool':
res = _('Yes') if res else _('No')
elif datatype == 'float' and key.endswith('_index'):
res = self.format_series_index(res)
return (name, unicode(res), orig_res, cmeta)
if key in field_metadata and field_metadata[key]['kind'] == 'field':
@ -468,6 +470,8 @@ class Metadata(object):
datatype = fmeta['datatype']
if key == 'authors':
res = authors_to_string(res)
elif key == 'series_index':
res = self.format_series_index(res)
elif datatype == 'text' and fmeta['is_multiple']:
res = u', '.join(res)
elif datatype == 'series' and series_with_index:

View File

@ -53,7 +53,7 @@ class MetadataBackup(Thread): # {{{
except:
# Happens during interpreter shutdown
break
print 'doing id', id_
try:
path, mi = self.get_metadata_for_dump(id_)
except:
@ -71,16 +71,15 @@ class MetadataBackup(Thread): # {{{
# Give the GUI thread a chance to do something. Python threads don't
# have priorities, so this thread would naturally keep the processor
# until some scheduling event happens. The sleep makes such an event
time.sleep(0.010)
time.sleep(0.1)
try:
print 'now do metadata'
raw = metadata_to_opf(mi)
except:
prints('Failed to convert to opf for id:', id_)
traceback.print_exc()
continue
time.sleep(0.010) # Give the GUI thread a chance to do something
time.sleep(0.1) # Give the GUI thread a chance to do something
try:
self.do_write(path, raw)
except:
@ -93,7 +92,7 @@ class MetadataBackup(Thread): # {{{
'again, giving up')
continue
time.sleep(0.010) # Give the GUI thread a chance to do something
time.sleep(0.1) # Give the GUI thread a chance to do something
try:
self.clear_dirtied([id_])
except: