import os
import os.path
import re
+import sys
conn = None
continue
if not int(row[0]) in ids:
print "Importing %s" % (row, )
- conn.execute("INSERT INTO teilnehmer VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
- row[:-2] + ['Kein T-Shirt', 'Kein Pulli'] + row[-2:] + [0, 0, 0])
+ conn.execute("INSERT INTO teilnehmer VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
+ row[:-2] + ['Kein T-Shirt', 'Kein Pulli'] + row[-2:] + [0, 0, 0, "", "false"])
conn.commit()
preis, id])
conn.commit()
+
def create_nametag(outdir='output'):
template = env.get_template('nametag.svg')
- for vorname, nachname, namensschild, hochschule in \
- conn.execute("SELECT vorname, nachname, namensschild, hochschule FROM teilnehmer"):
+ for teiln_id, vorname, nachname, namensschild, hochschule, dochned in \
+ conn.execute("SELECT id, vorname, nachname, namensschild, hochschule, dochned FROM teilnehmer"):
+
+ if dochned != "false":
+ print >> sys.stderr, "not generating %s %s (id %s), because abgemeldet" % (vorname, nachname, teiln_id)
+ continue
- with open(os.path.join(outdir, "%s.svg" % namensschild), 'w') as f:
+ with open(os.path.join(outdir, "%s.svg" % teiln_id), 'w') as f:
f.write(template.render(name=u"%s %s" % (vorname.decode('utf-8'),
nachname.decode('utf-8')),
nick=namensschild.decode('utf-8'),
uni1=hochschule.decode('utf-8')).encode('utf-8'))
-
def create_teilnehmer_list(outdir = 'output'):
template = env.get_template('teilnehmerliste.tex')
teilnehmer = []
- i = 1
- for vor, nach, nick, hochschule, betrag, bezahlt, shirtsize, zippersize in \
- conn.execute("SELECT vorname, nachname, namensschild, hochschule, betrag, bezahlt, tshirt, zipper FROM teilnehmer ORDER BY UPPER(nachname) ASC"):
+ for vor, nach, nick, hochschule, betrag, bezahlt, shirtsize, zippersize, dochned, comment in \
+ conn.execute("SELECT vorname, nachname, namensschild, hochschule, betrag, bezahlt, tshirt, zipper, dochned, orga_comment FROM teilnehmer ORDER BY UPPER(nachname) ASC"):
vor = vor.decode('utf8')
nach = nach.decode('utf8')
if re.match("kein", zippersize, flags=re.IGNORECASE):
zippersize = ""
- teilnehmer.append({'vorname': vor, 'nachname': nach, 'num': i,
+ ## string to bool..
+ if dochned == "false":
+ will_attend = True
+ else:
+ will_attend = False
+ comment = comment.decode('utf8')
+
+ teilnehmer.append({'vorname': vor, 'nachname': nach,
'hochschule': hochschule, 'nick': nick, 'betrag': betrag, 'bezahlt':
- bezahlt, 'shirtsize': shirtsize, 'zippersize': zippersize})
- i = i+1
+ bezahlt, 'shirtsize': shirtsize, 'zippersize': zippersize,
+ 'will_attend': will_attend, 'comment': comment})
with open(os.path.join(outdir, "teilnehmerliste.tex"), 'w') as out: