Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: packagerChrome.py

Issue 5406295150559232: wrong icons parameter value in manifest.json for chrome buildtool fix. (Closed)
Patch Set: Created March 18, 2014, 4:03 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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'):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld