♻ | New project structure
This commit is contained in:
19
transmutate_app/__main__.py
Normal file
19
transmutate_app/__main__.py
Normal file
@@ -0,0 +1,19 @@
|
||||
"""Allow running transmutate_app as a module: python -m transmutate_app <file>."""
|
||||
|
||||
import sys
|
||||
import os
|
||||
from .gui import open_file
|
||||
|
||||
|
||||
def main():
|
||||
"""CLI entry point for ``python -m transmutate_app <file>``."""
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: python -m transmutate_app <path/to/file>")
|
||||
sys.exit(1)
|
||||
|
||||
filepath = sys.argv[1]
|
||||
if not os.path.isfile(filepath):
|
||||
print(f"Error: File does not exist: {filepath}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
open_file(filepath)
|
||||
Reference in New Issue
Block a user