Skip to content

Conversation

@kelseymorris95
Copy link
Contributor

Enable custom subclasses of smart objects to be registered correctly with the Translator.

@boxcla
Copy link

boxcla commented Aug 1, 2016

Verified that @kelseymorris95 has signed the CLA. Thanks for the pull request!

import jwt

from .oauth2 import OAuth2
from boxsdk.util.compat import total_seconds
Copy link
Contributor

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

@Jeff-Meadows
Copy link
Contributor

lgtm 👍

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')(
Copy link
Contributor

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 ... ]

@jmoldow
Copy link
Contributor

jmoldow commented Aug 1, 2016

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 git fetch origin && git rebase --onto origin/master df42546 register_subclasses, then fix this PR with git push --force origin register_subclasses.

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')
Copy link
Contributor

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.

@jmoldow
Copy link
Contributor

jmoldow commented Aug 1, 2016

👍

@kelseymorris95 kelseymorris95 merged commit 5f7df73 into master Aug 1, 2016
@jmoldow jmoldow deleted the register_subclasses branch August 1, 2016 18:57
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.

5 participants