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


Python sqla_plugin_base.read_config方法代碼示例

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


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

示例1: pytest_addoption

# 需要導入模塊: import sqla_plugin_base [as 別名]
# 或者: from sqla_plugin_base import read_config [as 別名]
def pytest_addoption(parser):
    group = parser.getgroup("sqlalchemy")

    def make_option(name, **kw):
        callback_ = kw.pop("callback", None)
        if callback_:
            class CallableAction(argparse.Action):
                def __call__(self, parser, namespace,
                             values, option_string=None):
                    callback_(option_string, values, parser)
            kw["action"] = CallableAction

        group.addoption(name, **kw)

    plugin_base.setup_options(make_option)
    plugin_base.read_config() 
開發者ID:jpush,項目名稱:jbox,代碼行數:18,代碼來源:pytestplugin.py

示例2: options

# 需要導入模塊: import sqla_plugin_base [as 別名]
# 或者: from sqla_plugin_base import read_config [as 別名]
def options(self, parser, env=os.environ):
        Plugin.options(self, parser, env)
        opt = parser.add_option

        def make_option(name, **kw):
            callback_ = kw.pop("callback", None)
            if callback_:
                def wrap_(option, opt_str, value, parser):
                    callback_(opt_str, value, parser)
                kw["callback"] = wrap_
            opt(name, **kw)

        plugin_base.setup_options(make_option)
        plugin_base.read_config() 
開發者ID:jpush,項目名稱:jbox,代碼行數:16,代碼來源:noseplugin.py

示例3: options

# 需要導入模塊: import sqla_plugin_base [as 別名]
# 或者: from sqla_plugin_base import read_config [as 別名]
def options(self, parser, env=os.environ):
        Plugin.options(self, parser, env)
        opt = parser.add_option

        def make_option(name, **kw):
            callback_ = kw.pop("callback", None) or kw.pop("zeroarg_callback", None)
            if callback_:
                def wrap_(option, opt_str, value, parser):
                    callback_(opt_str, value, parser)
                kw["callback"] = wrap_
            opt(name, **kw)

        plugin_base.setup_options(make_option)
        plugin_base.read_config() 
開發者ID:yfauser,項目名稱:planespotter,代碼行數:16,代碼來源:noseplugin.py

示例4: pytest_addoption

# 需要導入模塊: import sqla_plugin_base [as 別名]
# 或者: from sqla_plugin_base import read_config [as 別名]
def pytest_addoption(parser):
    group = parser.getgroup("sqlalchemy")

    def make_option(name, **kw):
        callback_ = kw.pop("callback", None)
        if callback_:
            class CallableAction(argparse.Action):
                def __call__(self, parser, namespace,
                             values, option_string=None):
                    callback_(option_string, values, parser)
            kw["action"] = CallableAction

        zeroarg_callback = kw.pop("zeroarg_callback", None)
        if zeroarg_callback:
            class CallableAction(argparse.Action):
                def __init__(self, option_strings,
                             dest, default=False,
                             required=False, help=None):
                        super(CallableAction, self).__init__(
                            option_strings=option_strings,
                            dest=dest,
                            nargs=0,
                            const=True,
                            default=default,
                            required=required,
                            help=help)

                def __call__(self, parser, namespace,
                             values, option_string=None):
                    zeroarg_callback(option_string, values, parser)
            kw["action"] = CallableAction

        group.addoption(name, **kw)

    plugin_base.setup_options(make_option)
    plugin_base.read_config() 
開發者ID:yfauser,項目名稱:planespotter,代碼行數:38,代碼來源:pytestplugin.py

示例5: pytest_addoption

# 需要導入模塊: import sqla_plugin_base [as 別名]
# 或者: from sqla_plugin_base import read_config [as 別名]
def pytest_addoption(parser):
    group = parser.getgroup("sqlalchemy")

    def make_option(name, **kw):
        callback_ = kw.pop("callback", None)
        if callback_:

            class CallableAction(argparse.Action):
                def __call__(
                    self, parser, namespace, values, option_string=None
                ):
                    callback_(option_string, values, parser)

            kw["action"] = CallableAction

        zeroarg_callback = kw.pop("zeroarg_callback", None)
        if zeroarg_callback:

            class CallableAction(argparse.Action):
                def __init__(
                    self,
                    option_strings,
                    dest,
                    default=False,
                    required=False,
                    help=None,  # noqa
                ):
                    super(CallableAction, self).__init__(
                        option_strings=option_strings,
                        dest=dest,
                        nargs=0,
                        const=True,
                        default=default,
                        required=required,
                        help=help,
                    )

                def __call__(
                    self, parser, namespace, values, option_string=None
                ):
                    zeroarg_callback(option_string, values, parser)

            kw["action"] = CallableAction

        group.addoption(name, **kw)

    plugin_base.setup_options(make_option)
    plugin_base.read_config() 
開發者ID:sqlalchemy,項目名稱:sqlalchemy,代碼行數:50,代碼來源:pytestplugin.py


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