本文整理汇总了Python中config.Configuration方法的典型用法代码示例。如果您正苦于以下问题:Python config.Configuration方法的具体用法?Python config.Configuration怎么用?Python config.Configuration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在模块config的用法示例。
在下文中一共展示了config.Configuration方法的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: change_wallpaper
点赞 6
# 需要导入模块: import config [as 别名]
# 或者: from config import Configuration [as 别名]
def change_wallpaper():
config = Configuration()
source = config.get('source')
random = config.get('random')
if random:
modules = get_modules()
selected = randrange(len(modules))
source = modules[selected]
module = importlib.import_module(source)
daily = module.get_daily()
if daily.resolve_url():
if download(daily.get_url()):
if daily.get_title():
title = '{}: {}'.format(daily.get_name(), daily.get_title())
else:
title = daily.get_name()
caption = daily.get_caption()
credit = daily.get_credit()
notify_photo_caption(title, caption, credit)
set_background(comun.POTD)
开发者ID:atareao,项目名称:daily-wallpaper,代码行数:22,
示例2: post
点赞 6
# 需要导入模块: import config [as 别名]
# 或者: from config import Configuration [as 别名]
def post(self, request, *args, **kwargs):
"""Serves POST requests, updating the repo's configuration."""
del request, args, kwargs # Unused.
self.enforce_xsrf(self.ACTION_ID)
validation_response = self._validate_input()
if validation_response:
return validation_response
self._set_language_config()
self._set_activation_config()
self._set_data_retention_config()
self._set_keywords_config()
self._set_forms_config()
self._set_map_config()
self._set_timezone_config()
self._set_api_access_control_config()
self._set_zero_rating_config()
self._set_spam_config()
# Reload the config since we just changed it.
self.env.config = config.Configuration(self.env.repo)
return self._render_form()
开发者ID:google,项目名称:personfinder,代码行数:22,
示例3: post
点赞 6
# 需要导入模块: import config [as 别名]
# 或者: from config import Configuration [as 别名]
def post(self, request, *args, **kwargs):
"""Serves POST requests, updating the repo's configuration."""
del request, args, kwargs # Unused.
self.enforce_xsrf(self.ACTION_ID)
validation_response = self._validate_input()
if validation_response:
return validation_response
self._set_sms_config()
self._set_repo_alias_config()
self._set_site_info_config()
self._set_recaptcha_config()
self._set_ganalytics_config()
self._set_gmaps_config()
self._set_gtranslate_config()
self._set_notification_config()
# Reload the config since we just changed it.
self.env.config = config.Configuration('*')
return self._render_form()
开发者ID:google,项目名称:personfinder,代码行数:20,
示例4: test_edit_activation_status_config
点赞 6
# 需要导入模块: import config [as 别名]
# 或者: from config import Configuration [as 别名]
def test_edit_activation_status_config(self):
# Set the time to an hour past the original update_date.
utils.set_utcnow_for_test(datetime.datetime(2019, 5, 10, 12, 15, 0))
self.login_as_superadmin()
self._post_with_params(
activation_status=str(model.Repo.ActivationStatus.DEACTIVATED),
deactivation_message_html='it is deactivated')
repo = model.Repo.get_by_key_name('haiti')
self.assertEqual(
repo.activation_status, model.Repo.ActivationStatus.DEACTIVATED)
repo_conf = config.Configuration('haiti')
self.assertEqual(
repo_conf.deactivation_message_html, 'it is deactivated')
self.assertEqual(
repo_conf.updated_date,
utils.get_timestamp(datetime.datetime(2019, 5, 10, 12, 15, 0)))
开发者ID:google,项目名称:personfinder,代码行数:18,
示例5: test_edit_forms_config
点赞 6
# 需要导入模块: import config [as 别名]
# 或者: from config import Configuration [as 别名]
def test_edit_forms_config(self):
self.login_as_superadmin()
self._post_with_params(
use_family_name='true',
family_name_first='true',
use_alternate_names='true',
use_postal_code='true',
allow_believed_dead_via_ui='true',
min_query_wo