diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-03-14 11:07:54 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-03-14 11:07:54 +0100 |
commit | e65d19ee3a1e435bf2896ed829e5581eeef92dd2 (patch) | |
tree | cf5bb073899205a2f00ddeca8df8b9f3944ea835 /module/plugins/internal/SimpleHoster.py | |
parent | [HotFolder] Missing exception (diff) | |
download | pyload-e65d19ee3a1e435bf2896ed829e5581eeef92dd2.tar.xz |
Import cleanup for datetime and time modules
Diffstat (limited to 'module/plugins/internal/SimpleHoster.py')
-rw-r--r-- | module/plugins/internal/SimpleHoster.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/module/plugins/internal/SimpleHoster.py b/module/plugins/internal/SimpleHoster.py index 114128c63..5defd028d 100644 --- a/module/plugins/internal/SimpleHoster.py +++ b/module/plugins/internal/SimpleHoster.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- +import datetime import mimetypes import os import re +import time -from datetime import datetime, timedelta from inspect import isclass -from time import time from urllib import unquote from urlparse import urljoin, urlparse @@ -137,7 +137,7 @@ def create_getInfo(plugin): def timestamp(): - return int(time() * 1000) + return int(time.time() * 1000) #@TODO: Move to hoster class in 0.4.10 @@ -226,18 +226,18 @@ def getFileURL(self, url, follow_location=None): def secondsToMidnight(gmt=0): - now = datetime.utcnow() + timedelta(hours=gmt) + now = datetime.datetime.utcnow() + datetime.timedelta(hours=gmt) if now.hour is 0 and now.minute < 10: midnight = now else: - midnight = now + timedelta(days=1) + midnight = now + datetime.timedelta(days=1) td = midnight.replace(hour=0, minute=10, second=0, microsecond=0) - now if hasattr(td, 'total_seconds'): res = td.total_seconds() - else: #: work-around for python 2.5 and 2.6 missing timedelta.total_seconds + else: #: work-around for python 2.5 and 2.6 missing datetime.timedelta.total_seconds res = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6 return int(res) |