-
Notifications
You must be signed in to change notification settings - Fork 74
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
Possible API improvements #5
Comments
Hey! Sorry for the late and short reply! :-D |
Autocompletion for what exactly? But maybe we can improve auto-completion (at least for interactive session) by explicitly setting the API endpoints as attributes instead of looking them up dynamically: class MatterMost:
def __init__(self):
self._driver = Driver()
# self._driver.login() # Useful for us, but maybe not for other users
for k, v in self._driver.api.items():
assert not hasattr(self, k)
setattr(self, k, v)
@property
def userid(self):
return self._driver.client.userid
@property
def username(self):
return self._driver.client.username |
On the other hand, |
Well I like it either way. If autocompletion improves it is a nice plus, but not having to do |
- Deprecated `Driver.api['']` calls. - Use `warnings` and `DeprecationWarning` instead of logger fix #5
- Deprecated `Driver.api['']` calls. - Use `warnings` and `DeprecationWarning` instead of logger fix #5
I like that you divided mm-driver’s functionality into several classes that we can compose and customize.
However, I think that the actual usage of the diver when calling the enpoint’s methods could be improved, so that instead of doing
we can just do:
This is relatively easy to implement in another wrapper class (maybe it can even be merged into
Driver
):@Vaelor What do you think about this?
The text was updated successfully, but these errors were encountered: