Skip to content
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

CI: Move workflows to the correct path #5

Merged
merged 2 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions elorus/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def handle_file_download(self, response):
filename = filename_kv[1]
return filename, response.content

def _handle_response(self, response):
def _handle_response(self, response: httpx.Response):
if response.headers.get("Content-Type", "").lower() == "application/pdf":
return self.handle_file_download(response)

Expand Down Expand Up @@ -108,16 +108,16 @@ def _handle_response(self, response):

def _handle_request(
self, method: str, path: str, payload: Optional[dict] = None, **kwargs
):
) -> httpx.Response:
auth = self._get_auth()
url = f"{self.base_url}/{self.api_version}/{path}"
with httpx.Client(auth=auth) as client:
response = client.request(method, url, json=payload, **kwargs)
return self._handle_response(response)


class SubClient:
client = Client
class SubClient(Client):
client: Client

def __init__(self, client: Client):
self.client = client
Expand Down