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


Python Application.git方法代码示例

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


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

示例1: make_app

# 需要导入模块: from tornado.web import Application [as 别名]
# 或者: from tornado.web.Application import git [as 别名]
def make_app(config=None):
    root = path.dirname(__file__)
    static_path = path.join(root, 'static')
    template_path = path.join(root, 'template')

    app_config = dict(static_path=static_path,
                      template_path=template_path)

    define('port', default='8080', type=int)
    define('address', default='localhost', type=str)
    define('testing', default=False, type=bool)
    define('repo', default=None, type=str)
    define('username', default=None, type=str)
    define('pwdhash', default=None, type=str)
    define('autosave', default=False, type=bool)
    define('prefix', default='/', type=str)
    define('autosave_interval', default='5', type=int)
    define('wysiwyg', default=False, type=bool)
    define('theme', default=None, type=str)

    if config is not None:
        # This should only ever be used for testing
        parse_config_file(config)
    else:
        parse_config_file(config_path.web)

    if options.testing:
        app_config.update(debug=True)

    if not options.prefix.endswith('/'):
        options.prefix += '/'
    urls = get_urls(options.prefix)

    app_config.update(
      login_url=options.prefix + 'login',
      static_url_prefix=options.prefix + 'static/')

    server = Application(urls, **app_config)
    server.settings = AttrDict(server.settings)
    server.settings.repo = options.repo
    server.settings.username = options.username
    server.settings.pwdhash = options.pwdhash
    server.settings.session = _rand_str()
    server.settings.config_path = config_path
    server.settings.autosave = options.autosave
    server.settings.prefix = options.prefix
    server.settings.autosave_interval = options.autosave_interval
    server.settings.wysiwyg = options.wysiwyg
    server.settings.theme = options.theme

    server.git = git.bake(_cwd=server.settings.repo)

    return server
开发者ID:BBBSnowball,项目名称:magpie,代码行数:55,代码来源:server.py

示例2: make_app

# 需要导入模块: from tornado.web import Application [as 别名]
# 或者: from tornado.web.Application import git [as 别名]
def make_app(config=None):
    root = path.dirname(__file__)
    static_path = path.join(root, 'static')
    template_path = path.join(root, 'template')

    app_config = dict(static_path=static_path,
                      template_path=template_path,
                      login_url='/login')

    define('port', default='8080', type=int)
    define('address', default='localhost', type=str)
    define('testing', default=False, type=bool)
    define('repo', default=None, type=str)
    define('username', default=None, type=str)
    define('pwdhash', default=None, type=str)
    define('autosave', default=False, type=bool)

    if config is not None:
        # This should only ever be used for testing
        parse_config_file(config)
    else:
        parse_config_file(config_path.web)

    if options.testing:
        app_config.update(debug=True)

    server = Application(urls, **app_config)
    server.settings = AttrDict(server.settings)
    server.settings.repo = options.repo
    server.settings.username = options.username
    server.settings.pwdhash = options.pwdhash
    server.settings.session = _rand_str()
    server.settings.config_path = config_path
    server.settings.autosave = options.autosave

    server.git = git.bake(_cwd=server.settings.repo)

    return server
开发者ID:Erwyn,项目名称:magpie,代码行数:40,代码来源:server.py


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