1
0
favro-sync/favro_sync/__main__.py
Jon Michael Aanes a1f4a8207e
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 24s
Load collection filter from file
2025-01-08 15:12:57 +01:00

37 lines
902 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, secrets.favro_collection_filter())
if __name__ == '__main__':
main()