Renamed factories to use snake_case on functions
authorThierry Florac <thierry.florac@onf.fr>
Wed, 28 Mar 2018 15:47:15 +0200
changeset 58 268e1d5eed87
parent 57 09b75abeacd2
child 59 a80821967d4f
Renamed factories to use snake_case on functions
src/pyams_content_es/component/extfile.py
src/pyams_content_es/component/gallery.py
src/pyams_content_es/component/paragraph.py
src/pyams_content_es/component/theme.py
src/pyams_content_es/component/workflow.py
src/pyams_content_es/document.py
--- a/src/pyams_content_es/component/extfile.py	Wed Mar 28 15:28:40 2018 +0200
+++ b/src/pyams_content_es/component/extfile.py	Wed Mar 28 15:47:15 2018 +0200
@@ -27,7 +27,7 @@
 
 
 @adapter_config(name='extfile', context=IParagraphContainerTarget, provides=IDocumentIndexInfo)
-def ParagraphContainerTargetExtFileIndexInfo(context):
+def paragraph_container_target_extfile_index_info(context):
     """External files index info"""
     extfiles = []
     attachments = []
--- a/src/pyams_content_es/component/gallery.py	Wed Mar 28 15:28:40 2018 +0200
+++ b/src/pyams_content_es/component/gallery.py	Wed Mar 28 15:47:15 2018 +0200
@@ -24,7 +24,7 @@
 
 
 @adapter_config(context=IGallery, provides=IDocumentIndexInfo)
-def GalleryIndexInfo(gallery):
+def gallery_index_info(gallery):
     """Gallery index info"""
     info = {}
     for lang, title in gallery.title.items():
@@ -57,7 +57,7 @@
 
 
 @adapter_config(name='gallery', context=IGalleryTarget, provides=IDocumentIndexInfo)
-def GalleryTargetIndexInfo(content):
+def gallery_target_index_info(content):
     """Gallery container index info"""
     body = {}
     gallery = IGallery(content)
--- a/src/pyams_content_es/component/paragraph.py	Wed Mar 28 15:28:40 2018 +0200
+++ b/src/pyams_content_es/component/paragraph.py	Wed Mar 28 15:47:15 2018 +0200
@@ -39,7 +39,7 @@
 
 
 @adapter_config(name='body', context=IParagraphContainerTarget, provides=IDocumentIndexInfo)
-def ParagraphContainerTargetIndexInfo(content):
+def paragraph_container_target_index_info(content):
     """Paragraph container index info"""
     body = {}
     for paragraph in IParagraphContainer(content).values():
@@ -54,7 +54,7 @@
 
 
 @adapter_config(context=IBaseParagraph, provides=IDocumentIndexInfo)
-def BaseParagraphIndexInfo(paragraph):
+def base_paragraph_index_info(paragraph):
     """Base paragraph index info"""
     info = {}
     for lang, title in (getattr(paragraph, 'title', {}) or {}).items():
@@ -64,7 +64,7 @@
 
 
 @adapter_config(context=IHeaderParagraph, provides=IDocumentIndexInfo)
-def HeaderParagraphIndexInfo(paragraph):
+def header_paragraph_index_info(paragraph):
     """Header paragraph index info"""
     info = {}
     for lang, header in (getattr(paragraph, 'header', {}) or {}).items():
@@ -74,7 +74,7 @@
 
 
 @adapter_config(context=IHTMLParagraph, provides=IDocumentIndexInfo)
-def HTMLParagraphIndexInfo(paragraph):
+def html_paragraph_index_info(paragraph):
     """Rich text paragraph index info"""
     info = {}
     for lang, title in (getattr(paragraph, 'title', {}) or {}).items():
@@ -89,7 +89,7 @@
 
 
 @adapter_config(context=IIllustrationParagraph, provides=IDocumentIndexInfo)
-def IllustrationIndexInfo(paragraph):
+def illustration_index_info(paragraph):
     """Illustration index info"""
     info = {}
     for lang, title in (getattr(paragraph, 'title', {}) or {}).items():
@@ -104,7 +104,7 @@
 
 
 @adapter_config(context=IGalleryParagraph, provides=IDocumentIndexInfo)
-def GalleryParagraphIndexInfo(paragraph):
+def gallery_paragraph_index_info(paragraph):
     """Gallery paragraph index info"""
     info = {}
     for lang, title in (getattr(paragraph, 'title', {}) or {}).items():
@@ -121,7 +121,7 @@
 
 
 @adapter_config(context=IVideoParagraph, provides=IDocumentIndexInfo)
