moodlefuse/main.py

30 lines
584 B
Python
Raw Normal View History

2023-05-01 01:12:48 +02:00
import logging
2023-05-09 16:17:22 +02:00
import sys
from refuse.high import FUSE
2023-05-01 01:12:48 +02:00
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)