Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
5b5f28ab
Commit
5b5f28ab
authored
Jun 10, 2002
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed unused "verify" module from Interface package
parent
97131918
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
37 deletions
+0
-37
lib/python/Interface/verify.py
lib/python/Interface/verify.py
+0
-37
No files found.
lib/python/Interface/verify.py
deleted
100644 → 0
View file @
97131918
from
Exceptions
import
BrokenImplementation
,
DoesNotImplement
,
BrokenMethodImplementation
from
Method
import
Method
from
types
import
FunctionType
from
_object
import
MethodTypes
def
verify_class_implementation
(
iface
,
klass
):
"""
Verify that 'klass' correctly implements 'iface'. This involves:
o Making sure the klass defines all the necessary methods
o Making sure the methods have the correct signature
o Making sure the klass asserts that it implements the interface
"""
if
not
iface
.
isImplementedByInstancesOf
(
klass
):
raise
DoesNotImplement
(
iface
)
for
n
,
d
in
iface
.
namesAndDescriptions
():
if
not
hasattr
(
klass
,
n
):
raise
BrokenImplementation
(
iface
,
n
)
attr
=
getattr
(
klass
,
n
)
if
type
(
attr
)
is
FunctionType
:
meth
=
Method
().
fromFunction
(
attr
,
n
)
elif
type
(
attr
)
in
MethodTypes
:
meth
=
Method
().
fromMethod
(
attr
,
n
)
else
:
continue
# must be an attribute...
if
d
.
getSignatureInfo
()
!=
meth
.
getSignatureInfo
():
raise
BrokenMethodImplementation
(
n
)
return
1
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment