+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.
+
2008-08-31 Johan Dahlin <johan@gnome.org>
* gir/Makefile.am:
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)
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
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:]