mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix various typos
This commit is contained in:
parent
7592b5125f
commit
6b9696867f
@ -96,6 +96,7 @@ class PRS505(USBMS):
|
|||||||
c = self.initialize_XML_cache()
|
c = self.initialize_XML_cache()
|
||||||
blists = {}
|
blists = {}
|
||||||
for i in c.paths:
|
for i in c.paths:
|
||||||
|
if booklists[i] is not None:
|
||||||
blists[i] = booklists[i]
|
blists[i] = booklists[i]
|
||||||
opts = self.settings()
|
opts = self.settings()
|
||||||
collections = ['series', 'tags']
|
collections = ['series', 'tags']
|
||||||
|
@ -137,6 +137,7 @@ class XMLCache(object):
|
|||||||
self.ensure_unique_playlist_titles()
|
self.ensure_unique_playlist_titles()
|
||||||
self.prune_empty_playlists()
|
self.prune_empty_playlists()
|
||||||
for i, root in self.record_roots.items():
|
for i, root in self.record_roots.items():
|
||||||
|
ans[i] = {}
|
||||||
for playlist in root.xpath('//*[local-name()="playlist"]'):
|
for playlist in root.xpath('//*[local-name()="playlist"]'):
|
||||||
items = []
|
items = []
|
||||||
for item in playlist:
|
for item in playlist:
|
||||||
@ -153,7 +154,7 @@ class XMLCache(object):
|
|||||||
for playlist in root.xpath('//*[local-name()="playlist"]'):
|
for playlist in root.xpath('//*[local-name()="playlist"]'):
|
||||||
if playlist.get('title', None) == title:
|
if playlist.get('title', None) == title:
|
||||||
return playlist
|
return playlist
|
||||||
ans = root.makelement('{%s}playlist'%self.namespaces[bl_idx],
|
ans = root.makeelement('{%s}playlist'%self.namespaces[bl_idx],
|
||||||
nsmap=root.nsmap, attrib={
|
nsmap=root.nsmap, attrib={
|
||||||
'uuid' : uuid(),
|
'uuid' : uuid(),
|
||||||
'title': title,
|
'title': title,
|
||||||
@ -286,7 +287,7 @@ class XMLCache(object):
|
|||||||
record = self.book_by_lpath(book.lpath, root)
|
record = self.book_by_lpath(book.lpath, root)
|
||||||
if record is None:
|
if record is None:
|
||||||
record = self.create_text_record(root, i, book.lpath)
|
record = self.create_text_record(root, i, book.lpath)
|
||||||
self.update_record(record, book, path, i)
|
self.update_text_record(record, book, path, i)
|
||||||
bl_pmap = playlist_map[i]
|
bl_pmap = playlist_map[i]
|
||||||
self.update_playlists(i, root, booklist, bl_pmap,
|
self.update_playlists(i, root, booklist, bl_pmap,
|
||||||
collections_attributes)
|
collections_attributes)
|
||||||
@ -300,8 +301,8 @@ class XMLCache(object):
|
|||||||
def update_playlists(self, bl_index, root, booklist, playlist_map,
|
def update_playlists(self, bl_index, root, booklist, playlist_map,
|
||||||
collections_attributes):
|
collections_attributes):
|
||||||
collections = booklist.get_collections(collections_attributes)
|
collections = booklist.get_collections(collections_attributes)
|
||||||
for category, books in collections:
|
for category, books in collections.items():
|
||||||
records = [self.book_by_lpath(b.lpath) for b in books]
|
records = [self.book_by_lpath(b.lpath, root) for b in books]
|
||||||
# Remove any books that were not found, although this
|
# Remove any books that were not found, although this
|
||||||
# *should* never happen
|
# *should* never happen
|
||||||
if DEBUG and None in records:
|
if DEBUG and None in records:
|
||||||
@ -357,7 +358,7 @@ class XMLCache(object):
|
|||||||
timestamp = getattr(os.path, 'get'+timestamp)(path)
|
timestamp = getattr(os.path, 'get'+timestamp)(path)
|
||||||
date = strftime(timestamp)
|
date = strftime(timestamp)
|
||||||
record.set('date', date)
|
record.set('date', date)
|
||||||
record.set('size', os.stat(path).st_size)
|
record.set('size', str(os.stat(path).st_size))
|
||||||
record.set('title', book.title)
|
record.set('title', book.title)
|
||||||
record.set('author', authors_to_string(book.authors))
|
record.set('author', authors_to_string(book.authors))
|
||||||
ext = os.path.splitext(path)[1]
|
ext = os.path.splitext(path)[1]
|
||||||
|
@ -98,11 +98,10 @@ class USBMS(CLI, Device):
|
|||||||
import traceback
|
import traceback
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
return changed
|
return changed
|
||||||
|
|
||||||
if isinstance(ebook_dirs, basestring):
|
if isinstance(ebook_dirs, basestring):
|
||||||
ebook_dirs = [ebook_dirs]
|
ebook_dirs = [ebook_dirs]
|
||||||
for ebook_dir in ebook_dirs:
|
for ebook_dir in ebook_dirs:
|
||||||
ebook_dir = self.path_to_unicode(filesystem_encoding)
|
ebook_dir = self.path_to_unicode(ebook_dir)
|
||||||
ebook_dir = self.normalize_path( \
|
ebook_dir = self.normalize_path( \
|
||||||
os.path.join(prefix, *(ebook_dir.split('/'))) \
|
os.path.join(prefix, *(ebook_dir.split('/'))) \
|
||||||
if ebook_dir else prefix)
|
if ebook_dir else prefix)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user