Exemplo n.º 1
0
def conferences():
    cat = read_json(root + '/html/cat.json')
    return render_template('list.html',
        h1          = 'Open Source conferences',
        title       = 'Open Source conferences',
        conferences = tools.future(cat),
        stats       = cat['stats'],
        cal         = 'all.ics',
    )
Exemplo n.º 2
0
def calendar(location=None, tag=None):
    cat = read_json(root + '/html/cat.json')

    if location:
        name, future, past = events_in_location(cat, location)
        prodid = 'l/{}'.format(location)
    elif tag:
        future, past = events_by_tag(cat, tag)
        prodid = 't/{}'.format(tag)
    else:
        future = tools.future(cat)
        prodid = 'all'

    if not future:
        return not_found()

    cal = _calendar(prodid, future)
    return cal
Exemplo n.º 3
0
from cat.tools import read_json

with open('subscribers.json', 'r') as fh:
    subscriptions = json.load(fh)

logger.debug(subscriptions)

db_file = root + '/html/cat.json'

cat = read_json(db_file)
if not 'events' in cat:
    raise ValueError(
        "key events is missing in {}, please generate db file (see readme)".
        format(db_file))

conferences = tools.future(cat)

html = template.render(events=conferences, title="Hello")

text = "Hello"
me = "me@email"
you = "me@email"

msg = MIMEMultipart('alternative')
msg['Subject'] = "Upcoming Events"
msg['From'] = me

part1 = MIMEText(text, 'plain')
part2 = MIMEText(html, 'html')

msg.attach(part1)