LeMyst / WikibaseIntegrator

A Python module to manipulate data on a Wikibase instance (like Wikidata) through the MediaWiki Wikibase API and the Wikibase SPARQL endpoint.
MIT License
67 stars 12 forks source link

Add helper method to Login class #639

Open dpriskorn opened 7 months ago

dpriskorn commented 7 months ago

The current way of handling login seems broken. If I create a Login() object I have no way of knowing whether the login was successful or not.

How do we fix this so that it is dead simple?

I suggest helper method to the Login class. That way I can try logging in first and check if successful.

LeMyst commented 7 months ago

Hello @dpriskorn

When I try to set a wrong username/password/URL I always end with an adequate Exception.

Do you have an example where the Exception is not ideal?

Thank you

dpriskorn commented 7 months ago

Nope, my problem was because I put the login in a method that was never reached because of a bug in my code. Anyway I suggest we reconsider how we wat configuration and Login to work. Ideally I would like to check on all WBI objects id a connection is present and if logged in.