diff options
author | Matias Linares <matias.linares@comprandoengrupo.net> | 2024-10-29 18:12:20 -0300 |
---|---|---|
committer | Matias Linares <matias.linares@comprandoengrupo.net> | 2024-10-30 16:26:35 -0300 |
commit | d46b4e7470e3115df34fc96ba2f8e59974f713be (patch) | |
tree | 04de00684a353c969bbe52fb96d658d0144ccdbf /kodereviewer/network_manager.py | |
parent | a88655cd202dc43a64a7107f6f533bd386079386 (diff) | |
download | kodereviewer-d46b4e7470e3115df34fc96ba2f8e59974f713be.tar.gz |
Split PullRequestPage into different ScrollablePages
Diffstat (limited to 'kodereviewer/network_manager.py')
-rw-r--r-- | kodereviewer/network_manager.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/kodereviewer/network_manager.py b/kodereviewer/network_manager.py index 089e69e..cbe5160 100644 --- a/kodereviewer/network_manager.py +++ b/kodereviewer/network_manager.py @@ -83,7 +83,14 @@ class NetworkManager(QObject): pull_request_number = int(match.groups()[0]) pull_request = self._project.find_pull_request(pull_request_number) if pull_request is not None: - pull_request.load_comments(response_body) + + # List + if reply.operation() == QNetworkAccessManager.Operation.GetOperation: + pull_request.load_comments(response_body) + elif reply.operation() == QNetworkAccessManager.Operation.PostOperation: + logger.info(response_body) + else: + logger.info("Pero la puta") elif (match := FILE_LIST_URL.search(reply.url().toString())): pull_request_number = int(match.groups()[0]) pull_request: Optional[PullRequest] = self._project.find_pull_request(pull_request_number) @@ -109,6 +116,16 @@ class NetworkManager(QObject): self._request_factory.createRequest(f'/issues/{number}/comments') ) + @Slot(int, str) + def createComment(self, number: int, comment: str) -> None: + request = self._request_factory.createRequest( + f'/issues/{number}/comments' + ) + data = { + 'body': comment + } + self._manager.post(request, json.dumps(data).encode()) + @Slot(int) def getFiles(self, pull_request_number) -> None: self._manager.get( |