This commit is contained in:
Kovid Goyal 2009-03-07 11:26:25 -08:00
commit 02a940d33b
3 changed files with 5 additions and 7 deletions

View File

@ -7,6 +7,7 @@ Device driver for Bookeen's Cybook Gen 3
import os, shutil
from itertools import cycle
from calibre.ebooks.metadata import authors_to_string
from calibre.devices.errors import FreeSpaceError
from calibre.devices.usbms.driver import USBMS
import calibre.devices.cybookg3.t2b as t2b
@ -73,7 +74,7 @@ class CYBOOKG3(USBMS):
if self.SUPPORTS_SUB_DIRS:
if 'tags' in mdata.keys():
for tag in mdata['tags']:
if tag.startswith(('News')):
if tag.startswith(_('News')):
newpath = os.path.join(newpath, 'news')
newpath = os.path.join(newpath, mdata.get('title', ''))
newpath = os.path.join(newpath, mdata.get('timestamp', ''))
@ -84,7 +85,7 @@ class CYBOOKG3(USBMS):
break
if newpath == path:
newpath = os.path.join(newpath, mdata.get('authors', ''))
newpath = os.path.join(newpath, authors_to_string(mdata.get('authors', '')))
newpath = os.path.join(newpath, mdata.get('title', ''))
if not os.path.exists(newpath):

View File

@ -115,7 +115,7 @@ class USBMS(Device):
break
if newpath == path:
newpath = os.path.join(newpath, mdata.get('authors', ''))
newpath = os.path.join(newpath, authors_to_string(mdata.get('authors', '')))
newpath = os.path.join(newpath, mdata.get('title', ''))
if not os.path.exists(newpath):

View File

@ -249,7 +249,6 @@ class MobiReader(object):
pass
parse_cache[htmlfile] = root
self.htmlfile = htmlfile
self.log.debug('Creating OPF...')
ncx = cStringIO.StringIO()
opf = self.create_opf(htmlfile, guide, root)
@ -290,7 +289,6 @@ class MobiReader(object):
elem.getparent().remove(elem)
break
break
def cleanup_html(self):
self.log.debug('Cleaning up HTML...')
@ -576,5 +574,4 @@ def get_metadata(stream):
except:
log.exception()
return mi