Dbrant has uploaded a new change for review.
https://gerrit.wikimedia.org/r/146976
Change subject: Improve compatibility of convert-icons script.
......................................................................
Improve compatibility of convert-icons script.
Previously could not run in Windows because "sh" is not supported.
Change-Id: I79df5ca3dab0b5760e48ca058ba7e342d9f5262a
---
M scripts/convert-icons.py
1 file changed, 5 insertions(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia
refs/changes/76/146976/1
diff --git a/scripts/convert-icons.py b/scripts/convert-icons.py
index 37be5a4..29c9b45 100644
--- a/scripts/convert-icons.py
+++ b/scripts/convert-icons.py
@@ -1,5 +1,5 @@
import os
-import sh
+from subprocess import Popen
from glob import glob
@@ -26,7 +26,7 @@
file_name =
os.path.basename(os.path.splitext(input_path)[0].split(".")[0] + ".png")
output_file_path = os.path.join(OUTPUT_PATH_PREFIX, drawable,
file_name)
px = int(DENSITIES[density] * self.dp)
- sh.rsvg_convert(input_path, "-a", h=px, o=output_file_path)
+ Popen(["rsvg-convert", input_path, "-a", "-h", str(px), "-o",
output_file_path]).communicate()
return (output_file_path, noflip)
def _do_flop(self, density, (input_path, noflip)):
@@ -34,8 +34,8 @@
return
folder_name = os.path.join(OUTPUT_PATH_PREFIX, "drawable-ldrtl-" +
density)
output_file_path = os.path.join(folder_name,
os.path.basename(input_path))
- sh.mkdir("-p", folder_name)
- sh.convert(input_path, "-flop", output_file_path)
+ Popen(["mkdir", "-p", folder_name]).communicate()
+ Popen(["convert", input_path, "-flop", output_file_path]).communicate()
def convert(self):
for svg in self.svgs:
@@ -44,7 +44,7 @@
else:
for density in DENSITIES.keys():
self._do_flop(density, self._do_export(density, svg,
"drawable-" + density))
- print(u"\u2713 %s" % os.path.basename(svg))
+ print(u"\u00B7 %s" % os.path.basename(svg))
if __name__ == "__main__":
--
To view, visit https://gerrit.wikimedia.org/r/146976
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I79df5ca3dab0b5760e48ca058ba7e342d9f5262a
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits