diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b229075..0fb8f9d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,8 +9,6 @@ on: - 'versions/cli_args.py' - '.github/workflows/build.yml' - 'requirements.txt' - tags-ignore: - - "v*" pull_request: workflow_dispatch: merge_group: diff --git a/library/TextConverter.py b/library/TextConverter.py index b123d2c..99e9c22 100644 --- a/library/TextConverter.py +++ b/library/TextConverter.py @@ -6,6 +6,12 @@ import tempfile import audioread import soundfile as sf +from art import text2art +from collections import Counter +import random +import qrcode +import barcode +from barcode.writer import ImageWriter class TextConverter: diff --git a/versions/cli_args.py b/versions/cli_args.py index 2f24112..dd6533a 100644 --- a/versions/cli_args.py +++ b/versions/cli_args.py @@ -24,10 +24,14 @@ def main(): input_group = parser.add_mutually_exclusive_group(required=True) input_group.add_argument("--text", nargs="+", help="Text to convert") input_group.add_argument("--file", help="Path to input file") - parser.add_argument("--shift", type=int, default=3, help="Shift for Caesar cipher") - parser.add_argument("--case", choices=['upper', 'lower'], default='upper', help="Case for case_switch") - parser.add_argument("--save", action="store_true", help="Save the result to history file") - parser.add_argument("--copy", action="store_true", help="Copy the result to clipboard") + parser.add_argument("--shift", type=int, default=3, + help="Shift for Caesar cipher") + parser.add_argument("--case", choices=['upper', 'lower'], default='upper', + help="Case for case_switch") + parser.add_argument("--save", action="store_true", + help="Save the result to history file") + parser.add_argument("--copy", action="store_true", + help="Copy the result to clipboard") parser.add_argument("--filename", help="Filename for QR code or barcode") args = parser.parse_args() @@ -80,13 +84,10 @@ def main(): print(output) else: print(result) - - # Optionally save the result if args.save and args.mode not in ["morse_sound", "qr", "barcode"]: converter.save_result(result, args.mode) print(f"Result saved to {converter.history_files[args.mode]}") - # Copy result to clipboard if --copy flag is used and mode is not 'qr', 'barcode', or 'morse_sound' if args.copy and args.mode not in ['qr', 'barcode', 'morse_sound']: pyperclip.copy(str(result)) print("Result copied to clipboard")