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


Python ConfigParser.interactive方法代码示例

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


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

示例1: load_config

# 需要导入模块: from ConfigParser import ConfigParser [as 别名]
# 或者: from ConfigParser.ConfigParser import interactive [as 别名]
def load_config():
    opts, args = parse_args()

    config = ConfigParser({'log.level': "DEBUG", 'log.file': None})
    config.read(os.path.expanduser(opts.config))
    config.interactive = opts.interactive
    validate_config(config)

    return config
开发者ID:Liudvikas,项目名称:bugwarrior,代码行数:11,代码来源:config.py

示例2: load_config

# 需要导入模块: from ConfigParser import ConfigParser [as 别名]
# 或者: from ConfigParser.ConfigParser import interactive [as 别名]
def load_config(main_section):
    config = ConfigParser({'log.level': "DEBUG", 'log.file': None})
    path = None
    first_path = BaseDirectory.load_first_config('bugwarrior')
    if first_path is not None:
        path = os.path.join(first_path, 'bugwarriorrc')
    old_path = os.path.expanduser("~/.bugwarriorrc")
    if path is None or not os.path.exists(path):
        if os.path.exists(old_path):
            path = old_path
        else:
            path = os.path.join(BaseDirectory.save_config_path('bugwarrior'), 'bugwarriorrc')
    config.readfp(
        codecs.open(
            path,
            "r",
            "utf-8",
        )
    )
    config.interactive = False  # TODO: make this a command-line option
    validate_config(config, main_section)

    return config
开发者ID:b-boogaard,项目名称:bugwarrior,代码行数:25,代码来源:config.py


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