From cb8a17c448f8e514a1b635fd7899f3e866f165ed Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Sun, 10 Apr 2011 03:21:55 -0400 Subject: [PATCH 1/2] fixed bug in sign groups js, for checked: true related to issue #321 --- web_assets/functions.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/web_assets/functions.js b/web_assets/functions.js index 9b42fda..96742af 100644 --- a/web_assets/functions.js +++ b/web_assets/functions.js @@ -153,7 +153,12 @@ function initMarkers() { if (markersInit) { return; } markersInit = true; - + + // first, give all collections an empty array to work with + for (i in signGroups) { + markerCollection[signGroups[i].label] = []; + } + for (i in markerData) { var item = markerData[i]; @@ -195,11 +200,8 @@ function initMarkers() { icon: iconURL, visible: false }); - if (markerCollection[label]) { - markerCollection[label].push(marker); - } else { - markerCollection[label] = [marker]; - } + + markerCollection[label].push(marker); if (item.type == 'sign') { prepareSignMarker(marker, item); From dfe30a0d0f036ed563765b5f7f34457a02f3f151 Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Sun, 10 Apr 2011 04:01:14 -0400 Subject: [PATCH 2/2] now checks for optimize-img programs with '.exe' as well as no suffix fix for issue #314 --- optimizeimages.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/optimizeimages.py b/optimizeimages.py index 6fe8b78..b3daff7 100644 --- a/optimizeimages.py +++ b/optimizeimages.py @@ -23,11 +23,14 @@ advdef = "advdef" def check_programs(level): path = os.environ.get("PATH").split(os.pathsep) - + + def exists_in_path(prog): + result = filter(lambda x: os.path.exists(os.path.join(x, prog)), path) + return len(result) != 0 + for prog,l in [(pngcrush,1), (optipng,2), (advdef,2)]: if l <= level: - result = filter(lambda x: os.path.exists(os.path.join(x, prog)), path) - if len(result) == 0: + if (not exists_in_path(prog)) or (not exists_in_path(prog + ".exe")): raise Exception("Optimization prog %s for level %d not found!" % (prog, l)) def optimize_image(imgpath, imgformat, optimizeimg):