diff options
author | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-12 02:44:03 +0200 |
---|---|---|
committer | Walter Purcaro <vuolter@users.noreply.github.com> | 2015-05-12 03:22:38 +0200 |
commit | f8cf65d4271254dd89662cb6190adc5b426c6d2b (patch) | |
tree | 3197abaa2f3a7f1fdc4f2edcd1844087780c066a /pyload/network | |
parent | 'from time' -> 'import time' and so on... (diff) | |
download | pyload-f8cf65d4271254dd89662cb6190adc5b426c6d2b.tar.xz |
'from time' -> 'import time' and so on... (2)
Diffstat (limited to 'pyload/network')
-rw-r--r-- | pyload/network/Browser.py | 4 | ||||
-rw-r--r-- | pyload/network/CookieJar.py | 5 | ||||
-rw-r--r-- | pyload/network/HTTPDownload.py | 5 | ||||
-rw-r--r-- | pyload/network/HTTPRequest.py | 4 |
4 files changed, 8 insertions, 10 deletions
diff --git a/pyload/network/Browser.py b/pyload/network/Browser.py index 482c2320a..77524c26f 100644 --- a/pyload/network/Browser.py +++ b/pyload/network/Browser.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from logging import getLogger +import logging from pyload.network.HTTPRequest import HTTPRequest from pyload.network.HTTPDownload import HTTPDownload @@ -11,7 +11,7 @@ class Browser(object): def __init__(self, bucket=None, options={}): - self.log = getLogger("log") + self.log = logging.getLogger("log") self.options = options #: holds pycurl options self.bucket = bucket diff --git a/pyload/network/CookieJar.py b/pyload/network/CookieJar.py index 8c8d4c87b..e4d3424d8 100644 --- a/pyload/network/CookieJar.py +++ b/pyload/network/CookieJar.py @@ -2,14 +2,13 @@ # @author: RaNaN import Cookie +import datetime import time -from datetime import datetime, timedelta - # monkey patch for 32 bit systems def _getdate(future=0, weekdayname=Cookie._weekdayname, monthname=Cookie._monthname): - dt = datetime.now() + timedelta(seconds=int(future)) + dt = datetime.datetime.now() + datetime.timedelta(seconds=int(future)) return "%s, %02d %3s %4d %02d:%02d:%02d GMT" % \ (weekdayname[dt.weekday()], dt.day, monthname[dt.month], dt.year, dt.hour, dt.minute, dt.second) diff --git a/pyload/network/HTTPDownload.py b/pyload/network/HTTPDownload.py index 959ffd111..e5917aa1f 100644 --- a/pyload/network/HTTPDownload.py +++ b/pyload/network/HTTPDownload.py @@ -3,14 +3,13 @@ from __future__ import with_statement +import logging import os import shutil import time import pycurl -from logging import getLogger - from pyload.network.HTTPChunk import ChunkInfo, HTTPChunk from pyload.network.HTTPRequest import BadHeader from pyload.plugin.Plugin import Abort @@ -39,7 +38,7 @@ class HTTPDownload(object): self.chunks = [] - self.log = getLogger("log") + self.log = logging.getLogger("log") try: self.info = ChunkInfo.load(filename) diff --git a/pyload/network/HTTPRequest.py b/pyload/network/HTTPRequest.py index 14c5b8cb6..a27c59ff2 100644 --- a/pyload/network/HTTPRequest.py +++ b/pyload/network/HTTPRequest.py @@ -3,13 +3,13 @@ from __future__ import with_statement +import logging import urllib import pycurl from codecs import getincrementaldecoder, lookup, BOM_UTF8 from httplib import responses -from logging import getLogger from cStringIO import StringIO from pyload.plugin.Plugin import Abort, Fail @@ -59,7 +59,7 @@ class HTTPRequest(object): self.c.setopt(pycurl.WRITEFUNCTION, self.write) self.c.setopt(pycurl.HEADERFUNCTION, self.writeHeader) - self.log = getLogger("log") + self.log = logging.getLogger("log") def initHandle(self): |