-
Notifications
You must be signed in to change notification settings - Fork 78
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
Conversation
There was a problem hiding this 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.
Hi @Zeitsperre , thank you for taking time to review the PR. I will make necessary fixes now and reopen. |
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. |
Sounds good.! Thanks for the great work @iamtekson! |
There was a problem hiding this 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) |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright. Will do
Thanks for the review @iamtekson , will implement the corrections and attempt other methods of the layer group |
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.