1
0
Fork 0
forked from Fuji/Fuji

Refactor imports and replace vars with constants; remove unused test file

This commit is contained in:
Maarceeli 2025-02-22 13:09:02 +01:00
parent bc2eb35b6f
commit 20db69ef4d
3 changed files with 1 additions and 45 deletions

View file

@ -1,6 +1,6 @@
import flet as ft
from i18n import *
from vars import *
from constants import *
set_language("pl")

View file

@ -1,44 +0,0 @@
from sdk.src.interfaces.prometheus.context import (
PrometheusAuthContext,
PrometheusWebCredentials,
)
from sdk.src.interfaces.prometheus.interface import PrometheusInterface
import os
import pickle
# NOT SAFE, DO NOT USE IN PRODUCTION
if os.path.exists('data.temp'):
with open('data.temp', 'rb') as file:
auth_context = pickle.load(file)
interface = PrometheusInterface(
auth_context=auth_context,
student_context=None,
)
interface.login()
else:
interface = PrometheusInterface(
auth_context=PrometheusAuthContext(
prometheus_web_credentials=PrometheusWebCredentials(
username=input("Login: "), password=input("Hasło: ")
)
),
student_context=None,
)
interface.login()
auth_context = interface.get_auth_context()
with open('data.temp', 'wb') as file:
pickle.dump(auth_context, file)
students = interface.get_students()
print(students)
# Select the first student and fetch grades
if students:
interface.select_student(students[0].context)
grades = interface.get_grades(int(1))
print(grades)
else:
print("No students found.")