Version 0.1.12 0.1.12
authorThierry Florac <thierry.florac@onf.fr>
Thu, 28 Jun 2018 09:26:40 +0200
changeset 69 3bc0c516ed1a
parent 68 5e51a9ef1094
child 70 228b4b58536f
Version 0.1.12
buildout.cfg
docs/HISTORY.txt
setup.py
src/pyams_content_es.egg-info/PKG-INFO
src/pyams_content_es/component/paragraph.py
--- a/buildout.cfg	Thu Jun 28 09:22:22 2018 +0200
+++ b/buildout.cfg	Thu Jun 28 09:26:40 2018 +0200
@@ -84,4 +84,4 @@
 eggs = pyams_content_es [test]
 
 [versions]
-pyams_content_es = 0.1.11
+pyams_content_es = 0.1.12
--- a/docs/HISTORY.txt	Thu Jun 28 09:22:22 2018 +0200
+++ b/docs/HISTORY.txt	Thu Jun 28 09:26:40 2018 +0200
@@ -1,6 +1,11 @@
 History
 =======
 
+0.1.12
+------
+ - updated video paragraph index info
+ - added audio paragraph index info
+
 0.1.11
 ------
  - updated ES themes index values
--- a/setup.py	Thu Jun 28 09:22:22 2018 +0200
+++ b/setup.py	Thu Jun 28 09:26:40 2018 +0200
@@ -22,7 +22,7 @@
 README = os.path.join(DOCS, 'README.txt')
 HISTORY = os.path.join(DOCS, 'HISTORY.txt')
 
-version = '0.1.11'
+version = '0.1.12'
 long_description = open(README).read() + '\n\n' + open(HISTORY).read()
 
 tests_require = []
--- a/src/pyams_content_es.egg-info/PKG-INFO	Thu Jun 28 09:22:22 2018 +0200
+++ b/src/pyams_content_es.egg-info/PKG-INFO	Thu Jun 28 09:26:40 2018 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: pyams-content-es
-Version: 0.1.11
+Version: 0.1.12
 Summary: PyAMS content interfaces and classes for ElasticSearch indexation
 Home-page: http://hg.ztfy.org/pyams/pyams_content_es
 Author: Thierry Florac
@@ -24,6 +24,11 @@
         History
         =======
         
+        0.1.12
+        ------
+         - updated video paragraph index info
+         - added audio paragraph index info
+        
         0.1.11
         ------
          - updated ES themes index values
--- a/src/pyams_content_es/component/paragraph.py	Thu Jun 28 09:22:22 2018 +0200
+++ b/src/pyams_content_es/component/paragraph.py	Thu Jun 28 09:26:40 2018 +0200
@@ -20,6 +20,7 @@
 from pyams_content.component.illustration.interfaces import IIllustrationParagraph
 from pyams_content.component.paragraph.interfaces import IParagraphContainer, IParagraphContainerTarget, \
     IBaseParagraph
+from pyams_content.component.paragraph.interfaces.audio import IAudioParagraph
 from pyams_content.component.paragraph.interfaces.contact import IContactParagraph
 from pyams_content.component.paragraph.interfaces.frame import IFrameParagraph
 from pyams_content.component.paragraph.interfaces.header import IHeaderParagraph
@@ -120,6 +121,25 @@
     return info
 
 
+@adapter_config(context=IAudioParagraph, provides=IDocumentIndexInfo)
+def audio_paragraph_index_info(paragraph):
+    """Audio paragraph index info"""
+    info = {}
+    manager = get_parent(paragraph, II18nManager)
+    for lang in manager.get_languages():
+        for attr in ('title', 'description'):
+            value = getattr(paragraph, attr, {}).get(lang, '')
+            if value:
+                info[lang] = '{old}\n{value}'.format(old=info.get(lang, ''),
+                                                     value=value)
+        for attr in ('author', ):
+            value = getattr(paragraph, attr, '')
+            if value:
+                info[lang] = '{old}\n{value}'.format(old=info.get(lang, ''),
+                                                     value=value)
+    return info
+
+
 @adapter_config(context=IVideoParagraph, provides=IDocumentIndexInfo)
 def video_paragraph_index_info(paragraph):
     """Video paragraph index info"""