planetfederal / qgis-webappbuilder-plugin

GNU General Public License v3.0
18 stars 20 forks source link

Show a nice warning message when Connect is not installed #431

Closed gioman closed 6 years ago

gioman commented 6 years ago

Instead of:

Traceback (most recent call last): File "/home/giovanni/.qgis2/python/plugins/webappbuilder/webappbuilder_plugin.py", line 83, in run utils.resetCachedToken() File "/home/giovanni/.qgis2/python/plugins/webappbuilder/utils.py", line 208, in resetCachedToken from boundlessconnect import connect ImportError: cannot import name connect

luipir commented 6 years ago

a proposal. in case connect is not installed the BuildApp can be disabled. Is it feasible?

gioman commented 6 years ago

sounds good to me.

luipir commented 6 years ago

@gioman can you modify utils.py the funcion resetCachedToken with and see if the exception is sill intercepted?

def resetCachedToken():

global __cachedToken

__cachedToken = None

try:

    from boundlessconnect import connect

except:

    pass

else:

    connect.resetToken()

luipir commented 6 years ago

the message is generally gentle getting the tocken... the exception is raised on ly during toker regeneration => expiration

volaya commented 6 years ago

I think better to show a message saying htat connect is required, instead of disabling the button

Reason for this is that the user wint figuerut hat is disabled, and even if he installs connect, he will have to reload QGIS for that to take effect. If we just show a mesage telling to install Connect in case there is an exception, that provides UX

If you agree, i can add that

On Tue, Oct 17, 2017 at 3:53 PM, Luigi Pirelli notifications@github.com wrote:

@gioman https://github.com/gioman can you modify utils.py the funcion resetCachedToken with and see if the exception is sill intercepted?

def resetCachedToken(): global cachedToken cachedToken = None try: from boundlessconnect import connect except: pass else: connect.resetToken()

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/boundlessgeo/qgis-webappbuilder-plugin/issues/431#issuecomment-337238768, or mute the thread https://github.com/notifications/unsubscribe-auth/ACARk_Qr3H-LvViQ_KraqAEkPCXgudI5ks5stLFwgaJpZM4P8LMP .

-- Victor Olaya Software Engineer | Boundless http://boundlessgeo.com/ volaya@boundlessgeo.com @boundlessgeo http://twitter.com/boundlessgeo/

luipir commented 6 years ago

@volaya +1