1
0
favro-sync/favro_sync/__main__.py

36 lines
826 B
Python

import logging
import tempfile
import requests_cache
from . import secrets
from .favro_client import FavroClient, OrganizationId
from .favro_fuse import start_favro_fuse
def main():
logging.basicConfig()
read_only = False
with tempfile.TemporaryDirectory(prefix='favro_sync_') as tmpdirname:
session = requests_cache.CachedSession(
tmpdirname + '/http-cache.sqlite',
expire_after=300,
)
client = FavroClient(
favro_org_id=OrganizationId(secrets.favro_org_id()),
favro_username=secrets.favro_username(),
favro_password=secrets.favro_password(),
session=session,
read_only=read_only,
)
client.check_logged_in()
start_favro_fuse(client)
if __name__ == '__main__':
main()