diff options
author | jortel <devnull@localhost> | 2010-05-11 20:44:48 +0000 |
---|---|---|
committer | jortel <devnull@localhost> | 2010-05-11 20:44:48 +0000 |
commit | 02ad8ec61d3ed548dda7455e1f7c298df7b820bb (patch) | |
tree | 99db5bd9b48a7e7ab7c9641da7cc6c8d5009fee4 /suds/xsd/doctor.py | |
parent | 1c30aa44c270626740c713b22371cd1ffc230c54 (diff) | |
download | suds-02ad8ec61d3ed548dda7455e1f7c298df7b820bb.tar.gz |
Add Plugins facility. Supports hooks for onInit(), onLoad(), onSend() onReply() events.
Diffstat (limited to 'suds/xsd/doctor.py')
-rw-r--r-- | suds/xsd/doctor.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/suds/xsd/doctor.py b/suds/xsd/doctor.py index 84c9151..2ac3521 100644 --- a/suds/xsd/doctor.py +++ b/suds/xsd/doctor.py @@ -22,6 +22,7 @@ schema(s). from logging import getLogger from suds.sax import splitPrefix, Namespace from suds.sax.element import Element +from suds.plugin import Plugin log = getLogger(__name__) @@ -186,7 +187,7 @@ class Import: return 0 -class ImportDoctor(Doctor): +class ImportDoctor(Doctor, Plugin): """ Doctor used to fix missing imports. @ivar imports: A list of imports to apply. @@ -210,3 +211,10 @@ class ImportDoctor(Doctor): def examine(self, root): for imp in self.imports: imp.apply(root) + + def onLoad(self, context): + root = context.root + if root.get('name') == 'schema': + self.examine(root) + else: + pass
\ No newline at end of file |