mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Another typo
This commit is contained in:
parent
12a7fbdd15
commit
c0f70a7820
@ -61,6 +61,7 @@ class XMLCache(object):
|
|||||||
|
|
||||||
def __init__(self, paths, prefixes):
|
def __init__(self, paths, prefixes):
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
|
prints('Building XMLCache...')
|
||||||
pprint(paths)
|
pprint(paths)
|
||||||
self.paths = paths
|
self.paths = paths
|
||||||
self.prefixes = prefixes
|
self.prefixes = prefixes
|
||||||
@ -117,7 +118,7 @@ class XMLCache(object):
|
|||||||
for playlist in root.xpath('//*[local-name()="playlist"]'):
|
for playlist in root.xpath('//*[local-name()="playlist"]'):
|
||||||
if len(playlist) == 0 or not playlist.get('title', None):
|
if len(playlist) == 0 or not playlist.get('title', None):
|
||||||
if DEBUG:
|
if DEBUG:
|
||||||
prints('Removing playlist:', playlist.get('id', None),
|
prints('Removing playlist id:', playlist.get('id', None),
|
||||||
playlist.get('title', None))
|
playlist.get('title', None))
|
||||||
playlist.getparent().remove(playlist)
|
playlist.getparent().remove(playlist)
|
||||||
|
|
||||||
@ -160,6 +161,8 @@ 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
|
||||||
|
if DEBUG:
|
||||||
|
prints('Creating playlist:', title)
|
||||||
ans = root.makeelement('{%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(),
|
||||||
@ -218,7 +221,7 @@ class XMLCache(object):
|
|||||||
new = base + i
|
new = base + i
|
||||||
if old != new:
|
if old != new:
|
||||||
item.set('id', str(new))
|
item.set('id', str(new))
|
||||||
idmap[old] = str(new)
|
idmap[str(old)] = str(new)
|
||||||
return idmap
|
return idmap
|
||||||
|
|
||||||
self.prune_empty_playlists()
|
self.prune_empty_playlists()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user