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


Python Configuration.load_defaults方法代码示例

本文整理汇总了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
开发者ID:Blackbird88,项目名称:comic-vine-scraper,代码行数:27,代码来源:configform.py


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