summaryrefslogtreecommitdiffstats
path: root/module/network/CookieJar.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2015-02-16 21:59:10 +0100
committerGravatar Walter Purcaro <vuolter@gmail.com> 2015-02-16 21:59:10 +0100
commit8e7d14bae4d3c836f029a1235eb227380acc3f75 (patch)
treeebd0679642cccb994e70a89a106b394189cb28bc /module/network/CookieJar.py
parentMerge branch 'stable' into 0.4.10 (diff)
downloadpyload-8e7d14bae4d3c836f029a1235eb227380acc3f75.tar.xz
Fix plugins to work on 0.4.10
Diffstat (limited to 'module/network/CookieJar.py')
-rw-r--r--module/network/CookieJar.py42
1 files changed, 0 insertions, 42 deletions
diff --git a/module/network/CookieJar.py b/module/network/CookieJar.py
deleted file mode 100644
index a2b302776..000000000
--- a/module/network/CookieJar.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# -*- coding: utf-8 -*-
-# @author: RaNaN
-
-import Cookie
-
-from datetime import datetime, timedelta
-from time import time
-
-
-# monkey patch for 32 bit systems
-def _getdate(future=0, weekdayname=Cookie._weekdayname, monthname=Cookie._monthname):
- dt = datetime.now() + 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)
-
-Cookie._getdate = _getdate
-
-
-class CookieJar(Cookie.SimpleCookie):
-
- def getCookie(self, name):
- return self[name].value
-
- def setCookie(self, domain, name, value, path="/", exp=None, secure="FALSE"):
- self[name] = value
- self[name]["domain"] = domain
- self[name]["path"] = path
-
- # Value of expires should be integer if possible
- # otherwise the cookie won't be used
- if not exp:
- expires = time() + 3600 * 24 * 180
- else:
- try:
- expires = int(exp)
- except ValueError:
- expires = exp
-
- self[name]["expires"] = expires
-
- if secure == "TRUE":
- self[name]["secure"] = secure