[pytango] 04/483: fix possible source of errors: to make sure we are using correct database: - no longer rewrite the DeviceProxy contructor - instead update the os.environ["TANGO_HOST"] each time switchdb is called

Sandor Bodo-Merle sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:14:19 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 cf7d710df6894bc3e7d6dd6f8509f9c2fe5f851f
Author: tiagocoutinho <tiagocoutinho at 4e9c00fd-8f2e-0410-aa12-93ce3db5e235>
Date:   Wed Mar 2 18:57:26 2011 +0000

    fix possible source of errors:
    to make sure we are using correct database:
     - no longer rewrite the DeviceProxy contructor
     - instead update the os.environ["TANGO_HOST"] each time switchdb is called
    
    git-svn-id: http://svn.code.sf.net/p/tango-cs/code/bindings/PyTango/trunk@15890 4e9c00fd-8f2e-0410-aa12-93ce3db5e235
---
 PyTango/ipython/ipython_00_10.py | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/PyTango/ipython/ipython_00_10.py b/PyTango/ipython/ipython_00_10.py
index b1950d6..1ca455c 100644
--- a/PyTango/ipython/ipython_00_10.py
+++ b/PyTango/ipython/ipython_00_10.py
@@ -65,15 +65,15 @@ class DeviceClassCompleter(object):
 # using may be different than the default TANGO_HOST. What we do is always append
 # the name of the database in usage to the device name given by the user (in case 
 # he doesn't give a database name him(her)self, of course.
-__DeviceProxy_init_orig__ = PyTango.DeviceProxy.__init__
-def __DeviceProxy__init__(self, dev_name):
-    db = __get_db()
-    if db is None: return
-    if dev_name.count(":") == 0:
-        db_name = "%s:%s" % (db.get_db_host(), db.get_db_port())
-        dev_name = "%s/%s" % (db_name, dev_name)
-    __DeviceProxy_init_orig__(self, dev_name)
-PyTango.DeviceProxy.__init__ = __DeviceProxy__init__
+#__DeviceProxy_init_orig__ = PyTango.DeviceProxy.__init__
+#def __DeviceProxy__init__(self, dev_name):
+#    db = __get_db()
+#    if db is None: return
+#    if dev_name.count(":") == 0:
+#        db_name = "%s:%s" % (db.get_db_host(), db.get_db_port())
+#        dev_name = "%s/%s" % (db_name, dev_name)
+#    __DeviceProxy_init_orig__(self, dev_name)
+#PyTango.DeviceProxy.__init__ = __DeviceProxy__init__
 
 #-------------------------------------------------------------------------------
 # Completers
@@ -782,6 +782,8 @@ def init_db(ip, parameter_s=''):
         
     if db is None: return
     
+    os.environ["TANGO_HOST"] = "%s:%s" % (db.get_db_host(), db.get_db_port())
+    
     # Initialize device and server information
     query = "SELECT name, alias, server, class FROM device order by name"
     

-- 
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