archive
/
todoist-github
Archived
1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
todoist-github/todoist_github/cli.py

32 lines
528 B
Python
Executable File

#!/usr/bin/env python3
import argparse
import time
from .tasks import ALL_TASKS
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("--interval", type=int, default=0)
return parser.parse_args()
def run_tasks():
for task in ALL_TASKS:
print("Executing", task.__name__)
task()
def main():
args = get_args()
run_tasks()
if args.interval:
while True:
run_tasks()
time.sleep(args.interval)
if __name__ == "__main__":
main()