4.0 Alpha (Build 19355)
This commit is contained in:
@@ -36,7 +36,7 @@ except ModuleNotFoundError:
|
||||
except Exception as exc:
|
||||
print('Wystąpił krytyczny błąd!')
|
||||
print('Nieznany błąd podczas ładowania jednego z modułów programu (dialog.py). Nie można załadować programu.')
|
||||
print('Treść błędu: ' + exc)
|
||||
print('Treść błędu: ' + str(exc))
|
||||
print('Kod błędu: E00x0010')
|
||||
wait = input('Naciśnij ENTER aby wyjść')
|
||||
SS.exit(0)
|
||||
@@ -55,14 +55,16 @@ def CheckFormat(Read, format):
|
||||
poprawne = True
|
||||
check = True
|
||||
while check:
|
||||
# Uczniowie
|
||||
uczniowiefmt = ''
|
||||
for x in format[0]:
|
||||
uczniowiefmt += x
|
||||
|
||||
# Sprawdzanie pustych linii
|
||||
try:
|
||||
if format[0].count('') > 0:
|
||||
error = int('x')
|
||||
except ValueError:
|
||||
except:
|
||||
MDdlg.err(11)
|
||||
if Read:
|
||||
SS.exit(0)
|
||||
@@ -70,10 +72,11 @@ def CheckFormat(Read, format):
|
||||
poprawne = False
|
||||
break
|
||||
|
||||
# Sprawdzanie ilości liter K
|
||||
try:
|
||||
if uczniowiefmt.count('K') != 1:
|
||||
error = int('x')
|
||||
except ValueError:
|
||||
except:
|
||||
MDdlg.err(6)
|
||||
if Read:
|
||||
SS.exit(0)
|
||||
@@ -81,10 +84,11 @@ def CheckFormat(Read, format):
|
||||
poprawne = False
|
||||
break
|
||||
|
||||
# Sprawdzanie ilości liter O
|
||||
try:
|
||||
if uczniowiefmt.count('O') != 1:
|
||||
error = int('x')
|
||||
except ValueError:
|
||||
except:
|
||||
MDdlg.err(7)
|
||||
if Read:
|
||||
SS.exit(0)
|
||||
@@ -92,10 +96,11 @@ def CheckFormat(Read, format):
|
||||
poprawne = False
|
||||
break
|
||||
|
||||
# Sprawdzanie ilości liter N
|
||||
try:
|
||||
if uczniowiefmt.count('N') != 1:
|
||||
error = int('x')
|
||||
except ValueError:
|
||||
except:
|
||||
MDdlg.err(8)
|
||||
if Read:
|
||||
SS.exit(0)
|
||||
@@ -103,10 +108,11 @@ def CheckFormat(Read, format):
|
||||
poprawne = False
|
||||
break
|
||||
|
||||
# Sprawdzanie ilości liter I
|
||||
try:
|
||||
if uczniowiefmt.count('I') != 1:
|
||||
error = int('x')
|
||||
except ValueError:
|
||||
except:
|
||||
MDdlg.err(9)
|
||||
if Read:
|
||||
SS.exit(0)
|
||||
@@ -114,10 +120,11 @@ def CheckFormat(Read, format):
|
||||
poprawne = False
|
||||
break
|
||||
|
||||
# Sprawdzanie ilości liter L
|
||||
try:
|
||||
if uczniowiefmt.count('L') != 1:
|
||||
error = int('x')
|
||||
except ValueError:
|
||||
except:
|
||||
MDdlg.err(10)
|
||||
if Read:
|
||||
SS.exit(0)
|
||||
@@ -125,10 +132,17 @@ def CheckFormat(Read, format):
|
||||
poprawne = False
|
||||
break
|
||||
|
||||
|
||||
# Nauczyciele
|
||||
nauczycielefmt = ''
|
||||
for x in format[1]:
|
||||
nauczycielefmt += x
|
||||
|
||||
# Sprawdzanie pustych linii
|
||||
try:
|
||||
if format[1].count('') > 0:
|
||||
error = int('x')
|
||||
except ValueError:
|
||||
except:
|
||||
MDdlg.err(12)
|
||||
if Read:
|
||||
SS.exit(0)
|
||||
@@ -136,14 +150,11 @@ def CheckFormat(Read, format):
|
||||
poprawne = False
|
||||
break
|
||||
|
||||
nauczycielefmt = ''
|
||||
for x in format[1]:
|
||||
nauczycielefmt += x
|
||||
|
||||
# Sprawdzanie ilości liter N
|
||||
try:
|
||||
if nauczycielefmt.count('N') != 1:
|
||||
error = int('x')
|
||||
except ValueError:
|
||||
except:
|
||||
MDdlg.err(13)
|
||||
if Read:
|
||||
SS.exit(0)
|
||||
@@ -151,10 +162,11 @@ def CheckFormat(Read, format):
|
||||
poprawne = False
|
||||
break
|
||||
|
||||
# Sprawdzanie ilości liter I
|
||||
try:
|
||||
if nauczycielefmt.count('I') != 1:
|
||||
error = int('x')
|
||||
except ValueError:
|
||||
except:
|
||||
MDdlg.err(14)
|
||||
if Read:
|
||||
SS.exit(0)
|
||||
@@ -162,10 +174,11 @@ def CheckFormat(Read, format):
|
||||
poprawne = False
|
||||
break
|
||||
|
||||
# Sprawdzanie ilości liter L
|
||||
try:
|
||||
if nauczycielefmt.count('L') != 1:
|
||||
error = int('x')
|
||||
except ValueError:
|
||||
except:
|
||||
MDdlg.err(15)
|
||||
if Read:
|
||||
SS.exit(0)
|
||||
@@ -173,12 +186,14 @@ def CheckFormat(Read, format):
|
||||
poprawne = False
|
||||
break
|
||||
|
||||
|
||||
# Sprawdzanie poprawności znaków
|
||||
NiedozwoloneZnaki = ['1','2','3','4','5','6','7','8','9','0','W','E','R','T','Y','U','P','A','S','D','F','G','H','J','Z','C','V','B','M']
|
||||
try:
|
||||
for x in NiedozwoloneZnaki:
|
||||
if x in nauczycielefmt+uczniowiefmt:
|
||||
error = int('x')
|
||||
except ValueError:
|
||||
except:
|
||||
MDdlg.err(16)
|
||||
if Read:
|
||||
SS.exit(0)
|
||||
@@ -186,7 +201,8 @@ def CheckFormat(Read, format):
|
||||
poprawne = False
|
||||
break
|
||||
check = False
|
||||
return poprawne
|
||||
if not Read:
|
||||
return poprawne
|
||||
|
||||
|
||||
|
||||
@@ -196,6 +212,8 @@ def read():
|
||||
check = open(r'.\format.fmt')
|
||||
except FileNotFoundError:
|
||||
MDdlg.err(5)
|
||||
except:
|
||||
MDdlg.err(21)
|
||||
else:
|
||||
with open(r'.\format.fmt', 'r') as fmt:
|
||||
fmt = fmt.read().split('\n<separator>\n')
|
||||
@@ -217,6 +235,8 @@ def edit(format):
|
||||
check = open(r'.\format.fmt')
|
||||
except FileNotFoundError:
|
||||
MDdlg.err(5)
|
||||
except:
|
||||
MDdlg.err(21)
|
||||
else:
|
||||
FormatToSaveX = []
|
||||
for x in xformat:
|
||||
|
||||
Reference in New Issue
Block a user