load api key from module

This commit is contained in:
udf 2018-12-26 23:28:41 +02:00
parent d9e3240c5c
commit dd086369ca
Signed by: kate
GPG Key ID: F17AECB58C3A3096
3 changed files with 11 additions and 1 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
venv venv
__pycache__ __pycache__
api_key.py
*.session *.session
*.session-journal *.session-journal
data/ data/

2
api_key.example.py Normal file
View File

@ -0,0 +1,2 @@
id = 12345
hash = "11223344556677889900AABBCCDDEEFF"

View File

@ -5,9 +5,16 @@
import logging import logging
from uniborg import Uniborg from uniborg import Uniborg
import api_key
logging.basicConfig(level=logging.INFO) logging.basicConfig(level=logging.INFO)
borg = Uniborg("stdborg", plugin_path="stdplugins", connection_retries=None) borg = Uniborg(
"stdborg",
plugin_path="stdplugins",
connection_retries=None,
api_id=api_key.id,
api_hash=api_key.hash
)
borg.run_until_disconnected() borg.run_until_disconnected()