Parse Pd files using user defined filters. >>> p = PdParser("patches/parser-test.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="semicolon-test", type="#X", action="msg") >>> p.add_filter_method(found, object="osc~") >>> p.parse() canvasStack: ['patches/parser-test.pd', 'REFERENCE'] type: #X action: text arguments: 135 336 Tags: tag_one \, tag_two canvasStack: ['patches/parser-test.pd', 'REFERENCE'] type: #X action: text arguments: 115 301 Description: Some kind of verbose description here. canvasStack: ['patches/parser-test.pd', 'REFERENCE'] type: #X action: text arguments: 114 121 Name: thing canvasStack: ['patches/parser-test.pd', 'REFERENCE'] type: #X action: text arguments: 114 174 Argument 0: first argument (required) canvasStack: ['patches/parser-test.pd', 'REFERENCE'] type: #X action: text arguments: 114 194 Argument 1: second argument (optional) canvasStack: ['patches/parser-test.pd', 'REFERENCE'] type: #X action: text arguments: 114 214 Inlet 0: my first inlet is blah canvasStack: ['patches/parser-test.pd', 'REFERENCE'] type: #X action: text arguments: 114 234 Inlet 1: msg1 : what this message does. msg2 : what this other message does \, default 0 which is the default canvasStack: ['patches/parser-test.pd', 'REFERENCE'] type: #X action: text arguments: 114 278 Outlet 0: what comes out the second outlet. canvasStack: ['patches/parser-test.pd', 'REFERENCE'] type: #X action: text arguments: 113 141 Summary: what this thing does is blah blah blah canvasStack: ['patches/parser-test.pd'] type: #X action: obj arguments: 471 83 osc~ 220 canvasStack: ['patches/parser-test.pd', 'semicolon-test'] type: #X action: msg arguments: 10 18 this is a message box \, with comments \, and also \; semicolons! yes it is. it's like this: yo. test \; test \; test \; canvasStack: ['patches/parser-test.pd'] type: #X action: obj arguments: 633 213 osc~ 440 49