Plugin interaction at the scripting shell?

Posted on
Mon Nov 11, 2019 3:18 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Plugin interaction at the scripting shell?

My Tesla plugin keeps throwing HTTP 408 timeout errors for users, and i've finally got it throwing them on my copy.

I know that restarting the plugin will fix it for a period of time, so I'm hoping to interact with my plugin, querying values of eg self.vehicles, self.connection.auth['expiry] etc, from the scripting shell.

Can I "get in" to my plugins' context and use things like self.vehicles and self.doCommand() at all? Or plugin[com.howartp.tesla].doCommand() etc?

Basically I don't want to have to preempt what info I might need by dumping it to the log, I want to interrogate the current values of the running instance.

Peter

Posted on
Mon Nov 11, 2019 3:48 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Plugin interaction at the scripting shell?

You can't "attach" to a running plugin (I don't think). But you can do the Reload in Interactive Shell from your plugin menu and then just leave that shell open until you start seeing issues. Then you can use it to inspect away.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Nov 11, 2019 3:52 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Plugin interaction at the scripting shell?

Ah... that'll do nicely!

Thanks, I hadn't turned on debug menus cos I don't yet use the debuggers!

Posted on
Mon Nov 11, 2019 4:34 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Plugin interaction at the scripting shell?

howartp wrote:
I don't yet use the debuggers!


You should! :wink:

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Nov 11, 2019 6:09 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Plugin interaction at the scripting shell?

I code on Windows though, so I need to work out if/how to attach a debugger from there.

My mac is essentially headless.


Sent from my iPhone using Tapatalk Pro

Posted on
Tue Nov 12, 2019 10:53 am
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Plugin interaction at the scripting shell?

In that case, you'll need to use pdb or PuDB (preinstalled by Indigo) which are console-based. We have a making PyCharm debugging working remotely on our todo list but it really hasn't been much of a problem thus far (your Windows use notwithstanding)... ;)

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Nov 12, 2019 12:09 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Plugin interaction at the scripting shell?

jay (support) wrote:
In that case, you'll need to use pdb or PuDB (preinstalled by Indigo) which are console-based. We have a making PyCharm debugging working remotely on our todo list but it really hasn't been much of a problem thus far (your Windows use notwithstanding)... ;)

I only read the first line earlier.

Just been looking at pycharm and wondered if Indigo supported the remote debugging option so came here to ask - then noticed the rest of your reply!

It seems you just need to expose the setting for the path, so instead of looking for pycharm at localhost:12345 you can look at mySuperiorPC:12345

I think...


Sent from my iPhone using Tapatalk Pro

Posted on
Tue Nov 12, 2019 3:36 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Plugin interaction at the scripting shell?

Perhaps - we hardcoded it because 1) it didn't require any UI changes beyond the popup to turn on debugging 2) QA was much easier to do just running locally (didn't have to set up a remote debug testing environment and then figure out the issues that would almost certainly ensue) and 3) we honestly didn't think many (any?) would need it.

We certainly didn't think a Windoze dude would! :lol:

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Tue Nov 12, 2019 4:15 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Plugin interaction at the scripting shell?

I keep telling you - a Windows client is next on your list...!


Sent from my iPhone using Tapatalk Pro

Posted on
Tue Nov 12, 2019 5:18 pm
jay (support) offline
Site Admin
User avatar
Posts: 18199
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Plugin interaction at the scripting shell?

howartp wrote:
I keep telling you - a Windows client is next on your list...!


Image

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests

cron