Exemplo n.º 1
0
if "-h" in sys.argv or len(sys.argv) > 4:
    print("""Usage: {} <schedule sheet> <day> <time>

    Run the bot to handle polls and chat synchronization for sessions that overlap
    the time specified.

    Options:
        <schedule sheet>    The Excel sheet containing the day schedules
        <time>              A bot will be run to manage the chat for each session whose start/end
                            interval contains the time specified. Format as HHMM
    """.format(sys.argv[0]))
    sys.exit(0)

database = schedule.Database(sys.argv[1],
                             youtube=True,
                             use_pickled_credentials=True)
client = discord.Client()

day = database.get_day(sys.argv[2])
bot_time = datetime(schedule.CONFERENCE_YEAR,
                    day.month,
                    day.day,
                    hour=int(sys.argv[3][0:2]),
                    minute=int(sys.argv[3][2:4]),
                    tzinfo=schedule.conf_tz)

channels = {}
videos = {}
video_stats = {}
prev_message = {}
Exemplo n.º 2
0
import sys
import shutil
import os
import json
import ics
from PIL import Image
from datetime import timedelta

import core.schedule as schedule

if len(sys.argv) < 3:
    print("Usage: {} <data sheet.xlsx> <base dir> <out_dir> [--img] [--ics]".
          format(sys.argv[0]))
    sys.exit(1)

database = schedule.Database(sys.argv[1])
export_images = "--img" in sys.argv
export_ics = "--ics" in sys.argv
img_asset_dir = sys.argv[2]
output_dir = sys.argv[3]

if (export_ics or export_images) and not os.path.exists(output_dir):
    os.makedirs(output_dir, exist_ok=True)

full_vis_calendar = ics.Calendar()
event_calendars = {}

paper_list = {}
all_sessions = {}
conference_days = [
    "sunday", "monday", "tuesday", "wednesday", "thursday", "friday"
Exemplo n.º 3
0
import sys
import time
import json
import discord
from datetime import datetime, timedelta
from heapq import heappush, heappop

import core.schedule as schedule

if len(sys.argv) < 3:
    print("Usage: {} <data sheet.xlsx> <day> [<logo_image.png>]".format(
        sys.argv[0]))
    sys.exit(1)

database = schedule.Database(sys.argv[1], email=True)

day = database.get_day(sys.argv[2])
sessions = day.get_sessions(False)

logo_image = None
if len(sys.argv) == 4:
    with open(sys.argv[3], "rb") as f:
        logo_image = f.read()

emails_sent = 0
for k, v in sessions.items():
    print(k)
    v.email_contributors(logo_image=logo_image)
    # We can do 14 emails per second with SES, but limit it a bit more
    emails_sent += 1
    if emails_sent % 14 == 0: