Renamed factories to use snake_case on functions
authorThierry Florac <thierry.florac@onf.fr>
Wed, 28 Mar 2018 16:03:21 +0200
changeset 114 d00688ea8124
parent 113 e8872cb2fb79
child 115 12c5513ee71a
Renamed factories to use snake_case on functions
src/pyams_security/notification.py
src/pyams_security/plugin/social.py
src/pyams_security/plugin/userfolder.py
src/pyams_security/profile.py
src/pyams_security/security.py
--- a/src/pyams_security/notification.py	Wed Mar 28 15:36:10 2018 +0200
+++ b/src/pyams_security/notification.py	Wed Mar 28 16:03:21 2018 +0200
@@ -47,7 +47,7 @@
 
 
 @adapter_config(context=ISecurityManager, provides=INotificationSettings)
-def SecurityNotificationSettingsFactory(context):
+def security_notification_settings_factory(context):
     """Security manager notifications factory adapter"""
     annotations = IAnnotations(context)
     settings = annotations.get(NOTIFICATIONS_KEY)
--- a/src/pyams_security/plugin/social.py	Wed Mar 28 15:36:10 2018 +0200
+++ b/src/pyams_security/plugin/social.py	Wed Mar 28 16:03:21 2018 +0200
@@ -80,7 +80,7 @@
 
 
 @adapter_config(context=ISocialUser, provides=IPrincipalInfo)
-def SocialUserPrincipalInfoAdapter(user):
+def social_user_principal_info_adapter(user):
     """Social user principal info adapter"""
     return PrincipalInfo(id="{0}:{1}".format(user.__parent__.prefix, user.user_id),
                          title=user.name)
@@ -377,7 +377,7 @@
 
 
 @adapter_config(context=ISecurityManager, provides=ISocialLoginConfiguration)
-def SocialLoginConfigurationAdapter(context):
+def social_login_configuration_adapter(context):
     """Social login configuration adapter"""
     annotations = IAnnotations(context)
     configuration = annotations.get(SOCIAL_LOGIN_CONFIGURATION_KEY)
--- a/src/pyams_security/plugin/userfolder.py	Wed Mar 28 15:36:10 2018 +0200
+++ b/src/pyams_security/plugin/userfolder.py	Wed Mar 28 16:03:21 2018 +0200
@@ -126,7 +126,7 @@
 
 
 @adapter_config(context=ILocalUser, provides=IPrincipalInfo)
-def UserPrincipalInfoAdapter(user):
+def user_principal_info_adapter(user):
     """User principal info adapter"""
     return PrincipalInfo(id="{prefix}:{login}".format(prefix=user.__parent__.prefix,
                                                       login=user.login),
--- a/src/pyams_security/profile.py	Wed Mar 28 15:36:10 2018 +0200
+++ b/src/pyams_security/profile.py	Wed Mar 28 16:03:21 2018 +0200
@@ -54,13 +54,13 @@
 
 
 @adapter_config(context=Interface, provides=IPublicProfile)
-def PublicProfileFactory(context):
+def public_profile_factory(context):
     request = check_request()
     return IPublicProfile(request.principal)
 
 
 @adapter_config(context=IPrincipalInfo, provides=IPublicProfile)
-def PrincipalPublicProfileFactory(principal):
+def principal_public_profile_factory(principal):
     """Principal public profile factory adapter"""
     annotations = IAnnotations(principal)
     profile = annotations.get(PUBLIC_PROFILE_KEY)
--- a/src/pyams_security/security.py	Wed Mar 28 15:36:10 2018 +0200
+++ b/src/pyams_security/security.py	Wed Mar 28 16:03:21 2018 +0200
@@ -200,7 +200,7 @@
 
 
 @adapter_config(context=IDefaultProtectionPolicy, provides=IRoleProtectedObject)
-def ProtectedObjectFactory(context):
+def protected_object_factory(context):
     """Default protected object factory"""
     annotations = IAnnotations(context)
     protection = annotations.get(ROLES_ANNOTATIONS_KEY)