From fabbe0bc394c48f4c2e297d38e987e2347baf518 Mon Sep 17 00:00:00 2001 From: Luca Vivona Date: Tue, 9 Jan 2024 00:08:19 -0500 Subject: [PATCH] change directory idecticon --> idecticons --- build/lib/identicon/__init__.py | 2 +- build/lib/identicon/cli/__init__.py | 2 +- identicon/__init__.py | 4 --- identicon/__main__.py | 4 --- identicons/__init__.py | 4 +++ .../_generate/__init__.py | 0 {identicon => identicons}/cli/__init__.py | 4 +-- identicons/cli/cli.py | 26 +++++++++++++++++++ 8 files changed, 34 insertions(+), 12 deletions(-) delete mode 100644 identicon/__init__.py delete mode 100644 identicon/__main__.py create mode 100644 identicons/__init__.py rename {identicon => identicons}/_generate/__init__.py (100%) rename {identicon => identicons}/cli/__init__.py (91%) create mode 100644 identicons/cli/cli.py diff --git a/build/lib/identicon/__init__.py b/build/lib/identicon/__init__.py index 7ad9d4a..7fef219 100644 --- a/build/lib/identicon/__init__.py +++ b/build/lib/identicon/__init__.py @@ -1,4 +1,4 @@ __all__ = ["generate", "save"] -from identicon._generate import generate, save \ No newline at end of file +from identicons._generate import generate, save \ No newline at end of file diff --git a/build/lib/identicon/cli/__init__.py b/build/lib/identicon/cli/__init__.py index 046aba0..a63d4a4 100644 --- a/build/lib/identicon/cli/__init__.py +++ b/build/lib/identicon/cli/__init__.py @@ -1,7 +1,7 @@ __all__ = [] import argparse -from identicon._generate import generate, save +from identicons._generate import generate, save def main(): diff --git a/identicon/__init__.py b/identicon/__init__.py deleted file mode 100644 index 7ad9d4a..0000000 --- a/identicon/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ - -__all__ = ["generate", "save"] - -from identicon._generate import generate, save \ No newline at end of file diff --git a/identicon/__main__.py b/identicon/__main__.py deleted file mode 100644 index ab7a951..0000000 --- a/identicon/__main__.py +++ /dev/null @@ -1,4 +0,0 @@ -from cli import main - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/identicons/__init__.py b/identicons/__init__.py new file mode 100644 index 0000000..7fef219 --- /dev/null +++ b/identicons/__init__.py @@ -0,0 +1,4 @@ + +__all__ = ["generate", "save"] + +from identicons._generate import generate, save \ No newline at end of file diff --git a/identicon/_generate/__init__.py b/identicons/_generate/__init__.py similarity index 100% rename from identicon/_generate/__init__.py rename to identicons/_generate/__init__.py diff --git a/identicon/cli/__init__.py b/identicons/cli/__init__.py similarity index 91% rename from identicon/cli/__init__.py rename to identicons/cli/__init__.py index 046aba0..5f73a5c 100644 --- a/identicon/cli/__init__.py +++ b/identicons/cli/__init__.py @@ -1,7 +1,7 @@ __all__ = [] import argparse -from identicon._generate import generate, save +from identicons._generate import generate, save def main(): @@ -13,7 +13,7 @@ def main(): parser.add_argument('-w', '--width', default=500, type=int, required=False, help="Specify the width of the output image.") parser.add_argument('-hi', '--height', default=500, type=int, required=False, help="Specify the height of the output image.") - parser.add_argument('-v', '--version', action='version', version='%(prog)s 0.1.0', help='byteTensor version ') + parser.add_argument('-v', '--version', action='version', version='%(prog)s 0.1.3', help='byteTensor version ') try: diff --git a/identicons/cli/cli.py b/identicons/cli/cli.py new file mode 100644 index 0000000..3efd0b1 --- /dev/null +++ b/identicons/cli/cli.py @@ -0,0 +1,26 @@ +import argparse + +from identicons._generate import generate, save + +def main(): + + parser = argparse.ArgumentParser(description=f'CLI tool.') + parser.add_argument('-t', '--text', required=True, help="" ) + parser.add_argument('-f', '--file', required=True, help="" ) + parser.add_argument('-p', '--primary', default='0x00', type=str, required=False, help="" ) + parser.add_argument('-s', '--secondary', default='0xffffff', type=str, required=False, help="" ) + parser.add_argument('-w', '--width', default=500, type=int, required=False, help="Specify the width of the output image.") + parser.add_argument('-hi', '--height', default=500, type=int, required=False, help="Specify the height of the output image.") + + parser.add_argument('-v', '--version', action='version', version='%(prog)s 0.1.0', help='byteTensor version ') + + + args = parser.parse_args() + primary, secondary = int(args.primary, 16), int(args.secondary, 16) + print(primary, secondary) + icon = generate(args.text, primary, secondary) + save(icon, args.file, "./", args.height, args.width) + + +if __name__ == "__name__": + main() \ No newline at end of file