fixed bug in __init.py__ which conflicts if idlist is None

initializing idlist and skiplist as args.id and args.skip in main.py
cleaned up logic in __init.py__ which skips talkintros
This commit is contained in:
thomic 2017-04-15 16:19:45 +02:00
parent 9d486625bd
commit e6c3a6802c
2 changed files with 15 additions and 7 deletions

View file

@ -230,14 +230,15 @@ def debug():
def tasks(queue, args, idlist, skiplist): def tasks(queue, args, idlist, skiplist):
# iterate over all events extracted from the schedule xml-export # iterate over all events extracted from the schedule xml-export
for event in events(scheduleUrl): for event in events(scheduleUrl):
if 000000 in idlist:
continue
if event['room'] not in ('Chirurgie (Saal 1.04)', 'Kreißsaal (Saal 1.11)'): if event['room'] not in ('Chirurgie (Saal 1.04)', 'Kreißsaal (Saal 1.11)'):
print("skipping room %s (%s)" % (event['room'], event['title'])) print("skipping room %s (%s [%s])" % (event['room'], event['title'], event['id']))
continue
if not (idlist==[]):
if 000000 in idlist:
print("skipping id (%s [%s])" % (event['title'], event['id']))
continue continue
if not (idlist==None):
if int(event['id']) not in idlist: if int(event['id']) not in idlist:
print("skipping id %s (%s)" % (event['id'], event['title'])) print("skipping id (%s [%s])" % (event['title'], event['id']))
continue continue
# generate a task description and put them into the queue # generate a task description and put them into the queue

View file

@ -100,6 +100,13 @@ if renderlib.debug:
# threaded task queue # threaded task queue
tasks = Queue() tasks = Queue()
#initialize args.id and args.skip, if they are not given by the user
if (args.id==None):
args.id = []
if (args.skip==None):
args.skip = []
# call into project which generates the tasks # call into project which generates the tasks
project.tasks(tasks, projectpath, args.id, args.skip) project.tasks(tasks, projectpath, args.id, args.skip)