[PD] PdParser

Husk 00 husk00 at gmail.com
Wed Dec 2 13:09:16 CET 2009


It seems usefull....thanks for share!
husk

On Wed, Dec 2, 2009 at 12:21 PM, Chris McCormick <chris at mccormick.cx> wrote:

> Hi,
>
> From the RjDj labs:
>
> PdParser can be used to parse Pd files in Python (for stuff like
> documentation
> for example).
>
> Browse here for the download:
> <http://mccormick.cx/dev/PdParser/>
>
> Or check it out with bzr:
> bzr co http://mccormick.cx/dev/PdParser/
>
> Example:
>
> (Find all objects which are comment boxes in the subpatch 'REFERENCE', and
> all
> messages boxes in the subpatch 'hello')
>
> >>> p = PdParser("my-patch.pd")
> >>>
> >>> def found(canvasStack, type, action, bits):
> ...   print "canvasStack:", canvasStack, "type:", type, "action:", action,
> "arguments:", bits
> ...
> >>> p.add_filter_method(found, canvas="REFERENCE", type="#X",
> action="text")
> >>> p.add_filter_method(found, canvas="hello", type="#X", action="msg")
> >>> print p.parse(), "elements found"
>
> Best,
>
> Chris.
>
> -------------------
> http://mccormick.cx
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management ->
> http://lists.puredata.info/listinfo/pd-list
>



-- 
If identity in the Post-modernism is nothing you can call me a
RadikalTeknoFreak Hartivist
www.estereotips.net
qeve.estereotips.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20091202/956a97e6/attachment.htm>


More information about the Pd-list mailing list