Skip to content
This repository was archived by the owner on Sep 2, 2024. It is now read-only.

Commit 6258b78

Browse files
committed
popravi selitve
ker pač ljubi bog, da bi vodstvo naredilo standarden format
1 parent 3f0bab2 commit 6258b78

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/pdfparsers/selitve2024.py

+11-3
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ async def process_migrations():
5959
for i in range(2):
6060
k = i * 5 # zamik
6161

62-
if len(line) <= k:
62+
if len(line) <= k + 1:
6363
continue
6464

6565
h = line[k]
66-
if h == "":
66+
if h == "" or line[k+1] == "":
6767
continue
6868

6969
raz = line[k+1].lower()
@@ -78,9 +78,17 @@ async def process_migrations():
7878
print(f"[MIGRATIONS 2024 PARSER] Failure while parsing hour. Error: {e}. Line: {line}/{i}")
7979
continue
8080

81+
# nova učilnica
82+
# - 003
83+
# - iz 206 v 004
84+
# pač ljubi bog
85+
nova_ucilnica = line[k+4].upper()
86+
r2 = re.search(r"IZ .* V (.*)", nova_ucilnica)
87+
if r2 is not None:
88+
nova_ucilnica = r2.group(1)
89+
8190
predmet = line[k+2].upper()
8291
ucitelj = line[k+3].lower()
83-
nova_ucilnica = line[k+4].upper() # baje ne smemo pretvoriti v int, saj je vrednost lahko tudi ČIT
8492

8593
# sej ne, da v nadomeščanjih uporabljajo format 4A, tukaj pa 4. a also, kadar so maturitetne zadeve,
8694
# je edino logično, da ne uporabijo 4AB..., kot to delajo na jebenih nadomeščanjih, temveč napišejo

0 commit comments

Comments
 (0)