-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix JsonObject class, set version to 1.1.0
- Loading branch information
1 parent
94c47f6
commit 9437b40
Showing
2 changed files
with
12 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
Version 1.0.0 released 2013-06-24 | ||
|
||
* Initial release. | ||
|
||
Version 1.1.0 released 2014-02-13 | ||
|
||
* Add py3 support; | ||
* Add x_ratelimit_reset; | ||
* Fix JsonObject class. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ def bytes(string, encoding=None): | |
|
||
TIMEOUT=60 | ||
|
||
__version__ = '1.0.0' | ||
__version__ = '1.1.0' | ||
|
||
_URL = 'https://api.github.com' | ||
_METHOD_MAP = dict( | ||
|
@@ -293,18 +293,15 @@ class JsonObject(dict): | |
''' | ||
general json object that can bind any fields but also act as a dict. | ||
''' | ||
def __getattr__(self, attr): | ||
return self[attr] | ||
def __getattr__(self, key): | ||
try: | ||
return self[key] | ||
except KeyError: | ||
raise AttributeError(r"'Dict' object has no attribute '%s'" % key) | ||
|
||
def __setattr__(self, attr, value): | ||
self[attr] = value | ||
|
||
def __getstate__(self): | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
michaelliao
Author
Owner
|
||
return self.copy() | ||
|
||
def __setstate__(self, state): | ||
self.update(state) | ||
|
||
if __name__ == '__main__': | ||
import doctest | ||
doctest.testmod() |
I'm curious to know why did you remove these two methods?