Report on Phyton scripting I used

Posted on
Sun Jan 21, 2018 10:37 am
Turribeach offline
Posts: 429
Joined: Feb 06, 2015
Location: London, UK

Report on Phyton scripting I used

Over the years I have done several Phython scripting solutions embedded and on files. I find it hard sometimes to remember where things are so I want to move all scripting to files and document it in such a way that I know what is calling each script. Is there any way to programatically report where scripting is used in triggers/action groups/etc, embedded or in a file? What do people do to keep track of which scripts are being called by what object?

Thanks!

Posted on
Sun Jan 21, 2018 5:11 pm
DaveL17 offline
User avatar
Posts: 6744
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Report on Phyton scripting I used

Personally, I run my scripts as embedded scripts where ever possible and keep all of the scripts in one folder. I don't log each script when it's executed but I do want to know when something has gone wrong and where the error came from. So within each script I include an except block with the following construct:

Code: Select all
except ValueError as error:
    indigo.server.log(u"ValueError: {0}".format(error), isError=True, type="script_name.py")

So when an error crops up, the error message will include "script_name" so I know where to look.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests

cron