-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjwk_librus.py
43 lines (34 loc) · 1.11 KB
/
jwk_librus.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
from py_librus_api import Librus
import time
from datetime import date
librus = Librus()
class MyLibrus():
def __init__(self, login, password, nr):
self.login = login
self.password = password
self.nr = nr
def logowanie(self):
return librus.login(self.login, self.password)
def polacz(self):
return librus.make_connection(self.login, self.password)
def czyZalogowano(self):
if not librus.logged_in:
if not librus.login(self.login, self.password):
return False
else:
return True
def nieObecnosci(self, wszystkie = False):
tajne_akta = librus.get_teacher_free_days()
def ToDate(text):
text = text.split('-')
return date(int(text[0]), int(text[1]), int(text[2]))
if not wszystkie:
actual = []
for x in tajne_akta:
if date.today() <= ToDate(x["DateTo"]):
actual.append(x)
return actual
else:
return tajne_akta
def numerek(self):
return librus.get_lucky_number()