Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7e5a00b

Browse files
committed
Update github3.repos.repo for consistency
1 parent5814c53 commit7e5a00b

File tree

3 files changed

+1072
-653
lines changed

3 files changed

+1072
-653
lines changed

‎github3/models.py

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -83,40 +83,6 @@ def as_json(self):
8383
"""
8484
returnjsonlib.dumps(self._json_data)
8585

86-
@classmethod
87-
def_get_attribute(cls,data,attribute,fallback=None):
88-
"""Return the attribute from the json data.
89-
90-
:param dict data: dictionary used to put together the model
91-
:param str attribute: key of the attribute
92-
:param any fallback: return value if original return value is falsy
93-
:returns: value paired with key in dict, fallback
94-
"""
95-
ifdataisNoneornotisinstance(data,dict):
96-
returnNone
97-
result=data.get(attribute)
98-
ifresultisNone:
99-
returnfallback
100-
returnresult
101-
102-
@classmethod
103-
def_strptime_attribute(cls,data,attribute):
104-
"""Get a datetime object from a dict, return None if it wan't found.
105-
106-
This is equivalent to calling::
107-
108-
cls._strptime(data[attribute]) if attribute in data else None
109-
110-
:param dict data: dictionary used to put together the model
111-
:param str attribute: key of the attribute
112-
:returns: timezone-aware datetime object
113-
:rtype: datetime
114-
"""
115-
result=cls._get_attribute(data,attribute)
116-
ifresult:
117-
returncls._strptime(result)
118-
returnresult
119-
12086
@classmethod
12187
def_strptime(cls,time_str):
12288
"""Convert an ISO 8601 formatted string to a datetime object.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp