forked from Trygve/otime
Fiksa at første linje i mtr fila ble hoppa over
This commit is contained in:
parent
c15fd70cf2
commit
09723e6966
5
otime.py
5
otime.py
@ -214,11 +214,8 @@ class card_punch:
|
||||
|
||||
def list_from_mtr_f(mtr_f):
|
||||
csvreader = csv.reader(open(mtr_f))
|
||||
fields = next(csvreader)
|
||||
|
||||
fields = []
|
||||
rows = []
|
||||
|
||||
cards = []
|
||||
# hver rad er brikkenummer med tilhørende info
|
||||
for row in csvreader:
|
||||
@ -287,7 +284,7 @@ def courses_from_ttime_conf(ttime_file = 'sc_2021_ttime/ttime.cnf.txt'):
|
||||
return courses
|
||||
def classes_from_ttime_conf(ttime_file, courses):
|
||||
o_classes = []
|
||||
conf = open(ttime_file, 'r').readlines()
|
||||
conf = open(ttime_file, 'r', encoding='latin_1').readlines()
|
||||
for line in conf:
|
||||
if '-courses' in line:
|
||||
raw_courselist = re.search(r'(?<=\")(.*?)(?=\")', line).group().split(';')
|
||||
|
Loading…
Reference in New Issue
Block a user