Module refactoring
authorThierry Florac <tflorac@ulthar.net>
Mon, 20 Jul 2020 12:34:40 +0200
changeset 167 3fb0f88ee052
parent 166 0c536f62e02a
child 168 de138c75620f
Module refactoring
src/pyams_content_es/interfaces.py
src/pyams_content_es/interfaces/__init__.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_content_es/interfaces.py	Mon Jul 20 12:34:40 2020 +0200
@@ -0,0 +1,67 @@
+#
+# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+
+from zope.interface import Interface
+from zope.schema import Choice
+
+__docformat__ = 'restructuredtext'
+
+
+from pyams_content_es import _
+
+
+#
+# Indexer interfaces
+#
+
+INDEXER_NAME = 'ElasticSearch content indexer'
+INDEXER_STARTER_KEY = 'pyams_content.es.start_handler'
+INDEXER_HANDLER_KEY = 'pyams_content.es.tcp_handler'
+INDEXER_AUTH_KEY = 'pyams_content.es.allow_auth'
+INDEXER_CLIENTS_KEY = 'pyams_content.es.allow_clients'
+
+
+#
+# Utility interfaces
+#
+
+class IContentIndexerUtility(Interface):
+    """Content indexer utility interface"""
+
+    zodb_name = Choice(title=_("ZODB connection name"),
+                       description=_("Name of ZODB connection defining indexer connection"),
+                       required=False,
+                       vocabulary="PyAMS ZODB connections")
+
+    def get_socket(self):
+        """Get 0MQ socket matching utility settings"""
+
+    def index_document(self, document):
+        """Index given document"""
+
+    def unindex_document(self, document):
+        """Un-index given document"""
+
+    def test_process(self):
+        """Send test request to indexer process"""
+
+
+#
+# Contents interfaces
+#
+
+class IDocumentIndexInfo(Interface):
+    """Document index info"""
+
+
+class IDocumentIndexTarget(Interface):
+    """Document index target marker interface"""
--- a/src/pyams_content_es/interfaces/__init__.py	Mon Jul 20 12:33:08 2020 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-#
-# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
-# All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
-#
-
-__docformat__ = 'restructuredtext'
-
-
-# import standard library
-
-# import interfaces
-
-# import packages
-from zope.interface import Interface
-from zope.schema import Choice
-
-from pyams_content_es import _
-
-
-#
-# Indexer interfaces
-#
-
-INDEXER_NAME = 'ElasticSearch content indexer'
-INDEXER_STARTER_KEY = 'pyams_content.es.start_handler'
-INDEXER_HANDLER_KEY = 'pyams_content.es.tcp_handler'
-INDEXER_AUTH_KEY = 'pyams_content.es.allow_auth'
-INDEXER_CLIENTS_KEY = 'pyams_content.es.allow_clients'
-
-
-#
-# Utility interfaces
-#
-
-class IContentIndexerUtility(Interface):
-    """Content indexer utility interface"""
-
-    zodb_name = Choice(title=_("ZODB connection name"),
-                       description=_("Name of ZODB connection defining indexer connection"),
-                       required=False,
-                       vocabulary="PyAMS ZODB connections")
-
-    def get_socket(self):
-        """Get 0MQ socket matching utility settings"""
-
-    def index_document(self, document):
-        """Index given document"""
-
-    def unindex_document(self, document):
-        """Un-index given document"""
-
-    def test_process(self):
-        """Send test request to indexer process"""
-
-
-#
-# Contents interfaces
-#
-
-class IDocumentIndexInfo(Interface):
-    """Document index info"""
-
-
-class IDocumentIndexTarget(Interface):
-    """Document index target marker interface"""