Re[2]: [Zope] importing md5 module in python script

3205 5361 1215 9784 3205 5361 1215 9784 <keo@goa.hu>
Mon, 21 Oct 2002 13:43:39 +0200


Hello Chris,

Monday, October 21, 2002, 7:07:04 AM, you wrote:


CM> This is because the object returned by new() is unprotected (you can't
CM> make any security assertions on things of its type because it is
CM> returned only by a factory method) and unprotectable (it is a C-defined
CM> Python object rather than a Python-defined Python object).  This is Zope
CM> protecting you from yourself in a cheerfully annoying way. ;-) 
CM> Workaround: use an external method instead.

thanks for your answer.

is there a way of using md5 anyway in scripts? or do i really have to
use external methods?

(thats not so easy;()


or get a purely python defined object from somewhere, and make a
product from it ... or anything ...


thanks,

k

CM> HTH,

CM> - C

 
CM> On Mon, 2002-10-21 at 00:35, keo wrote:
>> 
>> hi!
>> 
>> i want to use the md5 module,
>> 
>> i made a folder Imports, and a file __init__.py in it, containing:
>> 
>>       from Products.PythonScripts.Utility import allow_module,
>> allow_class
>>       from AccessControl import ModuleSecurityInfo, ClassSecurityInfo
>>       from Globals import InitializeClass
>> 
>>       allow_module("md5")
>> 
>> now i can import md5, and use m=md5.new(), but still cant use
>> m.hexdigest(), it  keeps on giving 401 unauthorized replies ...
>> 
>> i tried to add ModuleSecurityInfo('md5').declarePublic('hexdigest') to
>> __init__.py but didnt help.
>> 
>> 
>> what am i  doing wrong?
>> 
>> 
>> thanks,
>> 
>> 
>> k
>> 
>> 
>> 
>> 
>> _______________________________________________
>> 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 )



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


-- 
don't believe everything you think