-
Notifications
You must be signed in to change notification settings - Fork 4
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
Adding language support to Birdy #164
Changes from 2 commits
4e56a27
8f4aea2
753e2fa
81bc511
42656a7
36fb394
8bf515d
70c8a3d
993aff5
eb81a32
455d158
dac80f6
6be9776
b440960
93775de
087c420
8f52aac
16c8c25
2f0b071
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,7 @@ def __init__( | |
version=WPS_DEFAULT_VERSION, | ||
caps_xml=None, | ||
desc_xml=None, | ||
language=None, | ||
): | ||
""" | ||
Args: | ||
|
@@ -63,13 +64,16 @@ def __init__( | |
verbose (str): passed to :class:`owslib.wps.WebProcessingService` | ||
progress (bool): If True, enable interactive user mode. | ||
version (str): WPS version to use. | ||
language (str): passed to :class:`owslib.wps.WebProcessingService` | ||
ex: 'fr-CA', 'en_US'. Will default to en-US. | ||
f-PLT marked this conversation as resolved.
Show resolved
Hide resolved
huard marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
self._converters = converters | ||
self._interactive = progress | ||
self._mode = ASYNC if progress else SYNC | ||
self._notebook = notebook.is_notebook() | ||
self._inputs = {} | ||
self._outputs = {} | ||
self._language = language | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not necessary (the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, right. Didn't remove this one after adding the language property functions. |
||
|
||
if not verify: | ||
import urllib3 | ||
|
@@ -102,6 +106,7 @@ def __init__( | |
verify=verify, | ||
cert=cert, | ||
skip_caps=True, | ||
language=language | ||
) | ||
|
||
try: | ||
|
@@ -125,6 +130,18 @@ def __init__( | |
|
||
self.__doc__ = utils.build_wps_client_doc(self._wps, self._processes) | ||
|
||
@property | ||
def language(self): | ||
return self._wps.language | ||
|
||
@language.setter | ||
def language(self, value): | ||
self._wps.language = value | ||
|
||
@property | ||
def languages(self): | ||
return self._wps.languages | ||
|
||
def _get_process_description(self, processes=None, xml=None): | ||
"""Return the description for each process. | ||
|
||
|
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 sure this is doing what you want for the cli... I think you want to add the language option in
_update_commands
.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.
hmm.. I added it mainly so it could be passed on for self.wps = WebProcessingService(...), so an instance of the BirdyCLI class could be initiated with a language, but it might be a lack of comprehension of how click.MultiCommand works and is used.
Should I remove the language parameter from the init and WebProcessingService instantiation and only add it as a command?
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 familiar enough with click either... I would need to check into this more.
If you want, you can focus this PR on adding language support for the client only, or find how to add it as a parameter to the cli also.
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, well I don't think adding it to the cli is bad per say, as it still is a class that has a wps as a parameter, which can receive a language parameter. It might not be a best practice for click though...
I have time to dig a bit more into click. If it turns out to be a time sink or I get submerged by other assignments, I'll revert what I changed to BirdyCli and we'll save it for a future PR.