Additional endpoints - storagebox & key#57
Conversation
Co-authored-by: aszlig <aszlig@redmoonstudios.org>
6c127db to
6320beb
Compare
6320beb to
c3a80b3
Compare
aszlig
left a comment
There was a problem hiding this comment.
Thanks a lot. I currently don't have a storage box so I can't test this, but apart from the Py2/3 stuff mentioned, LGTM.
| name: str | ||
| fingerprint: str | ||
| size: int | ||
| data: str | ||
| created_at: datetime.datetime |
There was a problem hiding this comment.
Adding type hints while at the same time using deprecated stuff such as class Foo(object): and super(Key, self) is somewhat inconsistent. However, since even I nowadays use type hints and more modern features in other projects, I'm wondering whether it's time to even drop support for Python 2 for this project. That however has to happen for a new major version, though.
So either we stick here to being 2.x compatible and merge this pull request or we use Python 3.x features (consistently) here but wait for the next major release.
| def __init__(self, conn): | ||
| self.conn = conn | ||
|
|
||
| def get(self, id_): |
There was a problem hiding this comment.
You've used box_id in storagebox.py, which not only is more consistent but also doesn't come with the underscore-suffix which I consider to be a workaround.
Storageboxes implementation is forked from #38, with small code cleanup and added
linked_storageboxfield in Servers.Added support for (ssh) keys endpoint.