made some changes to the project structure
This commit is contained in:
parent
d094164c84
commit
db112e8dc3
10 changed files with 11 additions and 5 deletions
0
LICENSE → .github/LICENSE
vendored
0
LICENSE → .github/LICENSE
vendored
0
readme.md → .github/README
vendored
0
readme.md → .github/README
vendored
|
|
@ -1,3 +1,5 @@
|
||||||
|
# to delete
|
||||||
|
|
||||||
from typer import Typer
|
from typer import Typer
|
||||||
import identify_file_type
|
import identify_file_type
|
||||||
|
|
||||||
|
|
@ -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]")
|
|
||||||
|
|
@ -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.
4
tests/identify_file_type_tests.py
Normal file
4
tests/identify_file_type_tests.py
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
# identify_file_type_tests
|
||||||
|
import pytest
|
||||||
|
import unittest
|
||||||
|
import identify_file_type_tests
|
||||||
Loading…
Reference in a new issue