[pytango] 428/483: Add pre_init_callback; auto_clean should be False by default

Sandor Bodo-Merle sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:15:08 UTC 2017


This is an automated email from the git hooks/post-receive script.

sbodomerle-guest pushed a commit to annotated tag bliss_8.10
in repository pytango.

commit 8bbfc3ae7f9c5dc4f05971976d0bf85f0ad6b08b
Author: coutinho <coutinho at esrf.fr>
Date:   Tue Dec 16 08:23:11 2014 +0100

    Add pre_init_callback; auto_clean should be False by default
---
 src/boost/python/server.py | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/boost/python/server.py b/src/boost/python/server.py
index 2bdedbb..f019aa1 100644
--- a/src/boost/python/server.py
+++ b/src/boost/python/server.py
@@ -1331,13 +1331,14 @@ class _Server:
             return self.__obj()
 
     def __init__(self, server_name, server_type=None, port=None,
-                 event_loop_callback=None, post_init_callback=None,
-                 auto_clean=True, green_mode=None, tango_classes=None,
-                 protocol="pickle"):
+                 event_loop_callback=None, pre_init_callback=None,
+                 post_init_callback=None, auto_clean=False, green_mode=None,
+                 tango_classes=None, protocol="pickle"):
         self.__server_name = server_name
         self.__server_type = server_type
         self.__port = port
         self.__event_loop_callback = event_loop_callback
+        self.__pre_init_callback = pre_init_callback
         self.__post_init_callback = post_init_callback
         self.__util = None
         self.__objects = {}
@@ -1459,8 +1460,7 @@ class _Server:
         self.__objects[full_name.lower()] = tango_object
         return tango_object
 
-    def _post_init_callback(self):
-        cb = self.__post_init_callback
+    def __exec_cb(self, cb):
         if not cb:
             return
         if self.gevent_mode:
@@ -1468,6 +1468,12 @@ class _Server:
         else:
             cb()
 
+    def _pre_init_callback(self):
+        self.__exec_cb(elf.__pre_init_callback)
+
+    def _post_init_callback(self):
+        self.__exec_cb(elf.__post_init_callback)
+
     def __clean_up(self):
         self.log.debug("clean up")
         server_instance = self.server_instance
@@ -1524,6 +1530,8 @@ class _Server:
         util = self.tango_util
         u_instance = util.instance()
 
+        self._pre_init_callback()
+
         if gevent_mode:
             if event_loop:
                 event_loop = functools.partial(self.__runner.execute,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/pytango.git



More information about the debian-science-commits mailing list