当前位置: 首页>>代码示例>>Python>>正文


Python DatafeedFMSAPI.getEventList方法代码示例

本文整理汇总了Python中datafeeds.datafeed_fms_api.DatafeedFMSAPI.getEventList方法的典型用法代码示例。如果您正苦于以下问题:Python DatafeedFMSAPI.getEventList方法的具体用法?Python DatafeedFMSAPI.getEventList怎么用?Python DatafeedFMSAPI.getEventList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在datafeeds.datafeed_fms_api.DatafeedFMSAPI的用法示例。


在下文中一共展示了DatafeedFMSAPI.getEventList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get

# 需要导入模块: from datafeeds.datafeed_fms_api import DatafeedFMSAPI [as 别名]
# 或者: from datafeeds.datafeed_fms_api.DatafeedFMSAPI import getEventList [as 别名]
    def get(self, year):
        df = DatafeedFMSAPI('v2.0')
        df2 = DatafeedFIRSTElasticSearch()

        fmsapi_events, fmsapi_districts = df.getEventList(year)
        elasticsearch_events = df2.getEventList(year)
        merged_events = EventManipulator.mergeModels(fmsapi_events, elasticsearch_events)
        events = EventManipulator.createOrUpdate(merged_events)
        districts = DistrictManipulator.createOrUpdate(fmsapi_districts)

        # Fetch event details for each event
        for event in events:
            taskqueue.add(
                queue_name='datafeed',
                target='backend-tasks',
                url='/backend-tasks/get/event_details/'+event.key_name,
                method='GET'
            )

        template_values = {
            "events": events,
            "districts": districts,
        }

        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/fms_event_list_get.html')
            self.response.out.write(template.render(path, template_values))
开发者ID:CarlColglazier,项目名称:the-blue-alliance,代码行数:29,代码来源:datafeed_controller.py

示例2: get

# 需要导入模块: from datafeeds.datafeed_fms_api import DatafeedFMSAPI [as 别名]
# 或者: from datafeeds.datafeed_fms_api.DatafeedFMSAPI import getEventList [as 别名]
    def get(self, year):
        df = DatafeedFMSAPI('v2.0')

        new_events = EventManipulator.createOrUpdate(df.getEventList(year))

        # Fetch EventTeams for each event
        for event in new_events:
            taskqueue.add(
                queue_name='fms-api',
                url='/tasks/get/fmsapi_eventteams/'+event.key_name,
                method='GET'
            )

        template_values = {
            "events": new_events
        }

        path = os.path.join(os.path.dirname(__file__), '../templates/datafeeds/fms_event_list_get.html')
        self.response.out.write(template.render(path, template_values))
开发者ID:arilotter,项目名称:the-blue-alliance,代码行数:21,代码来源:datafeed_controller.py

示例3: get

# 需要导入模块: from datafeeds.datafeed_fms_api import DatafeedFMSAPI [as 别名]
# 或者: from datafeeds.datafeed_fms_api.DatafeedFMSAPI import getEventList [as 别名]
    def get(self, year):
        df = DatafeedFMSAPI('v2.0')
        df2 = DatafeedFIRSTElasticSearch()

        merged_events = EventManipulator.mergeModels(df.getEventList(year), df2.getEventList(year))
        events = EventManipulator.createOrUpdate(merged_events)

        # Fetch event details for each event
        for event in events:
            taskqueue.add(
                queue_name='datafeed',
                url='/backend-tasks/get/event_details/'+event.key_name,
                method='GET'
            )

        template_values = {
            "events": events
        }

        path = os.path.join(os.path.dirname(__file__), '../templates/datafeeds/fms_event_list_get.html')
        self.response.out.write(template.render(path, template_values))
开发者ID:cmlicata,项目名称:the-blue-alliance,代码行数:23,代码来源:datafeed_controller.py


注:本文中的datafeeds.datafeed_fms_api.DatafeedFMSAPI.getEventList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。