-
Notifications
You must be signed in to change notification settings - Fork 243
/
Copy pathInterface3.py
49 lines (37 loc) · 1.3 KB
/
Interface3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
##
# This is an example of how to perform per-module configuration
# for translating java interfaces to zope interfaces.
#
from java2python.mod import basic
from java2python.config import default
# the j2py default head handlers for interfaces includes ABCMeta as a
# metaclass. we certainly don't want that, so we redefine the list
# here to only the doc string handler:
interfaceHeadHandlers = [
basic.simpleDocString,
]
# this j2py default is also not what we want, so we redefine it:
methodPrologueHandlers = [
basic.maybeClassMethod,
]
# instead of the default bases, this handler supplies the base zope
# Interface class for Java interfaces:
interfaceBaseHandlers = [
basic.zopeInterfaceBases,
]
# the parser adds implemented interfaces to the class bases list.
# this handler checks to see if any of those bases are interfaces, and
# if so, suppresses them in favor of 'object' as the only base:
classBaseHandlers = [
basic.zopeImplementsClassBases,
]
# this handler adds a line like "zope.interface.implements(IFoo)" for
# each interface implemented by a Java class:
classHeadHandlers = [
basic.zopeImplementsClassHead,
]
# this handler suppresses the "self" parameter on method signatures for
# zope Interface definitions:
methodParamHandlers = [
basic.zopeInterfaceMethodParams,
]