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


Python Schedule.from_directory方法代码示例

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


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

示例1: create_app

# 需要导入模块: from schedule import Schedule [as 别名]
# 或者: from schedule.Schedule import from_directory [as 别名]
def create_app(schedule_dir, template_dir):
    schedule = Schedule.from_directory(schedule_dir)
    resources = {'schedule': schedule,
                 'name_index': fm,
                 'LEGS': ALL_LEGS}
    subroutes = [('/', home, 'station_list.html'),
                 ('/<path:station_name>', get_stops, 'stop_times.html'),
                 ('/favicon.ico', not_found)]

    mako_response = MakoRenderFactory(template_dir)
    cc_mw = HTTPCacheMiddleware(max_age=30, must_revalidate=True)
    middlewares = [GzipMiddleware(), ProfilerMiddleware(), SimpleContextProcessor(LEGS=ALL_LEGS), cc_mw]
    subapp = Application(subroutes, resources, mako_response, middlewares,
                         error_handlers=err_handlers)

    routes = [('/', subapp), ('/v2/', subapp)]
    app = Application(routes, error_handlers=err_handlers)
    return app
开发者ID:mahmoud,项目名称:etavta-openshift,代码行数:20,代码来源:etavta_wsgi.py

示例2: create_app

# 需要导入模块: from schedule import Schedule [as 别名]
# 或者: from schedule.Schedule import from_directory [as 别名]
def create_app(schedule_dir, template_dir):
    schedule = Schedule.from_directory(schedule_dir)
    resources = {"schedule": schedule, "name_index": NAME_MATCHER, "LEGS": ALL_LEGS}
    subroutes = [
        ("/", home, "station_list.html"),
        ("/favicon.ico", lambda: NotFound()),
        ("/<station_name>", get_stops, "stop_times.html"),
    ]

    mako_factory = MakoRenderFactory(template_dir)
    cc_mw = HTTPCacheMiddleware(max_age=30, must_revalidate=True)
    middlewares = [
        SimpleProfileMiddleware(),
        GetParamMiddleware(["sdate", "stime"]),
        SimpleContextProcessor(LEGS=ALL_LEGS),
        cc_mw,
    ]
    app = Application(subroutes, resources, mako_factory, middlewares)

    # routes = [('/', app), ('/v2/', app)]
    # app = Application(routes)
    return app
开发者ID:mahmoud,项目名称:etavta,代码行数:24,代码来源:wsgi.py

示例3: _check_integrity

# 需要导入模块: from schedule import Schedule [as 别名]
# 或者: from schedule.Schedule import from_directory [as 别名]
 def _check_integrity(self):
     try:
         self._schedule = Schedule.from_directory(target_dir_path)
     except Exception as e:
         # something's bork'd, add it to the report
         pass
开发者ID:mahmoud,项目名称:etavta-openshift,代码行数:8,代码来源:fetch.py


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