1
0
favro-sync/favro_sync/__main__.py
Jon Michael Aanes 2c8a65f959
All checks were successful
Run Python tests (through Pytest) / Test (push) Successful in 28s
Verify Python project can be installed, loaded and have version checked / Test (push) Successful in 25s
Cache users aggressively
2025-01-08 14:05:17 +01:00

37 lines
867 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()
logging.getLogger().setLevel('INFO')
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()