3.0 Release Preview 1

This commit is contained in:
2020-08-06 18:00:05 +02:00
Unverified
parent 5042b9203c
commit 48256a4045
336 changed files with 734 additions and 101640 deletions

51
moduly.py Normal file
View File

@@ -0,0 +1,51 @@
import sys as ss
import time as tm
from tkinter import messagebox as TKmsb
def ErrorDialog(KodBledu):
Message = 'Wystąpił błąd!\n' + KodBledu
TKmsb.showerror('Błąd', Message)
ss.exit(0)
def FileCheck(Plik, KodBledu):
try:
x = open(Plik)
except FileNotFoundError:
ErrorDialog(KodBledu)
def PolishLetterRemover(text):
text1 = text.replace('ę', 'e')
text2 = text1.replace('ó', 'o')
text3 = text2.replace('ą', 'a')
text4 = text3.replace('ś', 's')
text5 = text4.replace('ł', 'l')
text6 = text5.replace('ż', 'z')
text7 = text6.replace('ź', 'z')
text8 = text7.replace('ć', 'c')
text9 = text8.replace('ń', 'n')
text10 = text9.replace('Ę', 'E')
text11 = text10.replace('Ó', 'O')
text12 = text11.replace('Ą', 'A')
text13 = text12.replace('Ś', 'S')
text14 = text13.replace('Ł', 'L')
text15 = text14.replace('Ż', 'Z')
text16 = text15.replace('Ź', 'Z')
text17 = text16.replace('Ć', 'C')
text = text17.replace('Ń', 'N')
return text
def ClassTagCreator(Klasa):
czas = tm.localtime()
miesiac = czas[1]
if miesiac >= 9:
rokpodst = czas[0]
else:
rokpodst = czas[0] - 1
nrklasy = int(Klasa[0])
literaklasy = Klasa[1]
szkola = Klasa.split(' ')[1]
if szkola == 'BS':
znacznik = str((4 - nrklasy) + rokpodst) + szkola
else:
znacznik = str((5 - nrklasy) + rokpodst) + literaklasy
return znacznik