From 3315acb9ca79b2f6bbd68ec99c4506fc3ae7ca92 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Sun, 7 May 2023 10:56:01 +0330 Subject: update --- identicon/gen_blockie.py | 37 ++++++++++++++++++++++--------------- identicon/identicon.png | Bin 4634 -> 0 bytes 2 files changed, 22 insertions(+), 15 deletions(-) delete mode 100644 identicon/identicon.png (limited to 'identicon') diff --git a/identicon/gen_blockie.py b/identicon/gen_blockie.py index 60d56e0..f8f3d56 100755 --- a/identicon/gen_blockie.py +++ b/identicon/gen_blockie.py @@ -16,6 +16,13 @@ class Argparser: # pylint: disable=too-few-public-methods help="seed phrase", default="", ) + self.parser.add_argument( + "--input", + "-i", + type=str, + help="path to the input file", + default="./identicon.png", + ) self.parser.add_argument( "--out", "-o", @@ -63,27 +70,27 @@ class Argparser: # pylint: disable=too-few-public-methods def main() -> None: argparser = Argparser() - if argparser.args.seed == "": + seed = str() + if argparser.args.input != "": with open( - "../terminaldweller.com/main/srv/.well-known/openpgpkey/hu/gpg_pubkey.asc", + argparser.args.input, mode="rb", ) as gpg_pubkey: key_content = gpg_pubkey.read() + seed = str(key_content) - data = blockies.create(str(key_content), size=10, scale=100) - with open("identicon.png", "wb") as png: - png.write(data) else: - data = blockies.create( - argparser.args.seed, - size=argparser.args.size, - scale=argparser.args.scale, - color=argparser.args.fgcolor, - bgcolor=argparser.args.bgcolor, - spotcolor=argparser.args.spotcolor, - ) - with open(argparser.args.out, "wb") as png: - png.write(data) + seed = argparser.args.seed + data = blockies.create( + argparser.args.seed, + size=argparser.args.size, + scale=argparser.args.scale, + color=argparser.args.fgcolor, + bgcolor=argparser.args.bgcolor, + spotcolor=argparser.args.spotcolor, + ) + with open(argparser.args.out, "wb") as png: + png.write(data) if __name__ == "__main__": diff --git a/identicon/identicon.png b/identicon/identicon.png deleted file mode 100644 index 8153c08..0000000 Binary files a/identicon/identicon.png and /dev/null differ -- cgit v1.2.3