diff --git a/autoradio/autoradio.py b/autoradio.py similarity index 96% rename from autoradio/autoradio.py rename to autoradio.py index c7d8997..6e47c8f 100644 --- a/autoradio/autoradio.py +++ b/autoradio.py @@ -67,6 +67,7 @@ def main(): help="Config file", ) args = ap.parse_args() + print(f"Config from {args.config}") with open(args.config, 'r') as cfh: cf = json.load(cfh) m = int(cf.get("max", "5")) @@ -77,3 +78,5 @@ def main(): print(f"content = {url}") download_audio(url, config['dir']) +if __name__ == "__main__": + main() diff --git a/pyproject.toml b/pyproject.toml index 49a11cc..31d3a82 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,3 +8,6 @@ dependencies = [ "feedparser>=6.0.11", "pycurl>=7.45.6", ] + +[project.scripts] +autoradio = "autoradio.autoradio:main"