Finaly remove GitAuthor.timezone

See https://github.com/jacquev6/PyGithub/issues/54#issuecomment-6972414
This commit is contained in:
Vincent Jacques
2012-07-13 21:11:17 +02:00
parent 4e85f4178a
commit 0218adc564
10 changed files with 21 additions and 61 deletions
+1 -6
View File
@@ -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 )