[SCM] framework for TANGO control system client applications branch, master, updated. debian/3.0.0-1-5-gf76a215

Picca Frédéric-Emma?==?UTF-8?Q?nuel picca at debian.org
Wed Jan 23 06:29:11 UTC 2013


The following commit has been merged in the master branch:
commit 9eb902dba97a235ce5837e2dc7cb6c6a98cc84eb
Author: Picca Frédéric-Emmanuel <picca at debian.org>
Date:   Fri Jan 18 21:25:19 2013 +0100

    fix from upstream to avois missing icons.

diff --git a/debian/patches/0002-upstream-fix-for-the-FTBFS-due-to-image-conversion.patch b/debian/patches/0002-upstream-fix-for-the-FTBFS-due-to-image-conversion.patch
index 5823579..2c15118 100644
--- a/debian/patches/0002-upstream-fix-for-the-FTBFS-due-to-image-conversion.patch
+++ b/debian/patches/0002-upstream-fix-for-the-FTBFS-due-to-image-conversion.patch
@@ -1,33 +1,16 @@
-From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric-Emmanuel=20PICCA?=
- <picca at synchrotron-soleil.fr>
-Date: Wed, 16 Jan 2013 17:05:59 +0100
+From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= <picca at debian.org>
+Date: Fri, 18 Jan 2013 21:20:39 +0100
 Subject: upstream fix for the FTBFS due to image conversion
 
 ---
- setup.py |   26 +++++++++++++++-----------
- 1 file changed, 15 insertions(+), 11 deletions(-)
+ setup.py |   24 +++++++++++++-----------
+ 1 file changed, 13 insertions(+), 11 deletions(-)
 
 diff --git a/setup.py b/setup.py
-index c3afb89..2ab7b83 100644
+index c3afb89..92d570a 100644
 --- a/setup.py
 +++ b/setup.py
