pycharm suppress xxx not defined

Posted on
Thu May 09, 2019 10:33 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

pycharm suppress xxx not defined

doing a code inspection I get "indigo" not defined --- yes thats true, as it is not included in the plugin..

any idea how to stop the 1000+ messages that indigo is not defined?

thanks

Karl

Posted on
Fri May 10, 2019 4:09 am
autolog offline
Posts: 3991
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: pycharm suppress xxx not defined

Try adding this code at the top of the plugin:
Code: Select all
try:
    # noinspection PyUnresolvedReferences
    import indigo
except ImportError:
    pass


Hope this helps. :)

Posted on
Fri May 10, 2019 5:46 am
DaveL17 offline
User avatar
Posts: 6756
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: pycharm suppress xxx not defined

autolog wrote:
Try adding this code at the top of the plugin:
Code: Select all
try:
    # noinspection PyUnresolvedReferences
    import indigo
except ImportError:
    pass


Hope this helps. :)

I do what Jon does (without the noinspection flag.) I get one inspection error (that it can't find Indigo), but all the other inspection messages are silenced.

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

[My Plugins] - [My Forums]

Posted on
Fri May 10, 2019 8:28 am
jay (support) offline
Site Admin
User avatar
Posts: 18221
Joined: Mar 19, 2008
Location: Austin, Texas

Re: pycharm suppress xxx not defined

There's also a project setting under inspections to turn off all unresolved references, and you can set how those sorts of inspections are called out (color, style, etc), though if I recall it's somewhat buried.

I just do the try import block as well (so it's only once at the top) and set the inspection indicator to be something less intrusive.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 10 guests

cron