verbanote-client/verbanote_client/main.py

31 lines
1.1 KiB
Python
Raw Normal View History

2023-08-25 21:25:59 +00:00
from cli import cli
2023-08-24 12:37:01 +00:00
2023-08-25 20:48:19 +00:00
# def main(args: list[str]) -> None:
# if args[1] == "status":
# elif args[1] == "cancel":
# if len(args) <= 2:
# logging.error("No job id to cancel supplied.")
# sys.exit(1)
# logging.info(f"requesting job {args[2]} cancellation...")
# response = requests.get(f"{status_endpoint}/{args[2]}", headers=headers)
# elif args[1] == "purge":
# logging.info("purging all jobs in queue...")
# response = requests.post(purge_endpoint, headers=headers)
#
# # the json will be similar to
# # {'id': 'e3d2e250-ea81-4074-9838-1c52d006ddcf', 'status': 'IN_QUEUE'}
#
# while "status" in json and (
# json["status"] == "IN_QUEUE" or json["status"] == "IN_PROGRESS"
# ):
# logging.info(f"{json['status']} for job {json['id']}, waiting...")
# time.sleep(3)
# response = requests.get(f"{status_endpoint}/{json['id']}", headers=headers)
# json = response.json()
#
# logging.info(json)
2023-08-24 10:40:57 +00:00
if __name__ == "__main__":
2023-08-25 20:48:19 +00:00
cli(auto_envvar_prefix="VERBANOTE")