mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-07-25 08:58:27 -07:00
dev-python/paste: Clean old versions up
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
--- a/paste/exceptions/reporter.py
|
||||
+++ b/paste/exceptions/reporter.py
|
||||
@@ -1,8 +1,14 @@
|
||||
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
|
||||
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
|
||||
|
||||
-from email.MIMEText import MIMEText
|
||||
-from email.MIMEMultipart import MIMEMultipart
|
||||
+try:
|
||||
+ from email.MIMEText import MIMEText
|
||||
+except:
|
||||
+ from email.mime.text import MIMEText
|
||||
+try:
|
||||
+ from email.MIMEMultipart import MIMEMultipart
|
||||
+except:
|
||||
+ from email.mime.multipart import MIMEMultipart
|
||||
import smtplib
|
||||
import time
|
||||
try:
|
||||
@@ -1,24 +0,0 @@
|
||||
Ignore the exception detail for two exceptions that are slightly
|
||||
different on pypy.
|
||||
|
||||
diff -r 7f90a96378ed tests/test_template.txt
|
||||
--- a/tests/test_template.txt Mon Mar 05 21:14:08 2012 +0100
|
||||
+++ b/tests/test_template.txt Wed May 16 23:29:46 2012 +0200
|
||||
@@ -6,7 +6,7 @@
|
||||
'Hi Ian'
|
||||
>>> Template('Hi {{repr(name)}}').substitute(name='Ian')
|
||||
"Hi 'Ian'"
|
||||
- >>> Template('Hi {{name+1}}').substitute(name='Ian')
|
||||
+ >>> Template('Hi {{name+1}}').substitute(name='Ian') #doctest: +IGNORE_EXCEPTION_DETAIL
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
TypeError: cannot concatenate 'str' and 'int' objects at line 1 column 6
|
||||
@@ -125,7 +125,7 @@
|
||||
>>> sub('{{default x=1}}{{x}}')
|
||||
'1'
|
||||
>>> # The normal case:
|
||||
- >>> sub('{{x}}')
|
||||
+ >>> sub('{{x}}') #doctest: +IGNORE_EXCEPTION_DETAIL
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
NameError: name 'x' is not defined at line 1 column 3
|
||||
@@ -1,11 +0,0 @@
|
||||
--- a/paste/auth/cookie.py
|
||||
+++ b/paste/auth/cookie.py
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
def make_time(value):
|
||||
return time.strftime("%Y%m%d%H%M", time.gmtime(value))
|
||||
-_signature_size = len(hmac.new('x', 'x', sha1).digest())
|
||||
+_signature_size = len(hmac.new(b'x', b'x', sha1).digest())
|
||||
_header_size = _signature_size + len(make_time(time.time()))
|
||||
|
||||
# @@: Should this be using urllib.quote?
|
||||
@@ -1,12 +0,0 @@
|
||||
diff -r 30425672adf7 paste/auth/cookie.py
|
||||
--- a/paste/auth/cookie.py Wed Jun 23 17:15:45 2010 -0500
|
||||
+++ b/paste/auth/cookie.py Mon Aug 02 20:06:43 2010 -0700
|
||||
@@ -62,7 +62,7 @@
|
||||
_decode = [(v, k) for (k, v) in _encode]
|
||||
_decode.reverse()
|
||||
def encode(s, sublist = _encode):
|
||||
- return reduce((lambda a, (b, c): a.replace(b, c)), sublist, str(s))
|
||||
+ return reduce((lambda a, b: a.replace(b[0], b[1])), sublist, str(s))
|
||||
decode = lambda s: encode(s, _decode)
|
||||
|
||||
class CookieTooLarge(RuntimeError):
|
||||
@@ -1,14 +0,0 @@
|
||||
--- a/paste/httpheaders.py
|
||||
+++ b/paste/httpheaders.py
|
||||
@@ -137,7 +137,10 @@
|
||||
import mimetypes
|
||||
import urllib2
|
||||
import re
|
||||
-from rfc822 import formatdate, parsedate_tz, mktime_tz
|
||||
+try:
|
||||
+ from rfc822 import formatdate, parsedate_tz, mktime_tz
|
||||
+except ImportError:
|
||||
+ from email.utils import formatdate, parsedate_tz, mktime_tz
|
||||
from time import time as now
|
||||
from httpexceptions import HTTPBadRequest
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
--- a/paste/lint.py
|
||||
+++ b/paste/lint.py
|
||||
@@ -111,7 +111,6 @@
|
||||
|
||||
import re
|
||||
import sys
|
||||
-from types import DictType, StringType, TupleType, ListType
|
||||
import warnings
|
||||
|
||||
header_re = re.compile(r'^[a-zA-Z][a-zA-Z0-9\-_]*$')
|
||||
@@ -282,7 +281,7 @@
|
||||
"Iterator garbage collected without being closed")
|
||||
|
||||
def check_environ(environ):
|
||||
- assert type(environ) is DictType, (
|
||||
+ assert isinstance(environ,dict), (
|
||||
"Environment is not of the right type: %r (environment: %r)"
|
||||
% (type(environ), environ))
|
||||
|
||||
@@ -309,11 +308,11 @@
|
||||
if '.' in key:
|
||||
# Extension, we don't care about its type
|
||||
continue
|
||||
- assert type(environ[key]) is StringType, (
|
||||
+ assert isinstance(environ[key], str), (
|
||||
"Environmental variable %s is not a string: %r (value: %r)"
|
||||
% (key, type(environ[key]), environ[key]))
|
||||
|
||||
- assert type(environ['wsgi.version']) is TupleType, (
|
||||
+ assert isinstance(environ['wsgi.version'], tuple), (
|
||||
"wsgi.version should be a tuple (%r)" % environ['wsgi.version'])
|
||||
assert environ['wsgi.url_scheme'] in ('http', 'https'), (
|
||||
"wsgi.url_scheme unknown: %r" % environ['wsgi.url_scheme'])
|
||||
@@ -359,7 +358,7 @@
|
||||
% (wsgi_errors, attr))
|
||||
|
||||
def check_status(status):
|
||||
- assert type(status) is StringType, (
|
||||
+ assert isinstance(status, str), (
|
||||
"Status must be a string (not %r)" % status)
|
||||
# Implicitly check that we can turn it into an integer:
|
||||
status_code = status.split(None, 1)[0]
|
||||
@@ -374,12 +373,12 @@
|
||||
% status, WSGIWarning)
|
||||
|
||||
def check_headers(headers):
|
||||
- assert type(headers) is ListType, (
|
||||
+ assert isinstance(headers,list), (
|
||||
"Headers (%r) must be of type list: %r"
|
||||
% (headers, type(headers)))
|
||||
header_names = {}
|
||||
for item in headers:
|
||||
- assert type(item) is TupleType, (
|
||||
+ assert isinstance(item, tuple), (
|
||||
"Individual headers (%r) must be of type tuple: %r"
|
||||
% (item, type(item)))
|
||||
assert len(item) == 2
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,64 +0,0 @@
|
||||
--- a/paste/debug/fsdiff.py
|
||||
+++ b/paste/debug/fsdiff.py
|
||||
@@ -12,10 +12,14 @@
|
||||
import os
|
||||
from fnmatch import fnmatch
|
||||
from datetime import datetime
|
||||
+
|
||||
try:
|
||||
- from UserDict import IterableUserDict
|
||||
+ import collections.UserDict as IterableUserDict
|
||||
except ImportError:
|
||||
- from paste.util.UserDict24 import IterableUserDict
|
||||
+ try:
|
||||
+ from UserDict import IterableUserDict
|
||||
+ except ImportError:
|
||||
+ from paste.util.UserDict24 import IterableUserDict
|
||||
import operator
|
||||
import re
|
||||
|
||||
--- a/paste/request.py
|
||||
+++ b/paste/request.py
|
||||
@@ -22,10 +22,12 @@
|
||||
from StringIO import StringIO
|
||||
import urlparse
|
||||
import urllib
|
||||
+
|
||||
try:
|
||||
from UserDict import DictMixin
|
||||
except ImportError:
|
||||
- from paste.util.UserDict24 import DictMixin
|
||||
+ from collections import MutableMapping as DictMixin
|
||||
+
|
||||
from paste.util.multidict import MultiDict
|
||||
|
||||
__all__ = ['get_cookies', 'get_cookie_dict', 'parse_querystring',
|
||||
--- a/paste/urlmap.py
|
||||
+++ b/paste/urlmap.py
|
||||
@@ -4,7 +4,10 @@
|
||||
Map URL prefixes to WSGI applications. See ``URLMap``
|
||||
"""
|
||||
|
||||
-from UserDict import DictMixin
|
||||
+try:
|
||||
+ from UserDict import DictMixin
|
||||
+except ImportError:
|
||||
+ from collections import MutableMapping as DictMixin
|
||||
import re
|
||||
import os
|
||||
import cgi
|
||||
--- a/paste/util/multidict.py
|
||||
+++ b/paste/util/multidict.py
|
||||
@@ -3,7 +3,11 @@
|
||||
import cgi
|
||||
import copy
|
||||
import sys
|
||||
-from UserDict import DictMixin
|
||||
+
|
||||
+try:
|
||||
+ from UserDict import DictMixin
|
||||
+except ImportError:
|
||||
+ from collections import MutableMapping as DictMixin
|
||||
|
||||
class MultiDict(DictMixin):
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
paste/util/looper/__init__.py | 4 ++++
|
||||
paste/util/{looper.py => looper/_looper.py} | 0
|
||||
paste/util/template/__init__.py | 6 ++++++
|
||||
paste/util/{template.py => template/_template.py} | 0
|
||||
4 files changed, 10 insertions(+)
|
||||
|
||||
diff --git a/paste/util/looper/__init__.py b/paste/util/looper/__init__.py
|
||||
new file mode 100644
|
||||
index 0000000..77d7e80
|
||||
--- /dev/null
|
||||
+++ b/paste/util/looper/__init__.py
|
||||
@@ -0,0 +1,4 @@
|
||||
+try:
|
||||
+ from tempita._looper import *
|
||||
+except ImportError:
|
||||
+ from _looper import *
|
||||
diff --git a/paste/util/looper.py b/paste/util/looper/_looper.py
|
||||
similarity index 100%
|
||||
rename from paste/util/looper.py
|
||||
rename to paste/util/looper/_looper.py
|
||||
diff --git a/paste/util/template/__init__.py b/paste/util/template/__init__.py
|
||||
new file mode 100644
|
||||
index 0000000..a0a5730
|
||||
--- /dev/null
|
||||
+++ b/paste/util/template/__init__.py
|
||||
@@ -0,0 +1,6 @@
|
||||
+try:
|
||||
+ from tempita import *
|
||||
+ from tempita import paste_script_template_renderer
|
||||
+except ImportError:
|
||||
+ from _template import *
|
||||
+ from _template import paste_script_template_renderer
|
||||
diff --git a/paste/util/template.py b/paste/util/template/_template.py
|
||||
similarity index 100%
|
||||
rename from paste/util/template.py
|
||||
rename to paste/util/template/_template.py
|
||||
Reference in New Issue
Block a user