本文整理汇总了Python中datafeeds.datafeed_fms_api.DatafeedFMSAPI.getEventAlliances方法的典型用法代码示例。如果您正苦于以下问题:Python DatafeedFMSAPI.getEventAlliances方法的具体用法?Python DatafeedFMSAPI.getEventAlliances怎么用?Python DatafeedFMSAPI.getEventAlliances使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类datafeeds.datafeed_fms_api.DatafeedFMSAPI
的用法示例。
在下文中一共展示了DatafeedFMSAPI.getEventAlliances方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from datafeeds.datafeed_fms_api import DatafeedFMSAPI [as 别名]
# 或者: from datafeeds.datafeed_fms_api.DatafeedFMSAPI import getEventAlliances [as 别名]
def get(self, event_key):
df = DatafeedFMSAPI('v2.0')
event = Event.get_by_id(event_key)
alliance_selections = df.getEventAlliances(event_key)
if alliance_selections and event.alliance_selections != alliance_selections:
event.alliance_selections_json = json.dumps(alliance_selections)
event._alliance_selections = None
event.dirty = True
EventManipulator.createOrUpdate(event)
template_values = {'alliance_selections': alliance_selections,
'event_name': event.key_name}
if 'X-Appengine-Taskname' not in self.request.headers: # Only write out if not in taskqueue
path = os.path.join(os.path.dirname(__file__), '../templates/datafeeds/usfirst_event_alliances_get.html')
self.response.out.write(template.render(path, template_values))
示例2: get
# 需要导入模块: from datafeeds.datafeed_fms_api import DatafeedFMSAPI [as 别名]
# 或者: from datafeeds.datafeed_fms_api.DatafeedFMSAPI import getEventAlliances [as 别名]
def get(self, event_key):
df = DatafeedFMSAPI('v2.0')
event = Event.get_by_id(event_key)
if event.event_type_enum == EventType.CMP_FINALS:
logging.info("Skipping Einstein alliance selections")
return
alliance_selections = df.getEventAlliances(event_key)
if alliance_selections and event.alliance_selections != alliance_selections:
event.alliance_selections_json = json.dumps(alliance_selections)
event._alliance_selections = None
event.dirty = True
EventManipulator.createOrUpdate(event)
template_values = {'alliance_selections': alliance_selections,
'event_name': event.key_name}
path = os.path.join(os.path.dirname(__file__), '../templates/datafeeds/usfirst_event_alliances_get.html')
self.response.out.write(template.render(path, template_values))