Beispiel #1
0
def getStep(gid="0", offset="0", step='10'):
	'''Служит для получения промежуточного списка документов. Запрашивает \'step\' штук.'''
	if gid[0]!='-': gid='-'+gid	
	result=[]
	response= api.call("photos.getAll", {'owner_id': gid, 'count':step, 'offset':offset})[1:]
	for x in response:
		result.append([ x[u'text'], x[u'owner_id'], x[u'pid'] ])
	return result
Beispiel #2
0
def get_address_record(api, contract, address):
    res = api.call(contract, funid=4, data=[address])
    received_by_address, last_updated, nr_watched, last_watched = res
    return {
        'received_by_address': received_by_address,
        'last_updated': last_updated,
        'nr_watched': nr_watched,
        'last_watched': last_watched}
Beispiel #3
0
 def poll_submit_vote(self, pollId, pollQuestionId, pollQuestionOptionId, otherText, auth=True):
     params = {
         "PollID": pollId,
         "PollQuestionID": pollQuestionId,
         "PollQuestionOptionID": pollQuestionOptionId,
         "OtherText": otherText,
     }
     return api.call("Poll_SubmitVote_JSON", params, auth, "post")
Beispiel #4
0
def call_api(method, **kwargs):
    post_data = request.form

    try:
        j = request.get_json()

        if j:
            post_data = j
    except exceptions.BadRequest:
        pass

    result, code = api.call(method,
                            request.args,
                            post_data,
                            kwargs,
                            request.method)

    return json.dumps(result, ensure_ascii=False, cls=JSONSerializer), code
Beispiel #5
0
 def checkcrime(lat, lon, radius):
     return api.call(lat, lon, radius)
Beispiel #6
0
 def validate(self):
     params = {'APIKey': api.apiKey, 'Token': api.authToken}
     return api.call('Validate', params)
 def lib_ereserves(self, courseId, titleOnly=False, auth=True):
     params = {'CourseID': courseId, 'TitleOnly': titleOnly}
     return api.call('LibEreserves', params, auth)
Beispiel #8
0
 def code_table_week_types(self, auth=True):
     return api.call('CodeTable_WeekTypes', {}, auth)
Beispiel #9
0
 def my_organizer_acad_semester_info(self, acadYear, semester, auth=True):
     params = {'AcadYear': acadYear, 'Semester': semester}
     return api.call('MyOrganizer_AcadSemesterInfo', params, auth)
Beispiel #10
0
 def my_organizer_delete_personal_event(self, eventId, deleteAllRecurrence, auth=True):
     params = {'EventID': eventId, 'DeleteAllRecurrence': deleteAllRecurrence}
     return api.call('MyOrganizer_DeletePersonalEvent_JSON', params, auth, 'post')
Beispiel #11
0
 def my_organizer_add_personal_event(self, eventTitle, venue, eventDateTime, description, recurType, weeklyRecurEvery, strDays, recurTillDate, auth=True):
     params = {'EventTitle': eventTitle, 'Venue': venue, 'EventDateTime': eventDateTime, 'Description': description, 'RecurType': recurType, 'WeeklyRecurEvery': weeklyRecurEvery, 'StrDays': strDays, 'RecurTillDate': recurTillDate}
     return api.call('MyOrganizer_AddPersonalEvent_JSON', params, auth, 'post')
 def open_webcast_add_log(self, mediaChannelId, mediaChannelItemId, auth=True):
     params = {'MediaChannelID': mediaChannelId, 'MediaChannelItemID': mediaChannelItemId}
     return api.call('OpenWebcast_AddLog_JSON', params, auth, 'post')
Beispiel #13
0
 def call(self, method, auth=True, verb='get', **kwargs):
     return api.call(method, kwargs, auth, verb)
Beispiel #14
0
 def polls(self, courseId, pollId, titleOnly=False, auth=True):
     params = {"CourseID": courseId, "PollID": pollId, "TitleOnly": titleOnly}
     return api.call("Polls", params, auth)
Beispiel #15
0
 def poll_get_voted_user_other(self, pollId, pollQuestionId, auth=True):
     params = {"PollID": pollId, "PollQuestionID": pollQuestionId}
     return api.call("Poll_GetVotedUser_Other", params, auth)
Beispiel #16
0
    def __getRankedStatsByPuuid(self, puuid):
        stats = call(f"{BASE_URL}/lol-ranked/v1/ranked-stats/{puuid}")
        self.RANKED_SOLO_5x5 = stats["queueMap"]["RANKED_SOLO_5x5"]
        self.RANKED_FLEX_SR = stats["queueMap"]["RANKED_FLEX_SR"]

