forked from dvd-dev/python-hilo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
executable file
·27 lines (22 loc) · 734 Bytes
/
test.py
File metadata and controls
executable file
·27 lines (22 loc) · 734 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
27
#!/usr/bin/env python
import asyncio
from aiohttp import ClientSession
import logging
from os import environ
from pyhilo import API, Hilo
from pyhilo.const import LOG # noqa
logging.basicConfig(
level=logging.DEBUG,
format="%(asctime)s %(name)s:%(filename)s:%(lineno)d %(threadName)s %(levelname)s %(message)s",
)
async def async_main() -> None:
# export hilo_username="[email protected]"
# export hilo_password="1234"
username = environ.get("hilo_username", "")
password = environ.get("hilo_password", "")
api = await API.async_auth(username, password, session=ClientSession())
h = Hilo(api)
await h.async_init()
loop = asyncio.get_event_loop()
loop.create_task(async_main())
loop.run_forever()