]> git.siccegge.de Git - teilnehmertool.git/commitdiff
schaun ob abgemeldet im create_nametag
authorJohannes Schilling <of82ecuq@cip.cs.fau.de>
Sun, 27 Oct 2013 13:17:28 +0000 (14:17 +0100)
committerJohannes Schilling <of82ecuq@cip.cs.fau.de>
Sun, 27 Oct 2013 13:17:28 +0000 (14:17 +0100)
teilnehmertool.py

index d80d2a1e98309b275d5c79a21cb241b1d1311335..bda2774fca2b67cbb68fb005d20a52dccc73e286 100755 (executable)
@@ -10,6 +10,7 @@ import jinja2
 import os
 import os.path
 import re
+import sys
 
 conn = None
 
@@ -46,8 +47,8 @@ def import_teilnehmer(input):
                 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()
 
@@ -150,21 +151,24 @@ def create_remind(outdir='output'):
                                                                                       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')