mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 08:43:10 +02:00
Another typo
This commit is contained in:
parent
12a7fbdd15
commit
c0f70a7820
1 changed files with 5 additions and 2 deletions
|
|
@ -61,6 +61,7 @@ class XMLCache(object):
|
|||
|
||||
def __init__(self, paths, prefixes):
|
||||
if DEBUG:
|
||||
prints('Building XMLCache...')
|
||||
pprint(paths)
|
||||
self.paths = paths
|
||||
self.prefixes = prefixes
|
||||
|
|
@ -117,7 +118,7 @@ def prune_empty_playlists(self):
|
|||
for playlist in root.xpath('//*[local-name()="playlist"]'):
|
||||
if len(playlist) == 0 or not playlist.get('title', None):
|
||||
if DEBUG:
|
||||
prints('Removing playlist:', playlist.get('id', None),
|
||||
prints('Removing playlist id:', playlist.get('id', None),
|
||||
playlist.get('title', None))
|
||||
playlist.getparent().remove(playlist)
|
||||
|
||||
|
|
@ -160,6 +161,8 @@ def get_or_create_playlist(self, bl_idx, title):
|
|||
for playlist in root.xpath('//*[local-name()="playlist"]'):
|
||||
if playlist.get('title', None) == title:
|
||||
return playlist
|
||||
if DEBUG:
|
||||
prints('Creating playlist:', title)
|
||||
ans = root.makeelement('{%s}playlist'%self.namespaces[bl_idx],
|
||||
nsmap=root.nsmap, attrib={
|
||||
'uuid' : uuid(),
|
||||
|
|
@ -218,7 +221,7 @@ def rebase_ids(root, base, sourceid, pl_sourceid):
|
|||
new = base + i
|
||||
if old != new:
|
||||
item.set('id', str(new))
|
||||
idmap[old] = str(new)
|
||||
idmap[str(old)] = str(new)
|
||||
return idmap
|
||||
|
||||
self.prune_empty_playlists()
|
||||
|
|
|
|||
Loading…
Reference in a new issue