diff --git a/.github/LICENSE b/LICENSE similarity index 100% rename from .github/LICENSE rename to LICENSE diff --git a/.github/README.md b/README.md similarity index 84% rename from .github/README.md rename to README.md index 5f8e387..bf487de 100644 --- a/.github/README.md +++ b/README.md @@ -24,6 +24,22 @@ This project is just getting started and only has a couple of features implement [![cOborski/zipssion](https://img.shields.io/static/v1?label=cOborski&message=zipssion&color=yellow&logo=github)](https://github.com/coborski/zipssion/) +## Planned Usage +`Usage: +main.py [--quiet | --verbose] [--path=] [--extention=] +main.py (-h | --help) +main.py --version +main.py --quiet +main.py --verbose + +Options: +-h --help show help text +--version show version +--quiet print less text +--verbose print more text +--path= list of file paths [default: {'/'}] +--extention= the file's extention (if known)` + ## Credits, inspiration, and references ### Articles, guides, and resources diff --git a/source/app.py b/source/app.py deleted file mode 100644 index be1b783..0000000 --- a/source/app.py +++ /dev/null @@ -1,9 +0,0 @@ -# to delete - -import identify_file_type -from typer import Typer - -app = Typer() -VERSION = "0.1.0-alpha" - -app.add_typer(identify_file_type.app, name="identify_file_type") diff --git a/source/identify_file_type.py b/source/identify_file_type.py index a7c1356..dc17c91 100644 --- a/source/identify_file_type.py +++ b/source/identify_file_type.py @@ -14,7 +14,22 @@ @app.command() def identify(files: list[str] = Argument(..., help="File paths to identify")): - """Identifies the file type of provided files with incorrect extensions.""" + """ + Identifies the file type of provided files with incorrect extensions + + A bit longer description. + + Args: + files (list[str]): A list of file paths to identify + + Returns: + type: description + + Raises: + FileNotFoundError: the file does not exist + + """ + for file_path in files: try: with open(file_path, "rb") as f: @@ -37,3 +52,5 @@ def identify(files: list[str] = Argument(..., help="File paths to identify")): except FileNotFoundError: log.error(f"Error: File not found: {file_path}") + + # todo: return diff --git a/source/log.py b/source/log.py index 6821292..2fc14cd 100644 --- a/source/log.py +++ b/source/log.py @@ -14,7 +14,7 @@ def create_rich_logger(): for the rich.logging class definision Args: - variable (type): description + none Returns: logger: a logger that can be formatted using rich diff --git a/source/zipssion.py b/source/zipssion.py deleted file mode 100644 index d9f90c1..0000000 --- a/source/zipssion.py +++ /dev/null @@ -1,52 +0,0 @@ -# to delete - -import argparse -import pathlib -import shutil -import tempfile -import zipfile - -parser = argparse.ArgumentParser() - -parser.add_argument("filename") -args = parser.parse_args() - -print(args.filename) - -""" -def view_files_content(filename): - - path = pathlib.Path(filename) - print(path) - zip_path = path.stem + ".zip" - print(zip_path) - - if path.exists() and path.is_file(): - shutil.copy(path, zip_path) - - print(path.is_file()) - file = zipfile.ZipFile(zip_path) - file.printdir() - - -view_files_content(args.filename) -""" - - -def view_zip_files_content(filename): - - path = pathlib.Path(filename) - logger.debug("Path:" + str(path)) - zip_path = path.stem + ".zip" - logger.debug("Zip Path:" + str(zip_path)) - - if path.exists() and path.is_file(): - shutil.copy(path, zip_path) - - logger.debug("Is the path a file?:" + "true") - file = zipfile.ZipFile(zip_path) - file.printdir() - # ENDIF - - -# ENDDEF