diff options
author | Micah Lee <micah@micahflee.com> | 2022-02-13 15:44:00 -0800 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2022-02-13 15:44:00 -0800 |
commit | 314356b62445bc8fca7bbafe27aea48293a9c7a4 (patch) | |
tree | 613a9130158e7e87bbe5e0681a9cbc718c0e6b56 | |
parent | 13f3a37e33803af841da367851800ca3b40f1cff (diff) | |
download | onionshare-314356b62445bc8fca7bbafe27aea48293a9c7a4.tar.gz onionshare-314356b62445bc8fca7bbafe27aea48293a9c7a4.zip |
Delete country shape helper script
-rwxr-xr-x | desktop/scripts/countries-get-images.py | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/desktop/scripts/countries-get-images.py b/desktop/scripts/countries-get-images.py deleted file mode 100755 index 80330e29..00000000 --- a/desktop/scripts/countries-get-images.py +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env python3 -import subprocess -import tempfile -import json -import os - - -def main(): - tmp_dir = tempfile.TemporaryDirectory() - mapsdir = os.path.join(tmp_dir.name, "mapsicon") - subprocess.run(["git", "clone", "https://github.com/djaiss/mapsicon.git", mapsdir]) - - with open( - os.path.join("src", "onionshare", "resources", "countries", "en.json") - ) as f: - countries = list(json.loads(f.read())) - - os.makedirs( - os.path.join( - "src", - "onionshare", - "resources", - "images", - "countries", - ), - exist_ok=True, - ) - - for country in countries: - country = country.lower() - if os.path.isdir(os.path.join(mapsdir, "all", f"{country}")): - src_filename = os.path.join(mapsdir, "all", f"{country}", "256.png") - dest_light_filename = os.path.join( - "src", - "onionshare", - "resources", - "images", - "countries", - f"{country}-light.png", - ) - dest_dark_filename = os.path.join( - "src", - "onionshare", - "resources", - "images", - "countries", - f"{country}-dark.png", - ) - subprocess.run( - [ - "convert", - src_filename, - "-fill", - "#5a2063", - "+opaque", - "none", - dest_light_filename, - ] - ) - subprocess.run( - [ - "convert", - src_filename, - "-fill", - "#d950ee", - "+opaque", - "none", - dest_dark_filename, - ] - ) - - -if __name__ == "__main__": - main() |