[jbrout] Upgrade to the latest SVN checkout a many small bug fixes.

Matej Cepl mcepl at fedoraproject.org
Mon Jul 4 22:23:49 UTC 2011


commit a3d46815c7671ba591a7f574f370a5525a2f7724
Author: Matěj Cepl <mcepl at redhat.com>
Date:   Tue Jul 5 00:15:48 2011 +0200

    Upgrade to the latest SVN checkout a many small bug fixes.
    
     * refresh eliminate-metadata-exiftool patch (upstream #129)
     * fix crash with weird iconsize and more recent Gtk (upstream #186)
     * fix import of tags from Xmp.dc.subject (upstream also #129)
     * add more diagnostics for investigating weird crash with getParent being
       None sometimes
     * use Freedesktop directories instead of ~/.jbrout (upstream #56)

 jbrout-eliminate-metadata-exiftool.patch |   56 +++++++-------
 jbrout-glade-XML-assert-IconSize.patch   |   12 +++
 jbrout-no-double-keywords.patch          |   29 +++++++
 jbrout-purge-no-attribute-attrib.patch   |   28 +++++++
 jbrout-use-freedesktop-directories.patch |  121 ++++++++++++++++++++++++++++++
 jbrout.spec                              |   27 ++++++-
 sources                                  |    2 +-
 7 files changed, 244 insertions(+), 31 deletions(-)
---
diff --git a/jbrout-eliminate-metadata-exiftool.patch b/jbrout-eliminate-metadata-exiftool.patch
index 1c48ea1..eec7a77 100644
--- a/jbrout-eliminate-metadata-exiftool.patch
+++ b/jbrout-eliminate-metadata-exiftool.patch
@@ -1,8 +1,8 @@
-diff --git a/jbrout/jbrout.py b/jbrout/jbrout.py
-index 19bc785..e608fcc 100755
---- a/jbrout/jbrout.py
-+++ b/jbrout/jbrout.py
-@@ -74,7 +74,7 @@ from jbrout.listview import ThumbnailsView
+Index: jbrout/jbrout/jbrout.py
+===================================================================
+--- jbrout.orig/jbrout/jbrout.py
++++ jbrout/jbrout/jbrout.py
+@@ -74,7 +74,7 @@ from jbrout.listview import ThumbnailsVi
  from jbrout.externaltools import ExternalTools
  from jbrout.winbookmarks import WinBookmark
  from jbrout.winpref import WinPref
@@ -28,7 +28,7 @@ index 19bc785..e608fcc 100755
  
          JBrout.db.setNormalizeName( JBrout.conf["normalizeName"] )
          JBrout.db.setNormalizeNameFormat( str(JBrout.conf["normalizeNameFormat"]) )
-@@ -1947,7 +1948,6 @@ class Window(GladeApp):
+@@ -1946,7 +1947,6 @@ class Window(GladeApp):
          finally:
              self.showProgress()
          sel.refresh()
@@ -36,7 +36,7 @@ index 19bc785..e608fcc 100755
  
      def on_selecteur_menu_add_to_basket(self,b,sel):
          ln = sel.getSelected()
-@@ -2135,7 +2135,6 @@ class Window(GladeApp):
+@@ -2134,7 +2134,6 @@ class Window(GladeApp):
                          i.addTags(l)
              finally:
                  self.showProgress()
@@ -44,7 +44,7 @@ index 19bc785..e608fcc 100755
  
              sel.refresh()
          #~ context, x, y, selection, info, time = args
-@@ -2154,7 +2153,6 @@ class Window(GladeApp):
+@@ -2153,7 +2152,6 @@ class Window(GladeApp):
                          i.setRating(r)
              finally:
                  self.showProgress()
@@ -52,10 +52,10 @@ index 19bc785..e608fcc 100755
  
              sel.refresh()
  
-diff --git a/jbrout/jbrout/pyexiv.py b/jbrout/jbrout/pyexiv.py
-index 5017b5f..6a3e05c 100644
---- a/jbrout/jbrout/pyexiv.py
-+++ b/jbrout/jbrout/pyexiv.py
+Index: jbrout/jbrout/jbrout/pyexiv.py
+===================================================================
+--- jbrout.orig/jbrout/jbrout/pyexiv.py
++++ jbrout/jbrout/jbrout/pyexiv.py
 @@ -126,8 +126,12 @@ class Exiv2Metadata(object):
          for i in l:
              assert type(i)==unicode
@@ -81,10 +81,10 @@ index 5017b5f..6a3e05c 100644
          return Exiv2Metadata(pyexiv2.ImageMetadata(f))
      else:
          # pyexiv2 < 0.2
-diff --git a/jbrout/jbrout/tools.py b/jbrout/jbrout/tools.py
-index a999799..2b7d49b 100755
---- a/jbrout/jbrout/tools.py
-+++ b/jbrout/jbrout/tools.py
+Index: jbrout/jbrout/jbrout/tools.py
+===================================================================
+--- jbrout.orig/jbrout/jbrout/tools.py
++++ jbrout/jbrout/jbrout/tools.py
 @@ -158,9 +158,6 @@ class _Command:
  
              return out #unicode
@@ -95,7 +95,7 @@ index a999799..2b7d49b 100755
  class PhotoCmd(object):
  
      file = property(lambda self: self.__file)
-@@ -680,88 +677,6 @@ isreal : %s""" % (
+@@ -681,88 +678,6 @@ isreal : %s""" % (
      #    else:
      #        return file
  
@@ -184,11 +184,11 @@ index a999799..2b7d49b 100755
  if __name__=="__main__":
  
      #~ f=u"images_exemples/IMG_3320.JPG"
-diff --git a/jbrout/jbrout/winshow.py b/jbrout/jbrout/winshow.py
-index 0eec1a9..4588834 100755
---- a/jbrout/jbrout/winshow.py
-+++ b/jbrout/jbrout/winshow.py
-@@ -16,7 +16,6 @@ from __main__ import Buffer,GladeApp,JBrout
+Index: jbrout/jbrout/jbrout/winshow.py
+===================================================================
+--- jbrout.orig/jbrout/jbrout/winshow.py
++++ jbrout/jbrout/jbrout/winshow.py
+@@ -16,7 +16,6 @@ from __main__ import Buffer,GladeApp,JBr
  from commongtk import WinKeyTag
  from common import cd2rd,format_file_size_for_display
  from jbrout.externaltools import ExternalTools
@@ -196,7 +196,7 @@ index 0eec1a9..4588834 100755
  #TODO: add ops : add/del from basket
  #TODO: add ops : external tools
  
-@@ -220,7 +219,6 @@ class WinShow(GladeApp):
+@@ -221,7 +220,6 @@ class WinShow(GladeApp):
                          # capture keypad 0-5 for rating
                          currentNode.setRating(int(b.string))
                          self.draw()
@@ -204,7 +204,7 @@ index 0eec1a9..4588834 100755
  
                  return 0
  
-@@ -339,7 +337,6 @@ TAGS :
+@@ -340,7 +338,6 @@ TAGS :
          currentNode = self.viewer.display.node
          currentNode.delTag(tag)
          self.draw()
@@ -212,10 +212,10 @@ index 0eec1a9..4588834 100755
  
      def on_delete_clicked(self,*args):
          if self.isModify:
-diff --git a/jbrout/plugins/syncTags/__init__.py b/jbrout/plugins/syncTags/__init__.py
-index a4ad9f7..9a789a5 100644
---- a/jbrout/plugins/syncTags/__init__.py
-+++ b/jbrout/plugins/syncTags/__init__.py
+Index: jbrout/jbrout/plugins/syncTags/__init__.py
+===================================================================
+--- jbrout.orig/jbrout/plugins/syncTags/__init__.py
++++ jbrout/jbrout/plugins/syncTags/__init__.py
 @@ -13,7 +13,6 @@
  ##
  
diff --git a/jbrout-glade-XML-assert-IconSize.patch b/jbrout-glade-XML-assert-IconSize.patch
new file mode 100644
index 0000000..9cc3459
--- /dev/null
+++ b/jbrout-glade-XML-assert-IconSize.patch
@@ -0,0 +1,12 @@
+Index: jbrout/jbrout/data/jbrout.glade
+===================================================================
+--- jbrout.orig/jbrout/data/jbrout.glade
++++ jbrout/jbrout/data/jbrout.glade
+@@ -1005,7 +1005,6 @@
+                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                     <property name="show_arrow">False</property>
+                     <property name="tooltips">False</property>
+-                    <property name="icon_size">0</property>
+                     <child>
+                       <widget class="GtkToolButton" id="delete">
+                         <property name="visible">True</property>
diff --git a/jbrout-no-double-keywords.patch b/jbrout-no-double-keywords.patch
new file mode 100644
index 0000000..b134d8a
--- /dev/null
+++ b/jbrout-no-double-keywords.patch
@@ -0,0 +1,29 @@
+Index: jbrout/jbrout/jbrout/pyexiv.py
+===================================================================
+--- jbrout.orig/jbrout/jbrout/pyexiv.py
++++ jbrout/jbrout/jbrout/pyexiv.py
+@@ -108,13 +108,23 @@ class Exiv2Metadata(object):
+ 
+     def getTags(self):
+         """ return a list of merged tags (xmp+iptc) (list of str)"""
++        # Authoritative reference
++        # http://www.iptc.org/std/Iptc4xmpCore/1.0/documentation/Iptc4xmpCore_1.0-doc-CpanelsUserGuide_13.pdf
++        # however
++        # http://metadataworkinggroup.com/pdf/mwg_guidance.pdf says on page 35 that
++        ## IPTC Keywords is mapped to XMP (dc:subject)
++        # It seems that the latter is true ... at least according to
++        # http://trac.yorba.org/wiki/PhotoTags
++
+         if "Iptc.Application2.Keywords" in self._md.iptc_keys:
+             li=[str(i.strip("\x00")) for i in self._md["Iptc.Application2.Keywords"].values]    #digikam patch
+             # assume UTF8
+         else:
+             li=[]
+         if "Xmp.dc.subject" in self._md.xmp_keys:
+-            lx=[i.encode("utf_8") for i in self._md["Xmp.dc.subject"].value]
++            lx = []
++            for xel in self._md["Xmp.dc.subject"].value:
++                lx.extend([x.strip() for x in xel.encode("utf-8").split(",")])
+         else:
+             lx=[]
+         ll=list(set(li+lx))
diff --git a/jbrout-purge-no-attribute-attrib.patch b/jbrout-purge-no-attribute-attrib.patch
new file mode 100644
index 0000000..3661b32
--- /dev/null
+++ b/jbrout-purge-no-attribute-attrib.patch
@@ -0,0 +1,28 @@
+Index: jbrout/jbrout/jbrout/db.py
+===================================================================
+--- jbrout.orig/jbrout/jbrout/db.py
++++ jbrout/jbrout/jbrout/db.py
+@@ -14,6 +14,7 @@
+ ##
+ 
+ from lxml.etree import Element,ElementTree
++from xml.etree import ElementTree as et
+ import lxml
+ import traceback
+ from datetime import datetime
+@@ -600,7 +601,14 @@ class PhotoNode(object):
+     real = property(__getReal)
+ 
+     def __getFolder(self):
+-        na=dec(self.__node.getparent().attrib["name"])
++        try:
++            na=dec(self.__node.getparent().attrib["name"])
++        except e:
++            print >>sys.stderr, "Catching exception e:\n%s" % e
++            print >>sys.stderr, "self.__node = %s" % \
++                et.tostring(self.__node, encoding="utf-8")
++            print >>sys.stderr, "self.__node.getparent() = %s" % \
++                et.tostring(self.__node.getparent(), encoding="utf-8")
+         assert type(na)==unicode
+         return na
+     folder = property(__getFolder)
diff --git a/jbrout-use-freedesktop-directories.patch b/jbrout-use-freedesktop-directories.patch
new file mode 100644
index 0000000..1c131a6
--- /dev/null
+++ b/jbrout-use-freedesktop-directories.patch
@@ -0,0 +1,121 @@
+Index: jbrout/jbrout/jbrout/conf.py
+===================================================================
+--- jbrout.orig/jbrout/jbrout/conf.py
++++ jbrout/jbrout/jbrout/conf.py
+@@ -12,13 +12,14 @@
+ ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ ## GNU General Public License for more details.
+ ##
+-import os,re,sys,thread,shutil,stat,string
++import re, sys, thread, shutil, stat, string
+ 
+ from libs.dict4ini import DictIni
+ from plugins import JPlugins
+-import sys,os
++import os, os.path
+ from db import DBPhotos,DBTags
+ import socket
++import glib
+ 
+ # ============================================================================================
+ class Conf(object):
+@@ -91,54 +92,61 @@ class JBrout:
+         and will append to it (the newfolder can begins with a "." or not))
+         """
+         maskDir=False
+-        try:
+-            #windows NT,2k,XP,etc. fallback
++        glibConfDir = glib.get_user_data_dir()
++
++        # Find legacy home dir
++        #windows NT,2k,XP,etc.
++        if (os.name == "nt") and ("APPDATA" in os.environ):
+             home = os.environ['APPDATA']
+-            if not os.path.isdir(home): raise
++            if not os.path.isdir(home):
++                raise OSError("Missing %APPDATA% directory")
+             maskDir=False
+-        except:
+-            try:
+-                #all user-based OSes
+-                home = os.path.expanduser("~")
+-                if home == "~": raise
+-                if not os.path.isdir(home): raise
+-                maskDir=True
+-            except:
+-                try:
+-                    # freedesktop *nix ?
+-                    home = os.environ['XDG_CONFIG_HOME']
+-                    if not os.path.isdir(home): raise
++        elif ("XDG_CONFIG_HOME" in os.environ):
++            home = os.environ['XDG_CONFIG_HOME']
++            if not os.path.isdir(home):
++                raise OSError("Missing $XDG_CONFIG_HOME directory")
++            maskDir = False
++        elif (os.path.expanduser("~") != "~"):
++            home = os.path.expanduser("~")
++            if not os.path.isdir(home):
++                raise OSError("Missing ~ directory. Weird.")
++            maskDir=True
++        elif ("HOME" in os.environ):
++            home = os.environ["HOME"]
++            if os.path.isdir(home):
++                conf = os.path.join(home,".config")
++                if os.path.isdir(conf):
++                    home = conf
+                     maskDir=False
+-                except:
+-                    try:
+-                        #*nix fallback
+-                        home = os.environ['HOME']
+-                        if os.path.isdir(home):
+-                            conf = os.path.join(home,".config")
+-                            if os.path.isdir(conf):
+-                                home = conf
+-                                maskDir=False
+-                            else:
+-                                # keep home
+-                                maskDir=True
+-                        else:
+-                            raise
+-                    except:
+-                        #What os are people using?
+-                        home = None
++                else:
++                    # keep home
++                    maskDir=True
++            else:
++                raise OSError("Missing $HOME directory.")
++        else:
++            #What os are people using?
++            home = None
+ 
+-        if home:
++        if glibConfDir:
+             if mkdir:
+                 if maskDir:
+-                    newDir = "."+mkdir
++                    newDir = "." + mkdir
+                 else:
+                     newDir = mkdir
+ 
+-                home = os.path.join(home,newDir)
+-                if not os.path.isdir(home):
+-                    os.mkdir(home)
++                confDir = os.path.join(glibConfDir, mkdir)
++                oldConfDir = os.path.join(home, newDir)
++                if not os.path.isdir(confDir):
++                    # copy old data if we have them
++                    if os.path.isdir(oldConfDir):
++                        print "Copying %s to %s" % (oldConfDir, confDir)
++                        shutil.copytree(oldConfDir, confDir,
++                            symlinks=True)
++                    else:
++                        print "Creating new dir %s" % confDir
++                        os.mkdir(confDir)
+ 
+-            return home
++        return confDir
+ 
+ 
+     @staticmethod
diff --git a/jbrout.spec b/jbrout.spec
index 7aec330..4b27177 100644
--- a/jbrout.spec
+++ b/jbrout.spec
@@ -1,9 +1,9 @@
 %define svn_checkout 1
 
 Name:           jbrout
-Version:        0.3.323
+Version:        0.3.329
 %if 0%{?svn_checkout}
-Release:        0.svn323.5%{?dist}.1
+Release:        0.svn329.1%{?dist}
 %else
 Release:        2%{?dist}
 %endif
@@ -27,6 +27,14 @@ Patch0:         jbrout-allow-Exif-Orientation-zero.patch
 Patch1:         jbrout-download-plugin.patch
 # http://code.google.com/p/jbrout/issues/detail?id=129
 Patch2:         jbrout-eliminate-metadata-exiftool.patch
+# http://code.google.com/p/jbrout/issues/detail?id=186
+Patch3:         jbrout-glade-XML-assert-IconSize.patch
+# EXPERIMENTAL for now, don't distribute!
+Patch5:         jbrout-purge-no-attribute-attrib.patch
+# also attached to http://code.google.com/p/jbrout/issues/detail?id=129
+Patch6:         jbrout-no-double-keywords.patch
+# http://code.google.com/p/jbrout/issues/detail?id=56
+Patch7:         jbrout-use-freedesktop-directories.patch
 BuildArch:      noarch
 BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 Requires:       python >= 2.4, python-lxml, pygtk2 >= 2.6
@@ -60,6 +68,10 @@ jBrout is able to :
 %patch0 -p1 -b .exifOrientation
 %patch1 -p1 -b .downloadPlugin
 %patch2 -p1 -b .noExiftool
+%patch3 -p1 -b .iconsize
+%patch5 -p1 -b .noAttributeAttrib
+%patch6 -p1 -b .noDoubleKeyword
+%patch7 -p1 -b .freedesktopDir
 sh %{SOURCE5}
 install -p %{SOURCE1} jbrout/Makefile
 install -p -m a+rx,u+w %{SOURCE4} jbrout/install-script
@@ -97,6 +109,17 @@ rm -rf $RPM_BUILD_ROOT
 %{_datadir}/applications/jbrout.desktop
 
 %changelog
+* Tue Jul 05 2011 Matěj Cepl <mcepl at redhat.com> - 0.3.329-2
+- new upstream checkout (r329)
+- refresh eliminate-metadata-exiftool patch (upstream #129)
+- fix crash with weird iconsize and more recent Gtk (upstream
+  #186)
+- fix import of tags from Xmp.dc.subject (upstream also #129)
+- add more diagnostics for investigating weird crash with
+  getParent being None sometimes
+- use Freedesktop directories instead of ~/.jbrout (upstream
+  #56)
+
 * Wed Feb 09 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.3.323-0.svn323.5.1
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 
diff --git a/sources b/sources
index d209c0c..75deef4 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-1c047a67454bb93df37167a72287ad70  jbrout.tar.bz2
+a159f27480c74c6a716f59cf6a0fbe25  jbrout.tar.bz2


More information about the scm-commits mailing list