mirror of
https://github.com/robweber/xbmcbackup.git
synced 2026-03-07 03:18:17 +01:00
part of #251 - modify previous strptime patch
This commit is contained in:
@@ -15,13 +15,9 @@ except ImportError:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
# fix for datetime.strptime bug https://kodi.wiki/view/Python_Problems#datetime.strptime
|
# fix for datetime.strptime bug https://kodi.wiki/view/Python_Problems#datetime.strptime
|
||||||
class proxydt(datetime.datetime):
|
def patch_strptime(date_string, format):
|
||||||
|
|
||||||
@classmethod
|
|
||||||
def strptime(cls, date_string, format):
|
|
||||||
return datetime.datetime(*(time.strptime(date_string, format)[:6]))
|
return datetime.datetime(*(time.strptime(date_string, format)[:6]))
|
||||||
|
|
||||||
datetime.datetime = proxydt
|
|
||||||
|
|
||||||
class QRCode(xbmcgui.WindowXMLDialog):
|
class QRCode(xbmcgui.WindowXMLDialog):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@@ -154,7 +150,7 @@ class DropboxAuthorizer:
|
|||||||
if(token.strip() != ""):
|
if(token.strip() != ""):
|
||||||
result = json.loads(token)
|
result = json.loads(token)
|
||||||
# convert expiration back to a datetime object
|
# convert expiration back to a datetime object
|
||||||
result['expiration'] = datetime.datetime.strptime(result['expiration'], "%Y-%m-%d %H:%M:%S.%f")
|
result['expiration'] = patch_strptime(result['expiration'], "%Y-%m-%d %H:%M:%S.%f")
|
||||||
|
|
||||||
token_file.close()
|
token_file.close()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user