made some changes to the project structure

This commit is contained in:
Catherine Oborski 2024-09-08 12:47:26 -05:00
parent d094164c84
commit db112e8dc3
10 changed files with 11 additions and 5 deletions

View file

View file

View file

@ -1,3 +1,5 @@
# to delete
from typer import Typer from typer import Typer
import identify_file_type import identify_file_type

View file

@ -1,6 +1,5 @@
from typer import Typer, Argument from typer import Typer, Argument
from rich import print, console from rich import print, console
from log import create_rich_logger
from pprint import pprint from pprint import pprint
import argparse import argparse
import pathlib import pathlib
@ -10,7 +9,6 @@ import zipfile
import magic import magic
app = Typer() app = Typer()
logger = create_rich_logger()
@app.command() @app.command()
@ -32,9 +30,9 @@ def identify(files: list[str] = Argument(..., help="File paths to identify")):
for member in tar.getmembers(): for member in tar.getmembers():
print(f" - {member.name}") print(f" - {member.name}")
else: else:
print(f"{file_path}: {file_type}") print(
f"[bold green]Identified file type: {file_type}[/bold green]"
)
except FileNotFoundError: except FileNotFoundError:
log.error(f"Error: File not found: {file_path}") log.error(f"Error: File not found: {file_path}")
print(f"[bold green]Identified file type: {file_type}[/bold green]")

View file

@ -1,3 +1,5 @@
# to delete
import argparse import argparse
import pathlib import pathlib
import shutil import shutil

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,4 @@
# identify_file_type_tests
import pytest
import unittest
import identify_file_type_tests