Refactor imports and replace vars with constants; remove unused test file
This commit is contained in:
parent
bc2eb35b6f
commit
20db69ef4d
3 changed files with 1 additions and 45 deletions
|
@ -1,6 +1,6 @@
|
||||||
import flet as ft
|
import flet as ft
|
||||||
from i18n import *
|
from i18n import *
|
||||||
from vars import *
|
from constants import *
|
||||||
|
|
||||||
set_language("pl")
|
set_language("pl")
|
||||||
|
|
||||||
|
|
44
src/test.py
44
src/test.py
|
@ -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.")
|
|
Loading…
Add table
Reference in a new issue