Index: packagerChrome.py |
=================================================================== |
--- a/packagerChrome.py |
+++ b/packagerChrome.py |
@@ -73,18 +73,11 @@ |
if metadata.has_option('general', 'icons'): |
icons = {} |
- iconsDir = baseDir |
- for dir in metadata.get('general', 'icons').split('/')[0:-1]: |
- iconsDir = os.path.join(iconsDir, dir) |
- |
- prefix, suffix = metadata.get('general', 'icons').split('/')[-1].split('?', 1) |
- for file in os.listdir(iconsDir): |
- path = os.path.join(iconsDir, file) |
- if os.path.isfile(path) and file.startswith(prefix) and file.endswith(suffix): |
- size = file[len(prefix):-len(suffix)] |
- if not re.search(r'\D', size): |
- icons[size] = os.path.relpath(path, baseDir).replace('\\', '/') |
- |
+ for icon in re.split('\s+', metadata.get('general', 'icons')): |
+ match = re.search("\d+(?=\.)", icon) |
Wladimir Palant
2014/03/18 17:22:50
Determining icon size that way is even more a hack
saroyanm
2014/03/19 09:04:35
Good point, thanks for pointing.
Updated.
|
+ if match: |
+ value = match.group() |
+ icons[value] = icon |
templateData['icons'] = icons |
if metadata.has_option('general', 'permissions'): |