RE: [Zope] Object File Size...
Hi Thierry, Do you have an example of how I can do this in a dtml-var ? Regards, Michael -----Original Message----- From: Thierry Florac [mailto:thierry.florac@onf.fr] Sent: Wednesday, 3 July 2002 4:51 PM To: Michael Fox Cc: zope@zope.org Subject: Re: [Zope] Object File Size... I think you should use the "get_size" method provided by external files... Thierry On Wed, 2002-07-03 at 08:34, Michael Fox wrote:
Hi *,
How can I render an object's file size in a DTML Document, similar to "Size" in the Zope management interface?
eg.
Type Name Size Last Modified [External File] myfile.exe [External Editor] 2.38 Mb 2002-07-02 13:27
^^^
Cheers, Michael
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Linux every day, keeps Dr Watson away... http://gpc.tuxfamily.org -- http://www.ulthar.net
Just do, for example: <dtml-in "objectValues('External File')"> <dtml-var "title_or_id()"> <dtml-var "get_size()"> bytes.<br> </dtml-in> Of course, this will only work for objects providing the "get_size" method... Thierry On Wed, 2002-07-03 at 08:53, Michael Fox wrote:
Hi Thierry,
Do you have an example of how I can do this in a dtml-var ?
Regards, Michael
-----Original Message----- From: Thierry Florac [mailto:thierry.florac@onf.fr] Sent: Wednesday, 3 July 2002 4:51 PM To: Michael Fox Cc: zope@zope.org Subject: Re: [Zope] Object File Size...
I think you should use the "get_size" method provided by external files...
Thierry
On Wed, 2002-07-03 at 08:34, Michael Fox wrote:
Hi *,
How can I render an object's file size in a DTML Document, similar to "Size" in the Zope management interface?
eg.
Type Name Size Last Modified [External File] myfile.exe [External Editor] 2.38 Mb 2002-07-02 13:27
^^^
Cheers, Michael
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- Linux every day, keeps Dr Watson away... http://gpc.tuxfamily.org -- http://www.ulthar.net
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Hi Can I protect my Zope code from being visible to users ? As far as I know - once a user has access into the Zope development environment then he can open the code of any ZPT or the third party products itself. Is it possible to generate compiled code in Zope ? bobby
If you put your code in an (non ZClass) python class, I suppose you could delete the .py files and let the users only see and use the .pyc files. It should be possible to do the same with zclasses. The ZODB seems to store a compiled version of all scripts (at least zope complains sometimes that scripts need recompiling), but you would have to edit PythonScript.py as far as I can see to empty the _body property while retaining the _code property. This is of course irreversable. Douwe
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Stylus Sent: Thursday, July 04, 2002 9:11 AM To: zope@zope.org Subject: [Zope] Protecting Zope Code
Hi
Can I protect my Zope code from being visible to users ? As far as I know - once a user has access into the Zope development environment then he can open the code of any ZPT or the third party products itself. Is it possible to generate compiled code in Zope ?
bobby
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Stylus wrote:
Can I protect my Zope code from being visible to users ? As far as I know - once a user has access into the Zope development environment then he can open the code of any ZPT or the third party products itself. Is it possible to generate compiled code in Zope ?
If you have installed a Python product and it contains ie. a file called "myProduct.py" the first time zope is started a file called "myProduct.pyc" is created and placed next to the original file. This is a "compiled" Python file. You can then distribute the product containing only the *.pyc files. regards Max M -- "Sorry I would Really Like To Help More On This Project, But Am To Busy Doing Paid Work On A Tight Deadline" Max M
On Thu, 4 Jul 2002 5:51 pm, Max M wrote:
Stylus wrote:
Can I protect my Zope code from being visible to users ? As far as I know - once a user has access into the Zope development environment then he can open the code of any ZPT or the third party products itself. Is it possible to generate compiled code in Zope ?
If you have installed a Python product and it contains ie. a file called "myProduct.py" the first time zope is started a file called "myProduct.pyc" is created and placed next to the original file. This is a "compiled" Python file.
You can then distribute the product containing only the *.pyc files.
... and decompyle can regenerate the source almost perfectly from *.py[c|o] files. If your bytecode is out there, your source is out there. You will have to come up with a much more elaborate scheme to protect your source. A strong license is a good start. Richard
[Max M]
Can I protect my Zope code from being visible to users ? As far as I know - once a user has access into the Zope development environment then he can open the code of any ZPT or the third party products itself. Is it possible to generate compiled code in Zope ?
If you have installed a Python product and it contains ie. a file called "myProduct.py" the first time zope is started a file called "myProduct.pyc" is created and placed next to the original file. This is a "compiled" Python file.
You can then distribute the product containing only the *.pyc files.
Except that they may not work if moved to a different directory tree. I have seen, more than once, a program fail because it was moved from the c:\ drive to the d:\ drive in Windows. The .pyc files were moved too. Deleting them got it working. I infer the the .pyc files contain information on key paths. Cheers, Tom P
participants (7)
-
douwe@oberon.nl -
Max M -
Michael Fox -
Richard Jones -
Stylus -
Thierry Florac -
Thomas B. Passin