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

Changes #2

Merged
merged 2 commits into from
Nov 23, 2023
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
2 changes: 1 addition & 1 deletion .generation/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ backendTag = pro-nightly-2023-11-14
[package]
name = geoengine_openapi_client
version = 0.0.1
url = https://github.com/geo-engine/geoengine-python-sys
url = https://github.com/geo-engine/geoengine-python-openapi-client
3 changes: 2 additions & 1 deletion .generation/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
)

# Remove the test directory, since it will not be overwritten by the generator.
shutil.rmtree("test")
if os.path.isdir("test"):
shutil.rmtree("test")

# Run the generator.
subprocess.run(
Expand Down
43 changes: 0 additions & 43 deletions .generation/post_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,6 @@ def api_client_py(file_contents: List[str]) -> Generator[str, None, None]:
resource_path = resource_path.partition("?")[0]
'''), 2 * INDENT) + '\n' + line

elif dedented_line.startswith('''with open(n, 'rb') as f:'''):
line = indent(dedent('''\
# Note: added support to upload data from RAM
if isinstance(n, tuple):
filename = n[0]
filedata = n[1]

mimetype = (mimetypes.guess_type(filename)[0] or
'application/octet-stream')
params.append(
tuple([k, tuple([filename, filedata, mimetype])]))

continue
'''), 5 * INDENT) + '\n' + line

yield line

def exceptions_py(file_contents: List[str]) -> Generator[str, None, None]:
Expand All @@ -100,32 +85,6 @@ def exceptions_py(file_contents: List[str]) -> Generator[str, None, None]:

yield line

def uploads_api_py(file_contents: List[str]) -> Generator[str, None, None]:
'''Modify the uploads_api.py file.'''
for line in file_contents:
dedented_line = dedent(line)

if line.startswith('from typing import'):
line = line + '\n' + dedent('''\
# Note: added support to upload data from RAM
from typing import Tuple

''')

elif dedented_line.startswith('def upload_handler(self,'):
line = indent(dedent('''\
# Note: added support to upload data from RAM
def upload_handler(self, files : conlist(Union[StrictBytes, StrictStr, Tuple[str, Union[StrictBytes, StrictStr]]]), **kwargs) -> AddCollection200Response: # noqa: E501
'''), INDENT)

elif dedented_line.startswith('def upload_handler_with_http_info(self,'):
line = indent(dedent('''\
# Note: added support to upload data from RAM
def upload_handler_with_http_info(self, files : conlist(Union[StrictBytes, StrictStr, Tuple[str, Union[StrictBytes, StrictStr]]]), **kwargs) -> ApiResponse: # noqa: E501
'''), INDENT)

yield line

def linear_gradient_with_type_py(file_contents: List[str]) -> Generator[str, None, None]:
'''Modify the linear_gradient_with_type.py file.'''
for line in file_contents:
Expand Down Expand Up @@ -210,8 +169,6 @@ def task_status_with_id_py(file_contents: List[str]) -> Generator[str, None, Non
modify_file(input_file, api_client_py)
elif input_file.name == 'exceptions.py':
modify_file(input_file, exceptions_py)
elif input_file.name == 'uploads_api.py':
modify_file(input_file, uploads_api_py)
elif input_file.name == 'linear_gradient_with_type.py':
modify_file(input_file, linear_gradient_with_type_py)
elif input_file.name == 'logarithmic_gradient_with_type.py':
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Temp files
.mypy_cache
.pytest_cache


test/__pycache__
10 changes: 2 additions & 8 deletions geoengine_openapi_client/api/uploads_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@

from typing import Union

# Note: added support to upload data from RAM
from typing import Tuple


from geoengine_openapi_client.models.add_collection200_response import AddCollection200Response
from geoengine_openapi_client.models.upload_files_response import UploadFilesResponse

Expand Down Expand Up @@ -340,8 +336,7 @@ def list_upload_files_handler_with_http_info(self, upload_id : Annotated[StrictS
_request_auth=_params.get('_request_auth'))

@validate_arguments
# Note: added support to upload data from RAM
def upload_handler(self, files : conlist(Union[StrictBytes, StrictStr, Tuple[str, Union[StrictBytes, StrictStr]]]), **kwargs) -> AddCollection200Response: # noqa: E501
def upload_handler(self, files : conlist(Union[StrictBytes, StrictStr]), **kwargs) -> AddCollection200Response: # noqa: E501
"""Uploads files. # noqa: E501

Uploads files. # noqa: E501
Expand Down Expand Up @@ -371,8 +366,7 @@ def upload_handler(self, files : conlist(Union[StrictBytes, StrictStr, Tuple[str
return self.upload_handler_with_http_info(files, **kwargs) # noqa: E501

@validate_arguments
# Note: added support to upload data from RAM
def upload_handler_with_http_info(self, files : conlist(Union[StrictBytes, StrictStr, Tuple[str, Union[StrictBytes, StrictStr]]]), **kwargs) -> ApiResponse: # noqa: E501
def upload_handler_with_http_info(self, files : conlist(Union[StrictBytes, StrictStr]), **kwargs) -> ApiResponse: # noqa: E501
"""Uploads files. # noqa: E501

Uploads files. # noqa: E501
Expand Down
12 changes: 0 additions & 12 deletions geoengine_openapi_client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,18 +580,6 @@ def files_parameters(self, files=None):
continue
file_names = v if type(v) is list else [v]
for n in file_names:
# Note: added support to upload data from RAM
if isinstance(n, tuple):
filename = n[0]
filedata = n[1]

mimetype = (mimetypes.guess_type(filename)[0] or
'application/octet-stream')
params.append(
tuple([k, tuple([filename, filedata, mimetype])]))

continue

with open(n, 'rb') as f:
filename = os.path.basename(f.name)
filedata = f.read()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
description="Geo Engine Pro API",
author="Geo Engine Developers",
author_email="dev@geoengine.de",
url="https://github.com/geo-engine/geoengine-python-sys",
url="https://github.com/geo-engine/geoengine-python-openapi-client",
keywords=["OpenAPI", "OpenAPI-Generator", "Geo Engine Pro API"],
install_requires=REQUIRES,
packages=find_packages(exclude=["test", "tests"]),
Expand Down
Binary file removed test/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.