Re: SVN: z3c.pt/trunk/ In debug mode the actual source code for file templates is written out to a <filename>.source file, to make it easier to inspect it.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hanno Schlichting wrote:
Log message for revision 87393: In debug mode the actual source code for file templates is written out to a <filename>.source file, to make it easier to inspect it.
Make debug mode setting explicit in a config.py. Currently it is bound to Python's __debug__, which is False when run with -O and otherwise True.
I don't think I would this to __debug__: I wouldn't want to pay a price either at startup time or (worse) at render time for information I don't need or want. I think looking for an environment variable would be quite reasonable instead. Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIVAmv+gerLs4ltQ4RAkMnAKChysbw0FboPfMPtSe0H2eGtGF7DgCgvK1Q XXC2UpX5L7KQ7HeGdUNr7Us= =Vofy -----END PGP SIGNATURE-----
Tres Seaver wrote:
Hanno Schlichting wrote:
Log message for revision 87393: In debug mode the actual source code for file templates is written out to a <filename>.source file, to make it easier to inspect it.
Make debug mode setting explicit in a config.py. Currently it is bound to Python's __debug__, which is False when run with -O and otherwise True.
I don't think I would this to __debug__: I wouldn't want to pay a price either at startup time or (worse) at render time for information I don't need or want.
I think looking for an environment variable would be quite reasonable instead.
I agree an environment variable is a good idea here. I'll let Malthe decide how to handle this. So far the __debug__ was used somewhere quite hidden in the code already and I only made this more obvious by moving it to a central place. Hanno
Hanno Schlichting wrote:
Log message for revision 87393: In debug mode the actual source code for file templates is written out to a <filename>.source file, to make it easier to inspect it.
Make debug mode setting explicit in a config.py. Currently it is bound to Python's __debug__, which is False when run with -O and otherwise True.
I'm not sure it's a good idea to litter the file system with these files; they'll probably confuse most users. At the same time, as far as I can tell, we do need to actually save the generated Python-code to disk to get proper debugging. Can we write them to a temporary directory? If we assign a filename based on the hash of the contents, the space occupied should be fairly limited. \malthe
Tres Seaver wrote:
I don't think I would this to __debug__: I wouldn't want to pay a price either at startup time or (worse) at render time for information I don't need or want.
Is ``devmode`` available on Zope 2? That might be a good flag to control this. \malthe
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Malthe Borch wrote:
Tres Seaver wrote:
I don't think I would this to __debug__: I wouldn't want to pay a price either at startup time or (worse) at render time for information I don't need or want.
Is ``devmode`` available on Zope 2? That might be a good flag to control this.
As I said before, I think something specific to the z3c.pt package would be sensible. E.g.: debug_source = os.environ.get('Z3C_PT_DEBUG_SOURCE', 'No') debug_source = debug_source .lower() in ('yes', 'true', on) or some such. Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFIVXh8+gerLs4ltQ4RAij6AKCq2y7JLBoRpk7U8lKnYjSTmKD9RACfWNA5 G9dfwmxI7nOn3J3MHbw9wwg= =S5WL -----END PGP SIGNATURE-----
Tres Seaver wrote:
Malthe Borch wrote:
Tres Seaver wrote:
I don't think I would this to __debug__: I wouldn't want to pay a price either at startup time or (worse) at render time for information I don't need or want. Is ``devmode`` available on Zope 2? That might be a good flag to control this.
As I said before, I think something specific to the z3c.pt package would be sensible.
That seems to be the best approach here indeed. I implemented this very closely to your suggestion now. Thanks, Hanno
participants (3)
-
Hanno Schlichting -
Malthe Borch -
Tres Seaver