Skip to content

Commit 00b2e30

Browse files
fix icon names
1 parent 470f364 commit 00b2e30

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

index_generator/models/entries.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ def get_icon_by_mime(mime, iconset='papirus', isDir=False):
2222
else:
2323
valid_targets = ['default']
2424
for target in valid_targets:
25-
if os.path.isfile(os.path.dirname(__file__) + os.path.sep + '..' + os.path.sep + 'icons' + os.path.sep + iconset + os.path.sep + target + '.svg'):
26-
return base64.b64encode(open(os.path.dirname(__file__) + os.path.sep + '..' + os.path.sep + 'icons' + os.path.sep + iconset + os.path.sep + target + '.svg', 'rb').read()).decode()
25+
path = os.path.dirname(__file__) + os.path.sep + '..' + os.path.sep + 'icons' + os.path.sep + iconset + os.path.sep + target + '.svg'
26+
if os.path.isfile(path):
27+
return base64.b64encode(open(path, 'rb').read()).decode()
2728

2829
class Entry(object):
2930
def __init__(self, file, root, base=os.path.sep, human=False, iconset='papirus'):

0 commit comments

Comments
 (0)