rpms/pygtk2/FC-4 pygtk-2.6.2-guint.patch, NONE, 1.1 pygtk.spec, 1.32, 1.33

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Sep 9 18:52:04 UTC 2005


Author: johnp

Update of /cvs/dist/rpms/pygtk2/FC-4
In directory cvs.devel.redhat.com:/tmp/cvs-serv2728

Modified Files:
	pygtk.spec 
Added Files:
	pygtk-2.6.2-guint.patch 
Log Message:
- add patch that fixes guint bug which was causing problems with anaconda 
  installs


pygtk-2.6.2-guint.patch:
 codegen/argtypes.py      |   35 ++++++++++++++++++++++++++++-------
 tests/test_conversion.py |   12 ++++++++++++
 2 files changed, 40 insertions(+), 7 deletions(-)

--- NEW FILE pygtk-2.6.2-guint.patch ---
Index: codegen/argtypes.py
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/codegen/argtypes.py,v
retrieving revision 1.76
diff -u -p -d -r1.76 argtypes.py
--- codegen/argtypes.py	20 Jun 2005 22:46:39 -0000	1.76
+++ codegen/argtypes.py	19 Aug 2005 20:33:41 -0000
@@ -175,16 +175,37 @@ class IntArg(ArgType):
         info.codeafter.append('    return PyInt_FromLong(ret);')
 
 class UIntArg(ArgType):
+    dflt = ('    if (py_%(name)s) {\n'
+            '        if (PyLong_Check(py_%(name)s))\n'
+            '            %(name)s = PyLong_AsUnsignedLong(py_%(name)s);\n'
+            '        else if (PyInt_Check(py_%(name)s))\n'
+            '            %(name)s = PyInt_AsLong(py_%(name)s);\n'
+            '        else\n'
+            '            PyErr_SetString(PyExc_TypeError, "Parameter \'%(name)s\' must be an int or a long");\n'
+            '        if (PyErr_Occurred())\n'
+            '            return NULL;\n'
+            '    }\n')
+    before = ('    if (PyLong_Check(py_%(name)s))\n'
+              '        %(name)s = PyLong_AsUnsignedLong(py_%(name)s);\n'
+              '    else if (PyInt_Check(py_%(name)s))\n'
+              '        %(name)s = PyInt_AsLong(py_%(name)s);\n'
+              '    else\n'
+              '        PyErr_SetString(PyExc_TypeError, "Parameter \'%(name)s\' must be an int or a long");\n'
+              '    if (PyErr_Occurred())\n'
+              '        return NULL;\n')
     def write_param(self, ptype, pname, pdflt, pnull, info):
-	if pdflt:
-	    info.varlist.add(ptype, pname + ' = ' + pdflt)
-	else:
-	    info.varlist.add(ptype, pname)
-	info.arglist.append(pname)
-        info.add_parselist('I', ['&' + pname], [pname])
+        if pdflt:
+            info.varlist.add(ptype, pname + ' = ' + pdflt)
+            info.codebefore.append(self.dflt % {'name':pname})            
+        else:
+            info.varlist.add(ptype, pname)
+            info.codebefore.append(self.before % {'name':pname})            
+        info.varlist.add('PyObject', "*py_" + pname + ' = NULL')
+        info.arglist.append(pname)
+        info.add_parselist('O', ['&py_' + pname], [pname])
     def write_return(self, ptype, ownsreturn, info):
         info.varlist.add(ptype, 'ret')
-        info.codeafter.append('    return PyLong_FromUnsignedLong(ret);\n')
+        info.codeafter.append('    return PyLong_FromUnsignedLong(ret);')
 
 class SizeArg(ArgType):
 
Index: tests/test_conversion.py
===================================================================
RCS file: /cvs/gnome/gnome-python/pygtk/tests/test_conversion.py,v
retrieving revision 1.2
diff -u -p -d -r1.2 test_conversion.py
--- tests/test_conversion.py	4 Jul 2005 13:07:10 -0000	1.2
+++ tests/test_conversion.py	19 Aug 2005 20:33:41 -0000
@@ -1,5 +1,7 @@
 # -*- Mode: Python -*-
 
+import sys
+
 import unittest
 
 from common import gtk, gobject
@@ -69,5 +71,15 @@ class Tests(unittest.TestCase):
         c = gtk.gdk.Color(pixel=0xffffffffL)
         self.assertEqual(c.pixel, 0xffffffffL)
 
+    def testUIntArg(self):
+        child = gtk.DrawingArea()
+        table = gtk.Table(2, 2, False)
+        table.attach(child, 1, 2, 0, 1, ypadding=2)
+        self.assertEqual(table.child_get_property(child, 'y-padding'), 2)
+        
+        child = gtk.DrawingArea()
+        table.attach(child, 1, 2, 0, 1, ypadding=2L)
+        self.assertEqual(table.child_get_property(child, 'y-padding'), 2)
+        
 if __name__ == '__main__':
     unittest.main()


Index: pygtk.spec
===================================================================
RCS file: /cvs/dist/rpms/pygtk2/FC-4/pygtk.spec,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- pygtk.spec	23 Aug 2005 16:13:48 -0000	1.32
+++ pygtk.spec	9 Sep 2005 18:52:01 -0000	1.33
@@ -3,11 +3,12 @@
 Summary: Python bindings for the GTK+ widget set.
 Name: pygtk2
 Version: 2.6.2
-Release: 0.fc4.3
+Release: 0.fc4.4
 License: LGPL
 Group: Development/Languages
 Source: ftp://ftp.gtk.org/pub/gtk/python/pygtk-%{version}.tar.bz2
 #Source2: acinclude.m4
+Patch0: pygtk-2.6.2-guint.patch 
 BuildRoot: %{_tmppath}/pygtk-root
 Requires: gtk2 >= 2.4.0
 Requires: python2 >= 2.3
@@ -45,6 +46,7 @@
 
 %prep
 %setup -q -n pygtk-%{version}
+%patch0 -p0 -b .guint
 
 %build
 %configure --enable-thread --enable-numpy
@@ -105,6 +107,10 @@
 %{_prefix}/share/pygtk/2.0/defs/*.defs
 
 %changelog
+* Fri Sep 09 2005 John (J5) Palmieri <johnp at redhat.com> - 2.6.2-0.fc4.4
+- Add patch from upstream that fixes handling of guint's which causes
+  problems in the anaconda installer
+
 * Tue Aug 23 2005 John (J5) Palmieri <johnp at redhat.com> - 2.6.2-0.fc4.3
 - Add a requires on python-numeric as well
 




More information about the fedora-cvs-commits mailing list