Re: Patch for RHEL4 support in Meld 1.1.5.1



Hi Bill, thanks for the patch. I'm reluctant to apply the patch though
because if it works, it's really by accident and I can't support
pygtk2.4

I've included your patch here for future reference and I'll add a
RHEL4 link from the install page.

Regards,
Stephen.

On Nov 29, 2007 4:04 PM, Bill Hayden <bill hayden sage com> wrote:
>
>  Steve,
>
>  We were very impressed with Meld at our company, and wanted to use it.
> Unfortunately, like many commercial Linux developers, we are stuck on RHEL4
> which has older versions of pygtk and gnome-python than what you currently
> support.  I ran across many postings on the web requesting Meld support for
> RHEL4, but no solutions except to use a very old version of Meld.
>
>  Being a programmer and having the source available was too much temptation
> :-), so I fixed the incompatibility and it now runs on RHEL4 (or more
> generally, on 2.4 versions of pygtk and gnome-python).  Thankfully it was
> only a few lines of code in one file.  It does produce a few libglade
> warnings about unknown properties, which is to be expected if it was
> developed under 2.6, but I never noticed any bugs related to it.  The patch
> file is attached.  It checks for the pygtk version and makes a call to the
> old API instead of the new API if the version is less than 2.6.  Even though
> they should be the same major version, to be pedantically correct I believe
> it really should check the gnome-python version instead of the pygtk
> version, so feel free to correct that if it bothers you.
>
>  Thanks again for a great product, and I hope that you see fit to include my
> patch in the next version.  The cool part was that I used the working Meld
> 1.0.0 version to do almost all of the work!
>
--- meld-1.1.5.1/gnomeglade.py 
+++ meld-1.1.5.1-fixed/gnomeglade.py 
@@ -23,6 +23,7 @@
 import gnome
 import gnome.ui
 import gettext
+import gobject
 
 class Base(object):
     """Base class for all glade objects.
@@ -43,7 +44,10 @@
 
         Automatically connects signal handlers named 'on_*'.
         """
-        self.xml = gtk.glade.XML(file, root, gettext.textdomain() )
+        if gobject.pygtk_version < (2,6,0):
+            self.xml = gtk.glade.XML(file, root, gettext.textdomain())
+        else:
+            self.xml = gtk.glade.XML(file, root, gettext.textdomain(), override)
         handlers = {}
         for h in filter(lambda x:x.startswith("on_"), dir(self.__class__)):
             handlers[h] = getattr(self, h)
@@ -92,7 +96,10 @@
     """
 
     def __init__(self, file, root, override={}):
-        Base.__init__(self, file, root)
+        if gobject.pygtk_version < (2,6,0):
+            Base.__init__(self, file, root)
+        else:
+            Base.__init__(self, file, root, override)
 
 
 class GtkApp(Base):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]