Skip to content

Commit

Permalink
entry point change
Browse files Browse the repository at this point in the history
Signed-off-by: Clemens Vasters <clemens@vasters.com>
  • Loading branch information
clemensv committed Jan 22, 2025
1 parent b6fe0e8 commit d0e6d8c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions mode-s/mode_s/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import asyncio
from .mode_s import main

__all__ = ["main"]

if __name__ == "__main__":
asyncio.run(main())
main()
3 changes: 1 addition & 2 deletions mode-s/mode_s/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import asyncio
from .mode_s import main

if __name__ == "__main__":
asyncio.run(main())
main()
6 changes: 4 additions & 2 deletions mode-s/mode_s/mode_s.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def parse_connection_string(connection_string: str) -> Dict[str, str]:
raise ValueError("Invalid connection string format") from e
return config_dict

async def main():
async def run():
parser = argparse.ArgumentParser(description="Mode-S ADS-B Client")
subparsers = parser.add_subparsers(title="subcommands", dest="subcommand")
feed_parser = subparsers.add_parser('feed', help="Poll ADS-B data and feed it to Kafka")
Expand Down Expand Up @@ -318,6 +318,8 @@ def signal_handler(signum, frame):
except Exception as e:
print("Error: %s" % e)

def main():
asyncio.run(run())

if __name__ == "__main__":
asyncio.run(main())
main()

0 comments on commit d0e6d8c

Please sign in to comment.