Chris Withers wrote at 2005-9-29 09:17 +0100:
>...zdb in this case.
>
>I need to make a "global recompile" function available, since zdb 
>requires the co_filename attribute of the script's func_code object to 
>be set to something meaningful, rather than the useless "Script 
>(Python)" it usually gets set to.
> ...
>Now, this breaks in 2.8, so what SHOULD I be doing to make a method 
>globally available in a way that works in both 2.7 and 2.8?

You could use part of the old style initialization, the "methods"
declaration to be precise.

You see an example in ".../Products/ZSQLMethods/__init__.py".

Be warned, however: the old style initialization puts
the declared methods on the "OFS.Folder" class.

Thus, you better choose a name that is unlikely to conflict
with other methods that might be relevant for classes
derived from "Folder"...

-- 
Dieter
_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to