-def VideoParagraphIndexInfo(paragraph):
+def video_paragraph_index_info(paragraph):
     """Video paragraph index info"""
     info = {}
     manager = get_parent(paragraph, II18nManager)
@@ -144,7 +144,7 @@
 
 
 @adapter_config(context=IExternalVideoParagraph, provides=IDocumentIndexInfo)
-def ExternalVideoParagraphIndexInfo(paragraph):
+def external_video_paragraph_index_info(paragraph):
     """External video paragraph index info"""
     info = {}
     manager = get_parent(paragraph, II18nManager)
@@ -167,7 +167,7 @@
 
 
 @adapter_config(context=IImageMapParagraph, provides=IDocumentIndexInfo)
-def ImagemapParagraphIndexInfo(paragraph):
+def imagemap_paragraph_index_info(paragraph):
     """Image map paragraph index info"""
     info = {}
     for lang, title in (getattr(paragraph, 'title', {}) or {}).items():
@@ -177,7 +177,7 @@
 
 
 @adapter_config(context=IContactParagraph, provides=IDocumentIndexInfo)
-def ContactParagraphIndexInfo(paragraph):
+def contact_paragraph_index_info(paragraph):
     """Contact paragraph index info"""
     info = {}
     manager = get_parent(paragraph, II18nManager)
@@ -196,7 +196,7 @@
 
 
 @adapter_config(context=IKeypointsParagraph, provides=IDocumentIndexInfo)
-def KeypointsParagraphIndexInfo(paragraph):
+def keypoints_paragraph_index_info(paragraph):
     """Key points paragraph index info"""
     info = {}
     for lang, body in (getattr(paragraph, 'body', {}) or {}).items():
@@ -206,7 +206,7 @@
 
 
 @adapter_config(context=IFrameParagraph, provides=IDocumentIndexInfo)
-def FrameParagraphIndexInfo(paragraph):
+def frame_paragraph_index_info(paragraph):
     """Frame paragraph index info"""
     info = {}
     for lang, title in (getattr(paragraph, 'title', {}) or {}).items():
@@ -220,7 +220,7 @@
 
 
 @adapter_config(context=IVerbatimParagraph, provides=IDocumentIndexInfo)
-def VerbatimParagraphIndexInfo(paragraph):
+def verbatim_paragraph_index_info(paragraph):
     """Verbatim paragraph index info"""
     info = {}
     manager = get_parent(paragraph, II18nManager)
@@ -239,7 +239,7 @@
 
 
 @adapter_config(context=IRawParagraph, provides=IDocumentIndexInfo)
-def RawParagraphIndexInfo(paragraph):
+def raw_paragraph_index_info(paragraph):
     """Raw paragraph index info"""
     info = {}
     for lang, title in (getattr(paragraph, 'title', {}) or {}).items():
--- a/src/pyams_content_es/component/theme.py	Wed Mar 28 15:28:40 2018 +0200
+++ b/src/pyams_content_es/component/theme.py	Wed Mar 28 15:47:15 2018 +0200
@@ -27,7 +27,7 @@
 
 
 @adapter_config(name='themes', context=IThemesTarget, provides=IDocumentIndexInfo)
-def ThemesTargetIndexInfo(content):
+def themes_target_index_info(content):
     """Themes target index info"""
     terms = []
     parents = []
--- a/src/pyams_content_es/component/workflow.py	Wed Mar 28 15:28:40 2018 +0200
+++ b/src/pyams_content_es/component/workflow.py	Wed Mar 28 15:47:15 2018 +0200
@@ -26,7 +26,7 @@
 
 
 @adapter_config(name='workflow', context=IWorkflowPublicationSupport, provides=IDocumentIndexInfo)
-def WorkflowManagedContentIndexInfo(content):
+def workflow_managed_content_index_info(content):
     """Workflow managed content index info"""
     dc_info = IZopeDublinCore(content)
     workflow_state = IWorkflowState(content)
--- a/src/pyams_content_es/document.py	Wed Mar 28 15:28:40 2018 +0200
+++ b/src/pyams_content_es/document.py	Wed Mar 28 15:47:15 2018 +0200
@@ -62,7 +62,7 @@
 
 
 @adapter_config(context=IWfSharedContent, provides=IDocumentIndexInfo)
-def WfSharedContentIndexInfo(content):
+def wf_shared_content_index_info(content):
     return ESMapping(analyzer='content',
                      properties=ESMapping(ESField('internal_id'),
                                           ESField('content_type'),