Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1578)

Unified Diff: Source/devtools/scripts/optimize_png_images.py

Issue 662393004: DevTools: scripts: remove manual path concatenation / splitting (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/scripts/devtools_file_hashes.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/scripts/optimize_png_images.py
diff --git a/Source/devtools/scripts/optimize_png_images.py b/Source/devtools/scripts/optimize_png_images.py
index fc67cf5da9f9a27002eb31fd7624dce8e5a920b4..fa1ef7592abc94dba2d580b0bdd3770f9210ecf8 100755
--- a/Source/devtools/scripts/optimize_png_images.py
+++ b/Source/devtools/scripts/optimize_png_images.py
@@ -28,11 +28,8 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import devtools_file_hashes
-import glob
-import hashlib
import os
import os.path
-import re
import subprocess
import sys
@@ -55,7 +52,7 @@ hashes_file_path = os.path.join(image_sources_path, hashes_file_name)
file_names = os.listdir(image_sources_path)
svg_file_paths = [os.path.join(image_sources_path, file_name) for file_name in file_names if file_name.endswith(".svg")]
svg_file_paths_to_optimize = devtools_file_hashes.files_with_invalid_hashes(hashes_file_path, svg_file_paths)
-svg_file_names = [re.sub(".svg$", "", os.path.basename(file_path)) for file_path in svg_file_paths_to_optimize]
+svg_file_names = [os.path.basename(file_path) for file_path in svg_file_paths_to_optimize]
optimize_script_path = os.path.join("tools", "resources", "optimize-png-files.sh")
@@ -91,7 +88,7 @@ else:
processes = {}
for file_name in svg_file_names:
- name = re.sub(".svg$", "", file_name)
+ name = os.path.splitext(file_name)[0]
name2x = name + "_2x"
processes[name] = optimize_png(name)
processes[name2x] = optimize_png(name2x)
« no previous file with comments | « Source/devtools/scripts/devtools_file_hashes.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698