示例#1
0
def lock_api():
    global key
    print("API Key: %s" % api_entry.get())
    # save API key in a global variable
    key = api_entry.get()
    global values
    values = sheet.get_sheet(key)
    api_entry.delete(0, END)
    api_entry.insert(0, "********************")
示例#2
0
def run_scrapper(url, username):
    sheet, sheet_link = get_sheet()
    sheet_id = sheet.id
    response_slack(f'{sheet_link} 해당 엑셀 시트로 요청하신 데이터가 업로드 됩니다.(완료 시 알람)')
    if 'smartstore' in url:
        smart_store(url, sheet_id, gc)
    elif 'shopping.naver' in url:
        naver_shopping(url, sheet_id, gc)

    response_slack(f'업데이트 완료 <@{username}>')
    def stop_recording(self):
        self.pbtn_stop.setEnabled(False)
        self.pbtn_start.setEnabled(True)
        self.pbtn_play.setEnabled(True)
        self.pbtn_save.setEnabled(True)
        self.pbtn_midi.setEnabled(True)
        self.pbtn_pause.setEnabled(True)
        self.pbtn_genMusic.setEnabled(True)
        self.cb_devices.setEnabled(True)
        #self.stopwatch_reset()
        self.timer.stop()

        self.audio.stop_stream()
        self.musicsheet = st.get_sheet()

        return self
示例#4
0
def main(**kwargs):
    sheet = get_sheet()
    assert sheet.acell('K2').value.strip() == 'Median'
    assert sheet.acell('L2').value.strip() == 'Weighted Median'
    assert sheet.acell('P2').value.strip() == 'Wings Used'
    rownum = 2
    for proj in list(load_projects()):
        rownum += 1
        data = load_project_data(proj['id'])
        median = get_median_vote(data['votes'])
        wmedian = get_weighted_median_vote(data['votes'])
        weight_sum = get_weight_sum(data['votes'])
        assert sheet.cell(rownum, 1).value.strip() == proj['name']
        sheet.update_acell('K%d' % rownum, '%s' % format_number(median))
        sheet.update_acell('L%d' % rownum, '%s' % format_number(wmedian))
        sheet.update_acell('P%d' % rownum, '%s' % format_number(weight_sum))
    ts = datetime.utcnow().strftime('%d %b, %H:%M UTC')
    sheet.update_acell('A1', ts)
示例#5
0
def get_post_plan():
    sheet = get_sheet(SPREADSHEET_ID, RANGE_NAME)
    header_shift_rows = 2
    index_number_rows_difference = 1
    post_plan = []
    for row in sheet[header_shift_rows:]:
        post = {
            'is_vkontakte': row[0] == 'да',
            'is_telegram': row[1] == 'да',
            'is_facebook': row[2] == 'да',
            'publish_day': get_day_number_by_day_name(row[3]),
            'publish_time': row[4],
            'post_file_id': get_file_id(get_url(row[5])),
            'post_image_id': get_file_id(get_url(row[6])),
            'is_published': row[7] == 'да',
            'sheet_row_number': sheet.index(row) + index_number_rows_difference
        }
        post_plan.append(post)
    return post_plan