-
Notifications
You must be signed in to change notification settings - Fork 219
Register subclasses #155
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
Register subclasses #155
Conversation
|
Verified that @kelseymorris95 has signed the CLA. Thanks for the pull request! |
a3a7f68 to
c2abe1f
Compare
boxsdk/auth/jwt_auth.py
Outdated
| import jwt | ||
|
|
||
| from .oauth2 import OAuth2 | ||
| from boxsdk.util.compat import total_seconds |
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.
may as well change this import to relative as well
|
lgtm 👍 |
boxsdk/client/client.py
Outdated
| box_response = self._session.get(url, params=params) | ||
| response = box_response.json() | ||
| return [User(self._session, item['id'], item) for item in response['entries']] | ||
| return [Translator().translate('user')( |
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.
For better performance, this can be
User = Translator().translate('user')
return [User(...) for ... ]|
Two of these commits are already in master (I had squashed them before merging your previous PR). This is causing merge conflicts. To fix this, you can check out register_subclasses and run |
c52cd53 to
4962b6c
Compare
boxsdk/client/client.py
Outdated
| box_response = self._session.get(url, params=params) | ||
| response = box_response.json() | ||
| return [User(self._session, item['id'], item) for item in response['entries']] | ||
| User = Translator().translate('user') |
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.
Apparently pylint doesn't like uppercase names as variable names -_-
You can either pylint:ignore that, or change it to something like user_class.
|
👍 |
Enable custom subclasses of smart objects to be registered correctly with the
Translator.