本文整理汇总了Python中configuration.Configuration.load_defaults方法的典型用法代码示例。如果您正苦于以下问题:Python Configuration.load_defaults方法的具体用法?Python Configuration.load_defaults怎么用?Python Configuration.load_defaults使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类configuration.Configuration
的用法示例。
在下文中一共展示了Configuration.load_defaults方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: show_form
# 需要导入模块: from configuration import Configuration [as 别名]
# 或者: from configuration.Configuration import load_defaults [as 别名]
def show_form(self):
'''
Displays this form, blocking until the user closes it. When it is closed,
this method will return a Configuration object containing the settings
that this dialog was displaying when it was closed (these settings were
also just saved on the filesystem, so they are also the settings that
this dialog will display the next time it is opened.)
If the user clicks 'Cancel' then this method will simply return null.
'''
log.debug("opened the settings dialog.")
defaults = Configuration()
defaults.load_defaults()
self.__set_configuration(defaults)
self.__switch_to_best_tab()
dialogAnswer = self.ShowDialog() # blocks
if dialogAnswer == DialogResult.OK:
config = self.__get_configuration()
config.save_defaults()
log.debug("closed the settings dialog.")
else:
config = None
log.debug("cancelled the settings dialog.")
return config