コード例 #1
0
def main():
    employee_info={'username':username,'password':password,'employee_name':employee_name}
    shift_period={'start_of_week':start_of_week,'end_of_week':end_of_week}
    schedule=get_schedule(employee_info,shift_period)
    if (schedule):
        export_to_ics(schedule,start_of_week,end_of_week)
    else:
        print employee_name+' not found'
コード例 #2
0
def new_main():
    day = input('Day: ')

    schedule = get_schedule(day)
    with open('imgs/player-photo-mappings.json') as f:
        mappings = json.load(f)
    files = [str(f) for f in os.listdir('imgs')]

    for player in schedule['players']:
        get_image_by_id(player, files, mappings, ask=True)

    with open('imgs/player-photo-mappings.json', 'w') as f:
        json.dump(mappings, f)
コード例 #3
0
def index():
    df,df0 = get_schedule()
    print df,df0
    print df.SPEC
    day = df.to_html(classes = "dayshift table-hover")
    night = df0.to_html(classes = "nightshift table-hover")
    tz = pytz.timezone('Asia/Shanghai')
    time = format(datetime.datetime.now(tz),'')
    #request.form get values from HTML attribute 'name',then compare value with attr 'value'
    if request.form.get('go') == 'go':
        if request.form.get('spec') is not None:
            session['spec'] = request.form.get('spec')
            add_data_VMI(session.get('spec'))
            add_data_MAXX(session.get('spec'))
            db_to_dat()
            return redirect(url_for('index'))
    return render_template('index.html',day = day,night = night,time = time)
コード例 #4
0
def index():
    df, df0 = get_schedule()
    print df, df0
    print df.SPEC
    day = df.to_html(classes="dayshift table-hover")
    night = df0.to_html(classes="nightshift table-hover")
    tz = pytz.timezone('Asia/Shanghai')
    time = format(datetime.datetime.now(tz), '')
    #request.form get values from HTML attribute 'name',then compare value with attr 'value'
    if request.form.get('go') == 'go':
        if request.form.get('spec') is not None:
            session['spec'] = request.form.get('spec')
            add_data_VMI(session.get('spec'))
            add_data_MAXX(session.get('spec'))
            db_to_dat()
            return redirect(url_for('index'))
    return render_template('index.html', day=day, night=night, time=time)
コード例 #5
0
 def on_get(self, req, resp):
     try:
         with open('config.json') as f:
             conf = json.load(f)
         if not conf.get('cache', True) or self._cached_media is None:
             username = conf['username']
             password = conf['password']
             events = get_schedule(username, password).to_jsonable()
             self._cached_media = events
         else:
             events = self._cached_media
         resp.set_header('Access-Control-Allow-Origin', '*')
         resp.media = events
         resp.status = '200'
     except ParseError:
         resp.set_header('Access-Control-Allow-Origin', '*')
         resp.media = {"error": "failed to parse data from loyola."}
         resp.status = '500'
         traceback.print_exc()
     except Exception:
         resp.set_header('Access-Control-Allow-Origin', '*')
         resp.media = {"error": "internal server error"}
         resp.status = '500'
         traceback.print_exc()
コード例 #6
0
ファイル: get_classes.py プロジェクト: isavine/UCB-Courses
def get_classes(searchresults, exclude, catalog_url, dept):
    classes = get_schedule(searchresults, exclude)
    classes = aggregate(classes)
    catalog = scrape_catalog(catalog_url, dept)
    classes = add_catalog_info(classes, catalog)
    return classes
コード例 #7
0
ファイル: emailer.py プロジェクト: beelarr/weatheremail
def main():
    emails = get_emails.get_emails()
    schedule = get_schedule.get_schedule()
    forecast = weather.get_weather_forecast()
    sender.send_emails(emails, schedule, forecast)