On Fri, Apr 27, 2012 at 2:29 PM, Yousef Hurfoush <ba...@msn.com> wrote:
>
>> With bl_info - you probably want to load it without running any
>> blender code (importing bpy for eg).
>>
>> check on addon_utils.py, fake_module().
> thanks, i checked it, and it does the same almost :) as my script here:
> http://www.pasteall.org/31285/python
>
> so in the end, no clean way to do it.
>
> Regards
> Yousef Harfoush
> ba...@msn.com

Wouldn't say that - IMHO using AST is clean enough,
checked your code and while its doing roughly the same thing by
scanning for bl_info, but its using eval() which means someone could
create a malicious bl_info that runs code on your system.

You can avoid scanning for bl_info with ast, just load the python file
data and extract the dict (without execution), when fake_module(...,
speedy=False), this is what happens, it just turned out to be faster
to only parse the file header.
_______________________________________________
Bf-committers mailing list
Bf-committers@blender.org
http://lists.blender.org/mailman/listinfo/bf-committers

Reply via email to