-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove deprecated server validation use #648
base: master
Are you sure you want to change the base?
Conversation
In Python, if you want to remove the use of deprecated server authentication, it depends on the specific library or framework you're using. For example, in some cases related to HTTP requests, you might need to update the way you handle authentication methods. Let's say you were using an older version of urllib and had some deprecated server auth code like this: import urllib.request Old deprecated way (for example's sake, might not be actual deprecated code like this)auth_handler = urllib.request.HTTPBasicAuthHandler() You'd need to switch to a more modern and recommended approach. For instance, using requests library which has a cleaner and up-to-date way to handle authentication: import requests Using requests for authenticationresponse = requests.get('https://example.com', auth=('username', 'password')) |
mc = MerginClient(url, proxy_config=get_qgis_proxy_config(url)) | ||
if not mc.is_server_compatible(): | ||
return "Incompatible Mergin Maps server" | ||
_ = MerginClient(url, proxy_config=get_qgis_proxy_config(url)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The python convention is to use _
as a throwaway when we absolutely need place holder variable (e.g unpack variables), here I think we can just remove it altogether
_ = MerginClient(url, proxy_config=get_qgis_proxy_config(url)) | |
MerginClient(url, proxy_config=get_qgis_proxy_config(url)) |
@@ -1223,7 +1222,7 @@ def test_server_connection(url, username, password): | |||
result = True, "<font color=green> OK </font>" | |||
proxy_config = get_qgis_proxy_config(url) | |||
try: | |||
mc = MerginClient(url, None, username, password, get_plugin_version(), proxy_config) | |||
_ = MerginClient(url, None, username, password, get_plugin_version(), proxy_config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above
As a follow-up of MerginMaps/python-api-client#223. Removes outdated validation of a server URL.
Requires a new py-api release.