moodlefuse/main.py

30 lines
567 B
Python
Raw Normal View History

2023-05-01 01:12:48 +02:00
import logging
from fuse import FUSE
from moodle import Moodle
from moodlefs import MoodleFS
# do something with the filesystem
if not hasattr(__builtins__, 'bytes'):
bytes = str
import os
from dotenv import load_dotenv
load_dotenv()
SITE = os.getenv('SITE')
MOODLE_USERNAME = os.getenv('MOODLE_USERNAME')
PASSWORD = os.getenv('PASSWORD')
MOUNT = os.getenv('MOUNT')
2023-05-01 01:14:21 +02:00
m = Moodle(SITE, MOODLE_USERNAME, PASSWORD)
2023-05-01 01:12:48 +02:00
m.login()
#logging.basicConfig(level=logging.DEBUG)
2023-05-01 01:12:48 +02:00
if __name__ == '__main__':
2023-05-01 01:14:21 +02:00
FUSE(MoodleFS(m), MOUNT, foreground=True, allow_other=True)