[z3-five] Five patch when using "runtime" products

Simon Eisenmann simon at struktur.de
Sat Sep 18 19:32:11 MEST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

today i tried Five with icoya and found a small issue with Five not
working when having some constructs like
sys.modules[Products.SomeProduct]=something cause such modules dont have
a __file__ attribute. Five should just ignore such runtime products,
which are used quite often, to allow migration of old products.
attached a small patch for the current svn trunk of Five.

What is required to get checkin permissions to Five?

Best regards,
~ Simon
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFBTHDvcKXkdvrBGTARAnSoAKCts0QOCgn/n8MxzWbd0+m0eCT6BgCeILjK
/B6hYvT+kCPJorNO27qdxv0=
=35Wp
-----END PGP SIGNATURE-----
-------------- next part --------------
Index: fiveconfigure.py
===================================================================
--- fiveconfigure.py	(revision 6578)
+++ fiveconfigure.py	(working copy)
@@ -37,12 +37,14 @@
 
     # first load meta.zcml files
     for product in products:
+        if not hasattr(product, '__file__'): continue
         zcml = os.path.join(os.path.dirname(product.__file__), 'meta.zcml')
         if os.path.isfile(zcml):
             xmlconfig.include(_context, zcml, package=product)
 
     # now load their configure.zcml
     for product in products:
+        if not hasattr(product, '__file__'): continue
         zcml = os.path.join(os.path.dirname(product.__file__),
                             'configure.zcml')
         if os.path.isfile(zcml):
@@ -50,6 +52,7 @@
 
 def loadProductsOverrides(_context):
     for product in findProducts():
+        if not hasattr(product, '__file__'): continue
         zcml = os.path.join(os.path.dirname(product.__file__),
                             'overrides.zcml')
         if os.path.isfile(zcml):


More information about the z3-five mailing list