當前位置: 首頁>>代碼示例>>Python>>正文


Python options.group_dict方法代碼示例

本文整理匯總了Python中tornado.options.options.group_dict方法的典型用法代碼示例。如果您正苦於以下問題:Python options.group_dict方法的具體用法?Python options.group_dict怎麽用?Python options.group_dict使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在tornado.options.options的用法示例。


在下文中一共展示了options.group_dict方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: main

# 需要導入模塊: from tornado.options import options [as 別名]
# 或者: from tornado.options.options import group_dict [as 別名]
def main():
    parse_command_line(final=False)
    parse_config_file(options.config_file)

    app = Application(
        [
            ('/', MainHandler),
            ('/login', LoginHandler),
            ('/logout', LogoutHandler),
        ],
        login_url='/login',
        **options.group_dict('application'))
    app.listen(options.port)

    logging.info('Listening on http://localhost:%d' % options.port)
    IOLoop.current().start() 
開發者ID:tao12345666333,項目名稱:tornado-zh,代碼行數:18,代碼來源:twitterdemo.py

示例2: group_dict

# 需要導入模塊: from tornado.options import options [as 別名]
# 或者: from tornado.options.options import group_dict [as 別名]
def group_dict(self, group):
        """The names and values of options in a group.

        Useful for copying options into Application settings::

            from tornado.options import define, parse_command_line, options

            define('template_path', group='application')
            define('static_path', group='application')

            parse_command_line()

            application = Application(
                handlers, **options.group_dict('application'))

        .. versionadded:: 3.1
        """
        return dict(
            (opt.name, opt.value()) for name, opt in self._options.items()
            if not group or group == opt.group_name) 
開發者ID:tao12345666333,項目名稱:tornado-zh,代碼行數:22,代碼來源:options.py

示例3: group_dict

# 需要導入模塊: from tornado.options import options [as 別名]
# 或者: from tornado.options.options import group_dict [as 別名]
def group_dict(self, group: str) -> Dict[str, Any]:
        """The names and values of options in a group.

        Useful for copying options into Application settings::

            from tornado.options import define, parse_command_line, options

            define('template_path', group='application')
            define('static_path', group='application')

            parse_command_line()

            application = Application(
                handlers, **options.group_dict('application'))

        .. versionadded:: 3.1
        """
        return dict(
            (opt.name, opt.value())
            for name, opt in self._options.items()
            if not group or group == opt.group_name
        ) 
開發者ID:opendevops-cn,項目名稱:opendevops,代碼行數:24,代碼來源:options.py

示例4: group_dict

# 需要導入模塊: from tornado.options import options [as 別名]
# 或者: from tornado.options.options import group_dict [as 別名]
def group_dict(self, group):
        """The names and values of options in a group.

        Useful for copying options into Application settings::

            from tornado.options import define, parse_command_line, options

            define('template_path', group='application')
            define('static_path', group='application')

            parse_command_line()

            application = Application(
                handlers, **options.group_dict('application'))

        .. versionadded:: 3.1
        """
        return dict(
            (name, opt.value()) for name, opt in self._options.items()
            if not group or group == opt.group_name) 
開發者ID:viewfinderco,項目名稱:viewfinder,代碼行數:22,代碼來源:options.py


注:本文中的tornado.options.options.group_dict方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。