Ejemplo n.º 1
0
def main(config, datetimeOverrule=None):
    schedules = [item['schedule'] for item in config if item.has_key("schedule")] #load schedule yaml-objects
    zbarcommands = [item['zbarcommand'] for item in config if item.has_key("zbarcommand")][0] #load schedule
    # import ipdb; ipdb.set_trace()
    zbarcommand = zbarcommands[platform.system()]
    
    from csv_interface import build_interface

    klein, groot = build_interface()
    schedules = {"klein":klein, "groot":groot}

    activities = dict([(item['activity']['name'], item['activity']) for item in config if item.has_key("activity")])

    #print activities
    print check_images(activities, klein) | check_images(activities, groot)
    
    def update(*args):
        print args
        
    root = tk.Tk()
    
    root.geometry("{0}x{1}+0+0".format(root.winfo_screenwidth(),
                                       root.winfo_screenheight()))
    root.configure(background='white')
    app = QrJotariGui(root, activities)
    
    backend = pyQRjotari.JotariQrBackend(schedules, app.update, command=zbarcommand, datetimeOverrule=datetimeOverrule)
    backend.start()
    
    root.mainloop()
    print "Mainloop ended"
    backend.force_stop()
Ejemplo n.º 2
0
def main(config):
    from csv_interface import build_interface
    klein, groot = build_interface()

    schedules = {'klein':klein, "groot":groot}
    
    def update(*args):
        print args
    
    backend = JotariQrBackend(schedules, update, command="zbarcam /dev/video1")
    backend.start()
    backend.wait_stop()
Ejemplo n.º 3
0
#! /usr/bin/python
import os
from bottle import route, run, template, post
import datetime
from dateutil import parser
from csv_interface import build_interface
from leidingplanning import build_interface as leiding_interface
from bottledaemon import daemon_run
from collections import OrderedDict

klein, groot = build_interface()
schedules = {"klein":klein,
             "groot":groot}
leiding_planning = leiding_interface()

@route('/qr/<code>/')
@route('/qr/<code>')
@route('/qr/<code>/<time>/', defaults={'time': None})
@route('/qr/<code>/<time>', defaults={'time': None})
def qr(code='klein1', time=None):
    if "groot" in code or "klein" in code:
        return group(code, time)
    if 'leiding' in code:
        return leiding(code, time)
    else:
        return schedule(code) #No group specified, interpret code as time

def find_next(age_sched, current_time, group, time_gap=1):
    current_activities = dict(age_sched[current_time]) #TODO: Set correct/current time!
    next_activity = "Onbekend"
    if current_activities: