gobject-introspection r550 - in trunk: . giscanner
- From: johan svn gnome org
- To: svn-commits-list gnome org
- Subject: gobject-introspection r550 - in trunk: . giscanner
- Date: Sun, 31 Aug 2008 15:56:56 +0000 (UTC)
Author: johan
Date: Sun Aug 31 15:56:56 2008
New Revision: 550
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=550&view=rev
Log:
2008-08-31 Johan Dahlin <johan gnome org>
* giscanner/glibtransformer.py:
Clean up a huge if. Do not add methods or constructors
to enums/flags.
* giscanner/utils.py:
second might be longer than first, check that.
Modified:
trunk/ChangeLog
trunk/giscanner/glibtransformer.py
trunk/giscanner/utils.py
Modified: trunk/giscanner/glibtransformer.py
==============================================================================
--- trunk/giscanner/glibtransformer.py (original)
+++ trunk/giscanner/glibtransformer.py Sun Aug 31 15:56:56 2008
@@ -328,10 +328,15 @@
klass = None
def valid_matching_klass(tclass):
- return (tclass is not None and
- isinstance(tclass, (GLibObject, GLibBoxed,
- GLibInterface)) and
- not isinstance(tclass, GLibEnum))
+ if tclass is None:
+ return False
+ elif isinstance(klass, (GLibEnum, GLibFlags)):
+ return False
+ elif not isinstance(tclass, (GLibObject, GLibBoxed,
+ GLibInterface)):
+ return False
+ else:
+ return True
# First look for an exact match;
klass = self._uscore_type_names.get(prefix)
@@ -348,6 +353,8 @@
print "NOTE: No valid matching class for likely "+\
"method or constructor: %r" % (func.symbol, )
return
+ if isinstance(klass, (GLibEnum, GLibFlags)):
+ return None
if not is_method:
# Interfaces can't have constructors, punt to global scope
Modified: trunk/giscanner/utils.py
==============================================================================
--- trunk/giscanner/utils.py (original)
+++ trunk/giscanner/utils.py Sun Aug 31 15:56:56 2008
@@ -51,6 +51,6 @@
def strip_common_prefix(first, second):
second = second.replace('_', '')
for i, c in enumerate(first.upper()):
- if c != second[i]:
+ if c != second[i] or c > len(second):
break
return second[i:]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]