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

tidying up & attempted layergroup creation #75

Merged
merged 5 commits into from
May 6, 2022

Conversation

jeafreezy
Copy link
Contributor

In an attempt to work on issue 64, I wrote a function to handle layergroup creation.

There are a few TODOs which highlighted in the code because Implementing some will change the location of some functions.

Also, I didn't attempt 2,3,4 in the issue because I want to get a review on this before I attempt other functions.

I look forward to your response.

Copy link
Collaborator

@Zeitsperre Zeitsperre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not the maintainer, but here are a few comments that I think might help the code styling. Feel free to address or disregard.

setup.py Outdated Show resolved Hide resolved
geo/Geoserver.py Outdated Show resolved Hide resolved
geo/Geoserver.py Outdated Show resolved Hide resolved
geo/Geoserver.py Outdated Show resolved Hide resolved
geo/Geoserver.py Outdated Show resolved Hide resolved
geo/Geoserver.py Outdated Show resolved Hide resolved
geo/Geoserver.py Outdated Show resolved Hide resolved
geo/Geoserver.py Outdated Show resolved Hide resolved
geo/Geoserver.py Outdated Show resolved Hide resolved
geo/Calculation_gdal.py Outdated Show resolved Hide resolved
@jeafreezy
Copy link
Contributor Author

Hi @Zeitsperre , thank you for taking time to review the PR. I will make necessary fixes now and reopen.

@iamtekson iamtekson self-requested a review May 2, 2022 15:19
@iamtekson
Copy link
Collaborator

First of all, Thank you very much @jeafreezy for your valuable contribution to this package. Also thank you very much @Zeitsperre for your quick review. Before merging it into the master branch, I will also review the changes. I will manage some time this week.

@jeafreezy
Copy link
Contributor Author

Sounds good.! Thanks for the great work @iamtekson!

Copy link
Collaborator

@iamtekson iamtekson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good to me. I think we can merge it to the main and release a new version after solving my comments. Thank you very much Emmanuel for this PR.

@@ -70,7 +90,7 @@ def get_manifest(self):

def get_version(self):
"""
Returns the version of the geoserver.
Returns the version of the geoserver as JSON. It contains only the details of the high level components: GeoServer, GeoTools, and GeoWebCache
"""
try:
url = "{}/rest/about/version.json".format(self.service_url)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the rest parameter from url. I think it is needed to check for all the requests.

def get_layer(self, layer_name: str, workspace: Optional[str] = None):
"""
Returns the layer by layer name.
"""
try:
url = "{}/rest/layers/{}".format(self.service_url, layer_name)
url = "{}/layers/{}".format(self.service_url, layer_name)
if workspace is not None:
url = "{}/rest/workspaces/{}/layers/{}".format(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, Need to remove rest from url.

):
self.service_url = service_url
self.username = username
self.password = password

# private request method to reduce repetition of putting auth(username,password) in all requests call. DRY principle

def _requests(self, method: str, url: str, **kwargs) -> requests.Response:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very useful. We can integrate this method in the next PR/release.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright. Will do

@jeafreezy
Copy link
Contributor Author

Thanks for the review @iamtekson , will implement the corrections and attempt other methods of the layer group

@iamtekson iamtekson merged commit 55c48c0 into gicait:master May 6, 2022
iamtekson added a commit that referenced this pull request May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants