mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 19:01:15 +00:00
Finaly remove GitAuthor.timezone
See https://github.com/jacquev6/PyGithub/issues/54#issuecomment-6972414
This commit is contained in:
@@ -43,15 +43,10 @@ class BasicGithubObject( object ):
|
||||
elif len( s ) == 24:
|
||||
return datetime.datetime.strptime( s, "%Y-%m-%dT%H:%M:%S.000Z" )
|
||||
elif len( s ) == 25:
|
||||
return datetime.datetime.strptime( s[ : 19 ], "%Y-%m-%dT%H:%M:%S" )
|
||||
return datetime.datetime.strptime( s[ : 19 ], "%Y-%m-%dT%H:%M:%S" ) + ( 1 if s[ 19 ] == '-' else -1 ) * datetime.timedelta( hours = int( s[ 20 : 22 ] ), minutes = int( s[ 23 : 25 ] ) )
|
||||
else:
|
||||
return datetime.datetime.strptime( s, "%Y-%m-%dT%H:%M:%SZ" )
|
||||
|
||||
@staticmethod
|
||||
def _parseTimezone( s ):
|
||||
assert len( s ) == 25
|
||||
return ( -1 if s[ 19 ] == '-' else 1 ) * datetime.timedelta( hours = int( s[ 20 : 22 ] ), minutes = int( s[ 23 : 25 ] ) )
|
||||
|
||||
class GithubObject( BasicGithubObject ):
|
||||
def __init__( self, requester, attributes, completed ):
|
||||
BasicGithubObject.__init__( self, requester, attributes, completed )
|
||||
|
||||
Reference in New Issue
Block a user