[pytango] 82/483: fixes #3447477

Sandor Bodo-Merle sbodomerle-guest at moszumanska.debian.org
Thu Sep 28 19:14:26 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 a0f3a77116630a056d788deb7e10c86cbd61278d
Author: tiagocoutinho <tiagocoutinho at 4e9c00fd-8f2e-0410-aa12-93ce3db5e235>
Date:   Mon Dec 12 12:31:30 2011 +0000

    fixes #3447477
    
    git-svn-id: http://svn.code.sf.net/p/tango-cs/code/bindings/PyTango/trunk@18626 4e9c00fd-8f2e-0410-aa12-93ce3db5e235
---
 IPython/Extensions/ipy_profile_spock.py        | 23 ++++++++++++
 IPython/config/profile/spock/ipython_config.py | 51 ++++++++++++++++++++++++++
 setup.py                                       | 21 ++++++++---
 3 files changed, 89 insertions(+), 6 deletions(-)

diff --git a/IPython/Extensions/ipy_profile_spock.py b/IPython/Extensions/ipy_profile_spock.py
index 857ced1..eb4b79d 100644
--- a/IPython/Extensions/ipy_profile_spock.py
+++ b/IPython/Extensions/ipy_profile_spock.py
@@ -1,3 +1,26 @@
+################################################################################
+##
+## This file is part of PyTango, a python binding for Tango
+## 
+## http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+##
+## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
+## 
+## PyTango is free software: you can redistribute it and/or modify
+## it under the terms of the GNU Lesser General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+## 
+## PyTango is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU Lesser General Public License for more details.
+## 
+## You should have received a copy of the GNU Lesser General Public License
+## along with PyTango.  If not, see <http://www.gnu.org/licenses/>.
+##
+################################################################################
+
 """ IPython 'spock' profile, to preload PyTango and offer a friendly interface to Tango."""
 
 import IPython.ipapi
diff --git a/IPython/config/profile/spock/ipython_config.py b/IPython/config/profile/spock/ipython_config.py
new file mode 100644
index 0000000..6e04707
--- /dev/null
+++ b/IPython/config/profile/spock/ipython_config.py
@@ -0,0 +1,51 @@
+################################################################################
+##
+## This file is part of PyTango, a python binding for Tango
+## 
+## http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
+##
+## Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
+## 
+## PyTango is free software: you can redistribute it and/or modify
+## it under the terms of the GNU Lesser General Public License as published by
+## the Free Software Foundation, either version 3 of the License, or
+## (at your option) any later version.
+## 
+## PyTango is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU Lesser General Public License for more details.
+## 
+## You should have received a copy of the GNU Lesser General Public License
+## along with PyTango.  If not, see <http://www.gnu.org/licenses/>.
+##
+################################################################################
+
+c = get_config()
+app = c.InteractiveShellApp
+
+import PyTango.ipython
+PyTango.ipython.load_config(c)
+
+# This can be used at any point in a config file to load a sub config
+# and merge it into the current one.
+load_subconfig('ipython_config.py', profile='default')
+
+lines = """
+"""
+
+# You have to make sure that attributes that are containers already
+# exist before using them.  Simple assigning a new list will override
+# all previous values.
+
+if hasattr(app, 'exec_lines'):
+    app.exec_lines.append(lines)
+else:
+    app.exec_lines = [lines]
+
+# Load the sympy_printing extension to enable nice printing of sympy expr's.
+#if hasattr(app, 'extensions'):
+#    app.extensions.append('sympyprinting')
+#else:
+#    app.extensions = ['sympyprinting']
+
diff --git a/setup.py b/setup.py
index 56598b7..4339ff6 100644
--- a/setup.py
+++ b/setup.py
@@ -45,9 +45,15 @@ except Exception,e:
 
 try:
     import IPython
-    import IPython.genutils
     _IPY_ROOT = os.path.dirname(os.path.abspath(IPython.__file__))
-    _IPY_LOCAL = str(IPython.genutils.get_ipython_dir())
+    _IPY_VER = map(int, IPython.__version__.split(".")[:2])
+    if _IPY_VER > [0,10]:
+        import IPython.utils.path
+        get_ipython_dir = IPython.utils.path.get_ipython_dir
+    else:
+        import IPython.genutils
+        get_ipython_dir = IPython.genutils.get_ipython_dir
+    _IPY_LOCAL = str(get_ipython_dir())
 except:
     IPython = None
 
@@ -114,7 +120,10 @@ class build(dftbuild):
             self.distribution.packages.append('PyTango3')
         
         if IPython and not self.without_spock:
-            self.distribution.py_modules.append('IPython.Extensions.ipy_profile_spock')
+            if _IPY_VER > [0,10]:
+                self.distribution.py_modules.append('IPython.config.profile.spock')
+            else:
+                self.distribution.py_modules.append('IPython.Extensions.ipy_profile_spock')
             
         dftbuild.run(self)
         
@@ -307,9 +316,9 @@ def main():
     #-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
 
     libraries = [
-            'tango',
-            'log4tango',
-        ]
+        'tango',
+        'log4tango',
+    ]
 
     extra_compile_args = []
 

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