mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow icon themes to include icons for plugins
This commit is contained in:
parent
4484c2eb58
commit
ec3ca743e8
@ -38,7 +38,7 @@ def read_images_from_folder(path):
|
|||||||
name_map = {}
|
name_map = {}
|
||||||
path = os.path.abspath(path)
|
path = os.path.abspath(path)
|
||||||
for filepath in walk(path):
|
for filepath in walk(path):
|
||||||
name = os.path.relpath(filepath, path).replace(os.sep, '/').lower()
|
name = os.path.relpath(filepath, path).replace(os.sep, '/')
|
||||||
ext = name.rpartition('.')[-1]
|
ext = name.rpartition('.')[-1]
|
||||||
bname = os.path.basename(name)
|
bname = os.path.basename(name)
|
||||||
if bname.startswith('.') or bname.startswith('_'):
|
if bname.startswith('.') or bname.startswith('_'):
|
||||||
@ -265,7 +265,6 @@ def create_themeball(report):
|
|||||||
buf = BytesIO()
|
buf = BytesIO()
|
||||||
with ZipFile(buf, 'w') as zf:
|
with ZipFile(buf, 'w') as zf:
|
||||||
for name, path in report.name_map.iteritems():
|
for name, path in report.name_map.iteritems():
|
||||||
if name not in report.extra:
|
|
||||||
with open(os.path.join(report.path, name), 'rb') as f:
|
with open(os.path.join(report.path, name), 'rb') as f:
|
||||||
zf.writestr(name, f.read(), compression=ZIP_STORED)
|
zf.writestr(name, f.read(), compression=ZIP_STORED)
|
||||||
buf.seek(0)
|
buf.seek(0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user