deadtrunkswitch.py 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import sqlite3
  2. import argparse
  3. def load_config():
  4. pass;
  5. def load_message_templates():
  6. pass
  7. def check_heartbeat():
  8. pass
  9. def update_heartbeat():
  10. print("Ba-duh")
  11. def initialize_sqlite():
  12. print("Initializing...")
  13. if __name__ == "__main__":
  14. # Initialize the CLI arguments
  15. parser = argparse.ArgumentParser(
  16. prog="DeadTrunkSwitch",
  17. description="A Mastodon-based deadman's switch",
  18. formatter_class=argparse.ArgumentDefaultsHelpFormatter
  19. )
  20. parser.add_argument("-d", "--database", default="./db.sqlite", help="The SQLite file to track the switch with")
  21. action_group = parser.add_mutually_exclusive_group()
  22. action_group.add_argument("--checkIn", action="store_true", help="Update the last check-in time")
  23. action_group.add_argument("--init", action="store_true", help="Initialize the database for the deadman's switch")
  24. args = parser.parse_args()
  25. # Begin option handling
  26. if args.init:
  27. initialize_sqlite()
  28. elif args.checkIn:
  29. update_heartbeat()