summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2011-08-15 23:52:18 -0400
committerChris McDonough <chrism@plope.com>2011-08-15 23:52:18 -0400
commit86694952c7a6c8c1f9691d54294a7151e7e215f8 (patch)
tree6b9f3d1219551192e1b8ebdaabec94f824e35cb1
parent4d65ea8d23d8e0a28f0e46fca031a86a748a8289 (diff)
downloadpyramid-86694952c7a6c8c1f9691d54294a7151e7e215f8.tar.gz
pyramid-86694952c7a6c8c1f9691d54294a7151e7e215f8.tar.bz2
pyramid-86694952c7a6c8c1f9691d54294a7151e7e215f8.zip
misc cleanups
-rw-r--r--pyramid/interfaces.py76
-rw-r--r--pyramid/paster.py2
-rw-r--r--pyramid/session.py5
3 files changed, 4 insertions, 79 deletions
diff --git a/pyramid/interfaces.py b/pyramid/interfaces.py
index 4055db08a..6864e5dfb 100644
--- a/pyramid/interfaces.py
+++ b/pyramid/interfaces.py
@@ -769,7 +769,7 @@ class ISessionFactory(Interface):
def __call__(request):
""" Return an ISession object """
-class ISession(Interface):
+class ISession(IDict):
""" An interface representing a session (a web session object,
usually accessed via ``request.session``.
@@ -835,80 +835,6 @@ class ISession(Interface):
returned.
"""
- # mapping methods
-
- def __getitem__(key):
- """Get a value for a key
-
- A ``KeyError`` is raised if there is no value for the key.
- """
-
- def get(key, default=None):
- """Get a value for a key
-
- The default is returned if there is no value for the key.
- """
-
- def __delitem__(key):
- """Delete a value from the mapping using the key.
-
- A ``KeyError`` is raised if there is no value for the key.
- """
-
- def __setitem__(key, value):
- """Set a new item in the mapping."""
-
- def keys():
- """Return the keys of the mapping object.
- """
-
- def values():
- """Return the values of the mapping object.
- """
-
- def items():
- """Return the items of the mapping object.
- """
-
- def iterkeys():
- "iterate over keys; equivalent to __iter__"
-
- def itervalues():
- "iterate over values"
-
- def iteritems():
- "iterate over items"
-
- def clear():
- "delete all items"
-
- def update(d):
- " Update D from E: for k in E.keys(): D[k] = E[k]"
-
- def setdefault(key, default=None):
- " D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D "
-
- def pop(k, *args):
- """remove specified key and return the corresponding value
- ``*args`` may contain a single default value, or may not be supplied.
- If key is not found, default is returned if given, otherwise
- ``KeyError`` is raised"""
-
- def popitem():
- """remove and return some (key, value) pair as a
- 2-tuple; but raise ``KeyError`` if mapping is empty"""
-
- def __len__():
- """Return the number of items in the session.
- """
-
- def __iter__():
- """Return an iterator for the keys of the mapping object.
- """
-
- def __contains__(key):
- """Return true if a key exists in the mapping."""
-
class IRendererInfo(Interface):
""" An object implementing this interface is passed to every
:term:`renderer factory` constructor as its only argument (conventionally
diff --git a/pyramid/paster.py b/pyramid/paster.py
index 47f9ebc34..f9765a07c 100644
--- a/pyramid/paster.py
+++ b/pyramid/paster.py
@@ -18,6 +18,8 @@ from pyramid.tweens import MAIN
from pyramid.tweens import INGRESS
from pyramid.scaffolds import PyramidTemplate # bw compat
+PyramidTemplate = PyramidTemplate # pyflakes
+
zope.deprecation.deprecated(
'PyramidTemplate', ('pyramid.paster.PyramidTemplate was moved to '
'pyramid.scaffolds.PyramidTemplate in Pyramid 1.1'),
diff --git a/pyramid/session.py b/pyramid/session.py
index bb3226a1e..bfa80ff10 100644
--- a/pyramid/session.py
+++ b/pyramid/session.py
@@ -1,13 +1,10 @@
-try:
- from hashlib import sha1
-except ImportError: # pragma: no cover
- import sha as sha1
try:
import cPickle as pickle
except ImportError: # pragma: no cover
import pickle
+from hashlib import sha1
import base64
import binascii
import hmac