# stat = rankedStats("9a9d9da3-391d-5b48-a869-3e94f614c957") # PainterHalver
Beispiel #17
0
 def __populateData(self, url):
     data = call(url)
     self.name = data["displayName"]
     self.accountId = data["accountId"]
     self.puuid = data["puuid"]
     self.summonerId = data["summonerId"]
Beispiel #18
0
 def my_organizer_events(self, startDate=None, endDate=None, auth=True):
     params = {'StartDate': startDate, 'EndDate': endDate}
     return api.call('MyOrganizer_Events', params, auth)
Beispiel #19
0
def getAmount(gid):
	'''Возвращает количество фотографий в группе в целом или в альбоме.'''
	if gid[0]=='-': gid=gid[1:]
	return int(api.call("photos.getAll", {'owner_id':'-'+gid, 'count': '1'})[0])
Beispiel #20
0
 def my_organizer_update_personal_event(self, eventId, eventTitle, venue, eventDateTime, description, recurType, weeklyRecurEvery, strDays, recurFromDate, recurTillDate, updateRecurrenceEvent, auth=True):
     params = {'EventID': eventId, 'EventTitle': eventTitle, 'Venue': venue, 'EventDateTime': eventDateTime, 'Description': description, 'RecurType': recurType, 'WeeklyRecurEvery': weeklyRecurEvery, 'StrDays': strDays, 'RecurFromDate': recurFromDate, 'RecurTillDate': recurTillDate, 'UpdateRecurrenceEvent': updateRecurrenceEvent}
     return api.call('MyOrganizer_UpdatePersonalEvent_JSON', params, auth, 'post')
Beispiel #21
0
 def student_events_category(self, categoryId, titleOnly=False, auth=True):
     params = {'CategoryID': categoryId, 'TitleOnly': titleOnly}
     return api.call('StudentEvents_Category', params, auth)
Beispiel #22
0
 def my_organizer_special_days(self, startDate=None, endDate=None, auth=True):
     params = {'StartDate': startDate, 'EndDate': endDate}
     return api.call('MyOrganizer_SpecialDays', params, auth)
Beispiel #23
0
 def student_events_committee(self, committeeId, titleOnly=False, auth=True):
     params = {'CommitteeID': committeeId, 'TitleOnly': titleOnly}
     return api.call('StudentEvents_Committee', params, auth)
Beispiel #24
0
 def my_organizer_personal(self, startDate=None, endDate=None, auth=True):
     params = {'StartDate': startDate, 'EndDate': endDate}
     return api.call('MyOrganizer_Personal', params, auth)
Beispiel #25
0
 def student_events_post_new_event(self, categoryId, committeeId, title, evtStartDate, evtEndDate, auth=True):
     params = {'CategoryID': categoryId, 'CommitteeID': committeeId, 'Title': title, 'evtStartDate': evtStartDate, 'evtEndDate': evtEndDate}
     return api.call('StudentEvents_PostNewEvent_JSON', params, auth, 'post')
Beispiel #26
0
 def my_organizer_ivle(self, startDate=None, endDate=None, auth=True):
     params = {'StartDate': startDate, 'EndDate': endDate}
     return api.call('MyOrganizer_IVLE', params, auth)
Beispiel #27
0
 def student_events(self, titleOnly=False, auth=True):
     params = {'TitleOnly': titleOnly}
     return api.call('StudentEvents', params, auth)
 def lib_ereserves_files(self, folderId, auth=True):
     params = {'FolderID': folderId}
     return api.call('LibEreserveFiles', params, auth)
Beispiel #29
0
 def student_events_categories(self, includeEvents=True, titleOnly=False, auth=True):
     params = {'IncludeEvents': includeEvents, 'TitleOnly': titleOnly}
     return api.call('StudentEvents_Categories', params, auth)
Beispiel #30
0
 def useremail_get(self):
     params = {'APIKey': api.apiKey, 'Token': api.authToken}
     return api.call('UserEmail_Get', params)
Beispiel #31
0
 def workbins(self, courseId, duration=0, workbinId=None, titleOnly=False, auth=True):
     params = {'CourseID': courseId, 'Duration': duration, 'WorkbinID': workbinId, 'TitleOnly': titleOnly}
     return api.call('Workbins', params, auth)
Beispiel #32
0
 def username_get(self):
     params = {'APIKey': api.apiKey, 'Token': api.authToken}
     return api.call('UserName_Get', params)
 def open_webcasts(self, acadYear, semester, titleOnly=False, mediaChannelId=None, auth=True):
     params = {'AcadYear': acadYear, 'Semester': semester, 'TitleOnly': titleOnly, 'MediaChannelID': mediaChannelId}
     return api.call('OpenWebcasts', params, auth)