This repository has been archived by the owner on Sep 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework helper scripts.
- Loading branch information
Showing
8 changed files
with
46 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
logo.ico |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import subprocess | ||
import sys | ||
from argparse import ArgumentParser | ||
from pathlib import Path | ||
|
||
|
||
def gen_logo_ico(): | ||
sizes = ["16", "32", "64", "128", "256", "512", "1024"] | ||
Path("./build").mkdir(exist_ok=True) | ||
for size in sizes: | ||
subprocess.run(["inkscape", "-w", str(size), "-h", str(size), "-o", f"./build/{size}.png", "./mp3monitoring/gui/pkg_data/logo.svg"]) | ||
subprocess.run(["magick", "convert", *[f"./build/{size}.png" for size in sizes], "./mp3monitoring/gui/pkg_data//logo.ico"], stdout=sys.stdout, | ||
stderr=sys.stderr) | ||
|
||
|
||
def ui_to_py(): | ||
output_dir = Path("./mp3monitoring/gui/ui") | ||
for ui_file in Path("./gui").glob("*.ui"): | ||
subprocess.run(["pyside2-uic", str(ui_file), "-o", output_dir.joinpath(ui_file.stem + '.py')], stdout=sys.stdout, stderr=sys.stderr) | ||
|
||
|
||
if __name__ == '__main__': | ||
parser = ArgumentParser(prog="MP3 Monitoring Development Tools") | ||
|
||
subparsers = parser.add_subparsers(dest="tool", help='') | ||
|
||
parser_uic = subparsers.add_parser('uic', help='invoke pyside2-uic and create python files') | ||
parser_ico = subparsers.add_parser('ico', help='generate an ico from the logo svg') | ||
|
||
if sys.version_info[0] < 3 or sys.version_info[1] < 8: | ||
sys.exit('Only Python 3.8 or greater is supported. You are using:' + sys.version) | ||
|
||
args = parser.parse_args(sys.argv[1:]) | ||
if args.tool == "uic": | ||
ui_to_py() | ||
elif args.tool == "ico": | ||
gen_logo_ico() |
This file was deleted.
Oops, something went wrong.