-@@ -69,6 +69,7 @@ packages = [
-     'taurus.core.util.argparse',
-     'taurus.core.util.decorator',
-     'taurus.core.util.report',
-+    'taurus.core.utils',        # old, deprecated: maintain for compatibility
-     'taurus.core.resource',
-     'taurus.core.simulation',
-     'taurus.core.evaluation',
-@@ -113,6 +114,7 @@ packages = [
-     'taurus.qt.qtgui.model',
-     'taurus.qt.qtgui.panel',
-     'taurus.qt.qtgui.panel.report',
-+    'taurus.qt.qtgui.panel.report.ui',
-     'taurus.qt.qtgui.panel.ui',
-     'taurus.qt.qtgui.plot',
-     'taurus.qt.qtgui.plot.ui',
-@@ -585,7 +587,6 @@ if sphinx:
+@@ -585,7 +585,6 @@ if sphinx:
          def run(self):
              self.resource_dir = abspath('lib', 'taurus', 'qt', 'qtgui', 'resource')
              self.taurus = os.path.join(self.resource_dir, 'taurus.png')
@@ -35,7 +18,7 @@ index c3afb89..2ab7b83 100644
              orig_dir = os.path.abspath(os.curdir)
              os.chdir(self.resource_dir)
              
-@@ -699,13 +700,13 @@ if sphinx:
+@@ -699,13 +698,13 @@ if sphinx:
  
      class build_doc(BuildDoc):
          user_options = BuildDoc.user_options + \
@@ -53,7 +36,7 @@ index c3afb89..2ab7b83 100644
          
          def has_doc_api(self):
              return True
-@@ -757,20 +758,20 @@ if sphinx:
+@@ -757,20 +756,20 @@ if sphinx:
              # copy the tango icons to the build directory of documentation
              target = os.path.join(build_dir, 'devel')
              
@@ -78,7 +61,7 @@ index c3afb89..2ab7b83 100644
          import PyQt4.Qt
      relpath = os.path.relpath(dirname, start=resource)
      path = os.path.join(target, relpath)
-@@ -783,9 +784,12 @@ def svg_to_png(arg, dirname, fnames):
+@@ -783,9 +782,12 @@ def svg_to_png(arg, dirname, fnames):
              target_fname = fbase + ".png"
              full_target_fname = os.path.join(path, target_fname)
              if not os.path.isfile(full_target_fname):
diff --git a/debian/patches/0003-upstream-fix-tango-icon-resources.patch b/debian/patches/0003-upstream-fix-tango-icon-resources.patch
new file mode 100644
index 0000000..cc5c50c
--- /dev/null
+++ b/debian/patches/0003-upstream-fix-tango-icon-resources.patch
@@ -0,0 +1,174 @@
+From: =?UTF-8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= <picca at debian.org>
+Date: Fri, 18 Jan 2013 21:13:40 +0100
+Subject: upstream fix tango icon resources
+
+---
+ .../qt/qtgui/resource/taurus_resource_utils.py     |   94 +++++++++-----------
+ 1 file changed, 44 insertions(+), 50 deletions(-)
+
+diff --git a/lib/taurus/qt/qtgui/resource/taurus_resource_utils.py b/lib/taurus/qt/qtgui/resource/taurus_resource_utils.py
+index 5976544..42f8438 100644
+--- a/lib/taurus/qt/qtgui/resource/taurus_resource_utils.py
++++ b/lib/taurus/qt/qtgui/resource/taurus_resource_utils.py
+@@ -47,7 +47,6 @@ DevHealth = taurus.core.TaurusSWDevHealth
+ Size = Qt.QSize
+ 
+ __INITIALIZED = False
+-__INITIALIZED_THEME = False
+ # Theme capacity was only added in Qt 4.6
+ __THEME_CAPACITY = hasattr(Qt.QIcon, "fromTheme")
+ # Uncomment the following line to force NOT to use OS theme.
+@@ -66,60 +65,47 @@ __3DQS = Size(3*__DW, __DH)
+ 
+ def __init():
+     global __INITIALIZED
++    global __THEME_MEMBERS
+     
+     if __INITIALIZED: return
+-    
++        
++    #register only the tango-icons rcc files (and initialize the THEME_MEMBERS)
+     res_dir = os.path.dirname(os.path.abspath(__file__))
+     Qt.QDir.addSearchPath("resource", res_dir)
+-    
+-    for res_file in [ f for f in os.listdir(res_dir) if f.endswith(".rcc") ]:
+-        if not Qt.QResource.registerResource("resource:" + res_file):
+-            __LOGGER.info("Failed to load resource %s" % res_file)
++    prefix = 'qrc_tango_icons_'
++    suffix = '.rcc'
++    lp, ls = len(prefix),len(suffix)
++    theme_members = {}
++    other_rcc_files = []
++    for f in os.listdir(res_dir):
++        if f.endswith(suffix):
++            if f.startswith(prefix):
++                if Qt.QResource.registerResource("resource:" + f):
++                    d = f[lp:-ls]
++                    theme_members[d] = [str(e)[:-4] for e in Qt.QDir(":%s"%d).entryList() if str(e).endswith('.svg')] 
++                else:
++                    __LOGGER.info("Failed to load resource %s" % f)
++            else:
++                other_rcc_files.append(f) #we remember these and will register later
++    __THEME_MEMBERS = theme_members
++    
++    #register the rest of the resource files
++    for f in other_rcc_files:
++        if not Qt.QResource.registerResource("resource:" + f):
++            __LOGGER.info("Failed to load resource %s" % f)
+     
+     __INITIALIZED = True
+ 
+ __init()
+ 
+-def __init_theme_members():
+-    global __INITIALIZED_THEME
+-    global __THEME_MEMBERS
+-    global __THEME_CAPACITY
+-    global __LOGGER
+-    
+-    if __INITIALIZED_THEME: return __THEME_MEMBERS
+-    
+-    app = Qt.QApplication.instance()
+-    if app is None and __THEME_CAPACITY:
+-        raise Exception("Cannot calculate theme without QApplication instance")
+-    
+-    res_dir = os.path.dirname(os.path.abspath(__file__))
+-    theme_icon_dir = os.path.join(res_dir, "tango-icons")
+-    members = {}
+-    for d in os.listdir(theme_icon_dir):
+-        abs_dir = os.path.join(theme_icon_dir, d)
+-        if d[0] == "." or not os.path.isdir(abs_dir):
+-            continue
+-        elems = []
+-        for elem in os.listdir(abs_dir):
+-            abs_elem = os.path.join(abs_dir, elem)
+-            idx = elem.rfind(".svg")
+-            if elem[0] == "." or idx < 0 or not os.path.isfile(abs_elem):
+-                continue
+-            elems.append(elem[:idx])
+-        members[d] = elems
+-    
+-    __THEME_MEMBERS = members
+-
+-    __INITIALIZED_THEME = True
+-    return __THEME_MEMBERS
+-
+ def getThemeMembers():
+     """Returns the current icon theme elements
+     
+     :return: the current icon theme elements in a dictionary where each key is
+              a group name and the value is a sequence of theme icon name.
+     :rtype: dict<str,seq<str>>"""
+-    return __init_theme_members()
++    global __THEME_MEMBERS
++    return __THEME_MEMBERS
+ 
+ def getPixmap(key, size=None):
+     """Returns a PyQt4.QtGui.QPixmap object for the given key and size
+@@ -168,13 +154,17 @@ def getThemePixmap(key, size=None):
+     :return: (PyQt4.QtGui.QPixmap) a PyQt4.QtGui.QPixmap for the given key and size"""
+ 
+     global __THEME_CAPACITY
+-    if __THEME_CAPACITY and Qt.QIcon.hasThemeIcon(key):
+-        size = size or 48
+-        return Qt.QIcon.fromTheme(key).pixmap(size, size)
+-
++    global __LOGGER
++    if __THEME_CAPACITY:
++        if Qt.QIcon.hasThemeIcon(key):
++            size = size or 48
++            return Qt.QIcon.fromTheme(key).pixmap(size, size)
++        else:
++            __LOGGER.debug('Theme pixmap "%s" not supported. Trying to provide a fallback...',key)
+     for member, items in getThemeMembers().items():
+         if not key in items: continue
+         return getPixmap(":/%s/%s.svg" % (member, key), size)
++    __LOGGER.debug('Theme pixmap "%s" not supported.', key)
+     return Qt.QPixmap()
+ 
+ def getThemeIcon(key):
+@@ -192,12 +182,16 @@ def getThemeIcon(key):
+     :return: (PyQt4.QtGui.QIcon) a PyQt4.QtGui.QIcon for the given key"""
+ 
+     global __THEME_CAPACITY
+-    if __THEME_CAPACITY and Qt.QIcon.hasThemeIcon(key):
+-        return Qt.QIcon.fromTheme(key)
+-
++    global __LOGGER
++    if __THEME_CAPACITY:
++        if Qt.QIcon.hasThemeIcon(key):
++            return Qt.QIcon.fromTheme(key)
++        else:
++            __LOGGER.debug('Theme icon "%s" not supported. Trying to provide a fallback...',key)
+     for member, items in getThemeMembers().items():
+         if not key in items: continue
+         return Qt.QIcon(":/%s/%s.svg" % (member, key))
++    __LOGGER.debug('Theme icon "%s" not supported.', key)
+     return Qt.QIcon()
+ 
+ def getStandardIcon(key, widget=None):
+@@ -205,7 +199,7 @@ def getStandardIcon(key, widget=None):
+     QStyle.StandardPixmap enumeration member. The widget argument is optional 
+     and can also be used to aid the determination of the icon.
+     
+-    :param key: (QStyle.StandardPixmap) a standard pixmap which can follow some existing GUI style or guidelin
++    :param key: (QStyle.StandardPixmap) a standard pixmap which can follow some existing GUI style or guideline
+     :param widget: (Qt.QWidget) the widget argument (optional) can also be used to aid the determination of the icon.
+     
+     :return: (PyQt4.QtGui.QIcon) a PyQt4.QtGui.QIcon for the given key"""
+@@ -220,7 +214,7 @@ def getStandardIcon(key, widget=None):
+ __IDX_ELEM_TYPE_ICON, __IDX_ELEM_TYPE_SIZE, __IDX_ELEM_TYPE_TOOLTIP = range(3)
+ 
+ # New default role map
+-# Elements are: icon theme, prefered size, description/tooltip
++# Elements are: icon theme, preferred size, description/tooltip
+ _ELEM_TYPE_MAP = { ElemType.Name : ("folder", __3DQS, None),
+             ElemType.Device : ("applications-system", Size(210, __DH), "Tango device name"),
+        ElemType.DeviceAlias : ("applications-system", Size(140, __DH), "Tango device alias"),
+@@ -354,4 +348,4 @@ def getSWDevHealthPixmap(elemHealth, size=None):
+     if data is None:
+         return
+     themeName = data[__IDX_HEALTH_ICON]
+-    return getThemePixmap(themeName, size)
+\ No newline at end of file
++    return getThemePixmap(themeName, size)
diff --git a/debian/patches/series b/debian/patches/series
index 419f92c..1eadd3f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 0001-forwarded-add-no-doc-option.patch
 0002-upstream-fix-for-the-FTBFS-due-to-image-conversion.patch
+0003-upstream-fix-tango-icon-resources.patch

-- 
framework for TANGO control system client applications



More information about the debian-science-commits mailing list