Modified:
/trunk/java2python/compiler/template.py
/trunk/java2python/config/default.py
/trunk/java2python/mod/basic.py
=======================================
--- /trunk/java2python/compiler/template.py Thu Oct 27 16:16:24 2011
+++ /trunk/java2python/compiler/template.py Sat Oct 29 22:05:12 2011
@@ -403,7 +403,9 @@
def iterBases(self):
""" Yields the base classes for this type. """
- return iter(self.bases or ['object'])
+ for handler in self.configHandlers('Base'):
+ for base in handler(self):
+ yield base
def iterDecl(self):
""" Yields the declaration for this type. """
=======================================
--- /trunk/java2python/config/default.py Thu Oct 27 16:16:24 2011
+++ /trunk/java2python/config/default.py Sat Oct 29 22:05:12 2011
@@ -48,6 +48,13 @@
basic.simpleDocString,
]
+classBaseHandlers = [
+ basic.defaultBases,
+]
+
+interfaceBaseHandlers = [
+ basic.zopeInterfaceBases,
+]
# These generators are called after a class has been completely
# generated. The class content sorter sorts the methods of a class by
=======================================
--- /trunk/java2python/mod/basic.py Thu Oct 27 16:16:24 2011
+++ /trunk/java2python/mod/basic.py Sat Oct 29 22:05:12 2011
@@ -172,3 +172,10 @@
if method.parameters and method.parameters[0]['name'] == 'self':
method.parameters.pop(0)
+
+def defaultBases(obj):
+ return iter(obj.bases or ['object'])
+
+
+def zopeInterfaceBases(obj):
+ return ['zope.interface.Interface']