This commit is contained in:
Kovid Goyal 2008-06-20 13:43:27 -07:00
parent 7501dbbe65
commit e49db6236b
3 changed files with 5 additions and 1 deletions

View File

@ -38,7 +38,7 @@ class MetaInformation(object):
setattr(ans, attr, getattr(mi, attr))
def __init__(self, title, authors=['Unknown']):
def __init__(self, title, authors=[_('Unknown')]):
'''
@param title: title or "Unknown" or a MetaInformation object
@param authors: List of strings or []

View File

@ -511,6 +511,8 @@ class OPFCreator(MetaInformation):
path = path[len(self.base_path)+1:]
manifest.append((path, mt))
self.manifest = manifest
if not self.authors:
self.authors = [_('Unknown')]
def create_manifest(self, entries):
'''

View File

@ -1427,6 +1427,8 @@ ALTER TABLE books ADD COLUMN isbn TEXT DEFAULT "" COLLATE NOCASE;
open(cpath, 'wb').write(cover)
mi.cover = cname
f = open(os.path.join(base, sanitize_file_name(name)+'.opf'), 'wb')
if not mi.authors:
mi.authors = [_('Unknown')]
mi.render(f)
f.close()