Ejemplo n.º 1
0
Archivo: photos.py Proyecto: yhn112/FPH
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
Ejemplo n.º 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}
Ejemplo n.º 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")
Ejemplo n.º 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
Ejemplo n.º 5
0
 def checkcrime(lat, lon, radius):
     return api.call(lat, lon, radius)
Ejemplo n.º 6
0
 def validate(self):
     params = {'APIKey': api.apiKey, 'Token': api.authToken}
     return api.call('Validate', params)
Ejemplo n.º 7
0
 def lib_ereserves(self, courseId, titleOnly=False, auth=True):
     params = {'CourseID': courseId, 'TitleOnly': titleOnly}
     return api.call('LibEreserves', params, auth)
Ejemplo n.º 8
0
 def code_table_week_types(self, auth=True):
     return api.call('CodeTable_WeekTypes', {}, auth)
Ejemplo n.º 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)
Ejemplo n.º 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')
Ejemplo n.º 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')
Ejemplo n.º 12
0
 def open_webcast_add_log(self, mediaChannelId, mediaChannelItemId, auth=True):
     params = {'MediaChannelID': mediaChannelId, 'MediaChannelItemID': mediaChannelItemId}
     return api.call('OpenWebcast_AddLog_JSON', params, auth, 'post')
Ejemplo n.º 13
0
 def call(self, method, auth=True, verb='get', **kwargs):
     return api.call(method, kwargs, auth, verb)
Ejemplo n.º 14
0
 def polls(self, courseId, pollId, titleOnly=False, auth=True):
     params = {"CourseID": courseId, "PollID": pollId, "TitleOnly": titleOnly}
     return api.call("Polls", params, auth)
Ejemplo n.º 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)
Ejemplo n.º 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
Ejemplo n.º 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"]
Ejemplo n.º 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)
Ejemplo n.º 19
0
Archivo: photos.py Proyecto: yhn112/FPH
def getAmount(gid):
	'''Возвращает количество фотографий в группе в целом или в альбоме.'''
	if gid[0]=='-': gid=gid[1:]
	return int(api.call("photos.getAll", {'owner_id':'-'+gid, 'count': '1'})[0])
Ejemplo n.º 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')
Ejemplo n.º 21
0
 def student_events_category(self, categoryId, titleOnly=False, auth=True):
     params = {'CategoryID': categoryId, 'TitleOnly': titleOnly}
     return api.call('StudentEvents_Category', params, auth)
Ejemplo n.º 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)
Ejemplo n.º 23
0
 def student_events_committee(self, committeeId, titleOnly=False, auth=True):
     params = {'CommitteeID': committeeId, 'TitleOnly': titleOnly}
     return api.call('StudentEvents_Committee', params, auth)
Ejemplo n.º 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)
Ejemplo n.º 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')
Ejemplo n.º 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)
Ejemplo n.º 27
0
 def student_events(self, titleOnly=False, auth=True):
     params = {'TitleOnly': titleOnly}
     return api.call('StudentEvents', params, auth)
Ejemplo n.º 28
0
 def lib_ereserves_files(self, folderId, auth=True):
     params = {'FolderID': folderId}
     return api.call('LibEreserveFiles', params, auth)
Ejemplo n.º 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)
Ejemplo n.º 30
0
 def useremail_get(self):
     params = {'APIKey': api.apiKey, 'Token': api.authToken}
     return api.call('UserEmail_Get', params)
Ejemplo n.º 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)
Ejemplo n.º 32
0
 def username_get(self):
     params = {'APIKey': api.apiKey, 'Token': api.authToken}
     return api.call('UserName_Get', params)
Ejemplo n.º 33
0
 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)