-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.py
More file actions
26 lines (18 loc) · 688 Bytes
/
script.py
File metadata and controls
26 lines (18 loc) · 688 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import asyncio
import click
from backup_client import BackupClient
@click.command()
@click.option("--yandex-disk-token", type=str, required=True)
@click.option("--github-token", type=str, required=True)
def main(yandex_disk_token: str, github_token: str):
asyncio.run(_async_main(
yandex_disk_token=yandex_disk_token,
github_token=github_token
))
async def _async_main(yandex_disk_token: str, github_token: str):
backup_client = BackupClient(yandex_disk_token=yandex_disk_token,
github_token=github_token)
await backup_client.back_up_repos()
await backup_client.shutdown()
if __name__ == '__main__':
main()