Adding a new binding for Python Scripts
Hi everybody and a good new ZYear ;-), I need to add some textual info (docstring) to all Python Scripts. I see three possible solutions for that: 1. Patching Python Script Product to add one more property additional to the title property 2. Patching Python Script Product to add one more binding varable 3. Adding a special variable declaration and parsing the body of the script to retrieve the text. The body of scrips is parsed for syntax errors, but is it possible to get the values of variables without calling the script? Has anybody done something like this before or can give some ideas, hints etc.? -- Thanks for your help, SK
Sebastian Krollmann wrote at 2004-1-2 12:34 +0100:
I need to add some textual info (docstring) to all Python Scripts. I see three possible solutions for that:
1. Patching Python Script Product to add one more property additional to the title property 2. Patching Python Script Product to add one more binding varable 3. Adding a special variable declaration and parsing the body of the script to retrieve the text. The body of scrips is parsed for syntax errors, but is it possible to get the values of variables without calling the script?
Has anybody done something like this before or can give some ideas, hints etc.?
I would take PythonScript's "title" handling as a blueprint... -- Dieter
Hi Dieter, thanks for your reply.
I would take PythonScript's "title" handling as a blueprint... With an additional property for script's I have one problem. What will happen, if I add a property and remove the patch afterwards? Will they break as normal scripts do not have additional properties?
-- SK
Sebastian Krollmann wrote at 2004-1-7 09:38 +0100:
thanks for your reply.
I would take PythonScript's "title" handling as a blueprint... With an additional property for script's I have one problem. What will happen, if I add a property and remove the patch afterwards? Will they break as normal scripts do not have additional properties?
Do not worry: When you remove the patch, some of your PythonScripts will have an attribute that is no longer interpreted. Nothing else will happen. -- Dieter
participants (2)
-
Dieter Maurer -
Sebastian Krollmann