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'))
-## TODO: feld 'comments', alle abgemeldeten checken und eintragen,
-## nicht-tüter, nicht-XYer..
def create_teilnehmer_list(outdir = 'output'):
template = env.get_template('teilnehmerliste.tex')