本文整理汇总了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
示例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