本文整理汇总了Python中config.Configuration.set方法的典型用法代码示例。如果您正苦于以下问题:Python Configuration.set方法的具体用法?Python Configuration.set怎么用?Python Configuration.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类config.Configuration
的用法示例。
在下文中一共展示了Configuration.set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from config import Configuration [as 别名]
# 或者: from config.Configuration import set [as 别名]
def post(self):
"""post; Save the config and show the page again"""
config = Configuration()
config.set('WELCOME_MAIL_SENDER', self.request.get('welcome_sender'))
config.set('WELCOME_MAIL_SUBJECT', self.request.get('welcome_subject'))
config.set('NOTIFICATION_MAIL_RECIPIENTS', self.request.get('notification_recipients'))
config.set('NOTIFICATION_MAIL_SUBJECT', self.request.get('notification_subject'))
config.set('GIRO_ACCOUNT_NO', self.request.get('account_no'))
config.set('GIRO_SUBJECT', self.request.get('heading'))
config.set('GIRO_TEXT', self.request.get('body'))
config.set('GIRO_ADDRESS', self.request.get('address'))
config.set('WELCOME_MAIL_TEXT', self.request.get('welcome_body'))
config.set('GIRO_MESSAGE', self.request.get('giro_message'))
template = JINJA_ENVIRONMENT.get_template('templates/settings/detail.html')
data = { 'config': config }
self.response.write(template.render(data))
示例2: task_config_restore
# 需要导入模块: from config import Configuration [as 别名]
# 或者: from config.Configuration import set [as 别名]
def task_config_restore(settings):
config = Configuration()
for setting in settings:
config.set(setting['name'], setting['value'])