-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
> def awake(self.trans):
> for baseclass in self.__class__.__bases__
> if ... (code to check if the method exists?):
> baseclass.awake(self, trans)
> break
> self.initPSP()
>
> This should should hopefully make calling the awake method simular to how
> Python looks up methods in parent classes.... So the first class to
> implement the method is the one which gets used for that method.
Okay... I've implemented this change... and it looks like it works wonderfully
=)
See attached patch.
Now.... how does one get a patch into the webware tree? =)
- --
Luke Holden
eBI Solutions
Main: (949) 387-5182
Email: [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQE+G6lB3q5xXfLZTQkRAs+GAKCVGnXLSbQGMAzr1Mahck4BQ2z/yQCfV4z1
wFeYP22qoOOPW63x2U6JNCo=
=r3tb
-----END PGP SIGNATURE-----
--- ParseEventHandler.py 2002-10-24 15:24:18.000000000 -0700
+++ ParseEventHandler_lholden.py 2003-01-07 20:26:22.000000000 -0800
@@ -328,11 +328,19 @@
self._writer.println()
if not AwakeCreated:
self._writer.println('def awake(self,trans):')
self._writer.pushIndent()
- self._writer.println('self.__class__.__bases__[0]'+'.awake(self, trans)\n')
+## self._writer.println('self.__class__.__bases__[0]'+'.awake(self, trans)\n')
+ self._writer.println('for baseclass in self.__class__.__bases__:')
+ self._writer.pushIndent()
+ self._writer.println('if hasattr(baseclass, "awake"):')
+ self._writer.pushIndent()
+ self._writer.println('baseclass.awake(self, trans)')
+ self._writer.println('break\n')
+ self._writer.popIndent()
+ self._writer.popIndent()
##commented out for new awake version per conversation w/ chuck
## self._writer.println('if "init" in dir(self) and type(self.init) == type(self.__init__):\n')
## self._writer.pushIndent()
## self._writer.println('self.init()\n')
## self._writer.popIndent()