Skip to content

Commit

Permalink
Delete commented lines
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Garcia Silva committed Apr 7, 2021
1 parent a335000 commit f114b5f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 74 deletions.
3 changes: 0 additions & 3 deletions src/qgis_geonode/apiclient/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import uuid
from contextlib import contextmanager
from functools import partial
from types import SimpleNamespace

import qgis.core
from qgis.PyQt import (
Expand Down Expand Up @@ -279,8 +278,6 @@ def run(self):
self._reply = None
except AttributeError:
result = False
# self.network_access_manager.finished.disconnect(self._request_done)
# self.request_finished.emit()
return result

def finished(self, result: bool):
Expand Down
71 changes: 0 additions & 71 deletions src/qgis_geonode/apiclient/csw.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ def run(self) -> bool:
self.parsed_reply = parse_network_reply(self._final_reply)
self.reply_content = self._final_reply.readAll()
self._blocking_logout()
# self.network_access_manager.finished.disconnect(self._request_done)
# self.request_finished.emit()
result = self.parsed_reply.qt_error is None
else:
result = False
Expand Down Expand Up @@ -442,33 +440,13 @@ def run(self):
except RuntimeError as exc:
log(str(exc))
self._blocking_logout()
# self.network_access_manager.finished.disconnect(self._request_done)
# self.request_finished.emit()
# self.parsed_reply = parse_network_reply(self._final_reply)
result = self.parsed_reply.qt_error is None
else:
result = False
# self._first_login_reply.deleteLater()
# self._second_login_reply.deleteLater()
# self._first_login_reply.deleteLater()
# self._final_reply.deleteLater()
# self._layer_detail_api_v1_reply.deleteLater()
# self._layer_style_reply.deleteLater()
else:
result = False
return result

# def finished(self, result: bool):
# self.network_access_manager.finished.disconnect(self._request_done)
# self.parsed_reply = parse_network_reply(self._final_reply)
# if not result:
# self.api_client.error_received.emit(
# self.parsed_reply.qt_error,
# self.parsed_reply.http_status_code,
# self.parsed_reply.http_status_reason
# )
# self.request_finished.emit()

def _request_done(self, qgis_reply: qgis.core.QgsNetworkReplyContent):
"""Handle finished network requests
Expand Down Expand Up @@ -528,55 +506,6 @@ def _blocking_get_authenticated_reply(
record = None
return record

# def _blocking_get_layer_detail_v1_api(
# self, layer_title: str
# ) -> typing.Optional[typing.Dict]:
# layer_detail_url = "?".join(
# (
# f"{self.base_url}/api/layers/",
# urllib.parse.urlencode({"title": layer_title}),
# )
# )
# request = QtNetwork.QNetworkRequest(QtCore.QUrl(layer_detail_url))
# auth_manager = qgis.core.QgsApplication.authManager()
# auth_manager.updateNetworkRequest(request, self.authcfg)
# with base.wait_for_signal(self.layer_detail_api_v1_parsed, self.TIMEOUT):
# self._layer_detail_api_v1_reply = self.network_access_manager.get(request)
# if self._layer_detail_api_v1_reply.error() == QtNetwork.QNetworkReply.NoError:
# raw_layer_detail = self._layer_detail_api_v1_reply.readAll()
# layer_detail_response = json.loads(raw_layer_detail.data().decode())
# try:
# result = layer_detail_response["objects"][0]
# except (KeyError, IndexError):
# raise IOError(f"Received unexpected API response for {layer_title!r}")
# else:
# result = None
# return result

# def _blocking_get_style_detail(self, style_uri: str) -> models.BriefGeonodeStyle:
# request = QtNetwork.QNetworkRequest(QtCore.QUrl(f"{self.base_url}{style_uri}"))
# auth_manager = qgis.core.QgsApplication.authManager()
# auth_manager.updateNetworkRequest(request, self.authcfg)
# with base.wait_for_signal(self.layer_style_parsed, self.TIMEOUT):
# self._layer_style_reply = self.network_access_manager.get(request)
# if self._layer_style_reply.error() == QtNetwork.QNetworkReply.NoError:
# raw_style_detail = self._layer_style_reply.readAll()
# style_detail = json.loads(raw_style_detail.data().decode())
# sld_path = urllib.parse.urlparse(style_detail["sld_url"]).path
# result = models.BriefGeonodeStyle(
# name=style_detail["name"],
# sld_url=f"{self.base_url}{sld_path}",
# )
# else:
# parsed_reply = parse_network_reply(self._layer_style_reply)
# msg = (
# f"Received an error retrieving style detail: {parsed_reply.qt_error} - "
# f"{parsed_reply.http_status_code} - {parsed_reply.http_status_reason} "
# f"- {self._layer_style_reply.readAll()}"
# )
# raise RuntimeError(msg)
# return result


class Csw202Namespace(enum.Enum):
CSW = "http://www.opengis.net/cat/csw/2.0.2"
Expand Down

0 comments on commit f114b5f

Please sign in to comment.