[Zope-Checkins] CVS: Zope/lib/python/Products/Sessions - BrowserIdManager.py:1.14 SessionDataManager.py:1.21 SessionInterfaces.py:1.11 SessionPermissions.py:1.5 __init__.py:1.7 common.py:1.4
Martijn Pieters
mj@zope.com
Wed, 14 Aug 2002 18:25:41 -0400
Update of /cvs-repository/Zope/lib/python/Products/Sessions
In directory cvs.zope.org:/tmp/cvs-serv27658/Sessions
Modified Files:
BrowserIdManager.py SessionDataManager.py SessionInterfaces.py
SessionPermissions.py __init__.py common.py
Log Message:
Clean up indentation and trailing whitespace.
=== Zope/lib/python/Products/Sessions/BrowserIdManager.py 1.13 => 1.14 ===
--- Zope/lib/python/Products/Sessions/BrowserIdManager.py:1.13 Sat Aug 10 17:07:33 2002
+++ Zope/lib/python/Products/Sessions/BrowserIdManager.py Wed Aug 14 18:25:09 2002
@@ -1,5 +1,5 @@
############################################################################
-#
+#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
@@ -53,9 +53,9 @@
ob = self._getOb(id)
if REQUEST is not None:
return self.manage_main(self, REQUEST, update_menu=1)
-
+
class BrowserIdManagerErr(Exception): pass
-
+
class BrowserIdManager(Item, Persistent, Implicit, RoleManager, Owned, Tabs):
""" browser id management class """
@@ -99,7 +99,7 @@
not create a browser id for the current request if one doesn't
already exist """
if self.getBrowserId(create=0): return 1
-
+
security.declareProtected(ACCESS_CONTENTS_PERM, 'getBrowserId')
def getBrowserId(self, create=1):
"""
@@ -120,7 +120,7 @@
# somebody screwed with the REQUEST instance during
# this request.
raise BrowserIdManagerErr, (
- 'Ill-formed browserid in REQUEST.browser_id_: %s' %
+ 'Ill-formed browserid in REQUEST.browser_id_: %s' %
escape(bid)
)
return bid
@@ -194,7 +194,7 @@
# ns will be None if new, negating None below returns 1, which
# would indicate that it's new on this request
return not getattr(self.REQUEST, 'browser_id_ns_')
-
+
security.declareProtected(ACCESS_CONTENTS_PERM, 'encodeUrl')
def encodeUrl(self, url, create=1):
"""
@@ -313,7 +313,7 @@
if not (type(path) is type('') and not badcookiecharsin(path)):
raise BrowserIdManagerErr, 'Bad cookie path %s' % escape(repr(path))
self.cookie_path = path
-
+
security.declareProtected(ACCESS_CONTENTS_PERM, 'getCookiePath')
def getCookiePath(self):
""" """
@@ -397,7 +397,7 @@
A == leading-0-padded 8-char string-rep'd random integer
B == modified base64-encoded 11-char timestamp
-
+
To be URL-compatible, base64 encoding is modified as follows:
'=' end-padding is stripped off
'+' is translated to '-'
@@ -428,14 +428,14 @@
return # should we raise an exception?
if string.split(URL1,':')[0] != 'https':
return # should we raise an exception?
-
+
cookies = REQUEST.RESPONSE.cookies
cookie = cookies[self.browserid_name]= {}
for k,v in d.items():
if v:
cookie[k] = v #only stuff things with true values
cookie['value'] = bid
-
+
def _getB64TStamp(
self, b2a=binascii.b2a_base64,gmtime=time.gmtime, time=time.time,
b64_trans=b64_trans, split=string.split,
=== Zope/lib/python/Products/Sessions/SessionDataManager.py 1.20 => 1.21 ===
--- Zope/lib/python/Products/Sessions/SessionDataManager.py:1.20 Fri Jul 19 00:44:34 2002
+++ Zope/lib/python/Products/Sessions/SessionDataManager.py Wed Aug 14 18:25:09 2002
@@ -1,5 +1,5 @@
############################################################################
-#
+#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
@@ -103,7 +103,7 @@
security.declareProtected(ARBITRARY_SESSIONDATA_PERM,'getSessionDataByKey')
def getSessionDataByKey(self, key):
return self._getSessionDataObjectByKey(key)
-
+
security.declareProtected(ACCESS_CONTENTS_PERM, 'getBrowserIdManager')
def getBrowserIdManager(self):
""" """
@@ -115,7 +115,7 @@
return mgr
# END INTERFACE METHODS
-
+
def __init__(self, id, path=None, title='', requestName=None):
self.id = id
self.setContainerPath(path)
@@ -160,14 +160,14 @@
self.obpath = list(path) # sequence
else:
raise SessionDataManagerErr, ('Bad path value %s' % path)
-
+
security.declareProtected(MGMT_SCREEN_PERM, 'getContainerPath')
def getContainerPath(self):
""" """
if self.obpath is not None:
return string.join(self.obpath, '/')
return '' # blank string represents undefined state
-
+
def _hasSessionDataObject(self, key):
""" """
c = self._getSessionDataContainer()
=== Zope/lib/python/Products/Sessions/SessionInterfaces.py 1.10 => 1.11 ===
--- Zope/lib/python/Products/Sessions/SessionInterfaces.py:1.10 Sat Aug 10 15:28:37 2002
+++ Zope/lib/python/Products/Sessions/SessionInterfaces.py Wed Aug 14 18:25:09 2002
@@ -1,5 +1,5 @@
############################################################################
-#
+#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
@@ -81,7 +81,7 @@
"""
Returns true if browser id is 'new'. A browser id is 'new'
when it is first created and the client has therefore not sent it
- back to the server in any request.
+ back to the server in any request.
Permission required: Access contents information
@@ -111,7 +111,7 @@
"""
Deletes the browser id cookie from the client browser, iff the
'cookies' browser id namespace is being used.
-
+
Permission required: Access contents information
Raises: BrowserIdManagerErr. If the 'cookies' namespace isn't
@@ -123,7 +123,7 @@
Sets the browser id cookie to browser id 'bid' by force.
Useful when you need to 'chain' browser id cookies across domains
for the same user (perhaps temporarily using query strings).
-
+
Permission required: Access contents information
Raises: BrowserIdManagerErr. If the 'cookies' namespace isn't
=== Zope/lib/python/Products/Sessions/SessionPermissions.py 1.4 => 1.5 ===
--- Zope/lib/python/Products/Sessions/SessionPermissions.py:1.4 Wed Nov 28 11:09:07 2001
+++ Zope/lib/python/Products/Sessions/SessionPermissions.py Wed Aug 14 18:25:09 2002
@@ -1,5 +1,5 @@
############################################################################
-#
+#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
=== Zope/lib/python/Products/Sessions/__init__.py 1.6 => 1.7 ===
--- Zope/lib/python/Products/Sessions/__init__.py:1.6 Wed Nov 28 10:51:07 2001
+++ Zope/lib/python/Products/Sessions/__init__.py Wed Aug 14 18:25:09 2002
@@ -1,14 +1,14 @@
##############################################################################
#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
"""
Session initialization routines
=== Zope/lib/python/Products/Sessions/common.py 1.3 => 1.4 ===
--- Zope/lib/python/Products/Sessions/common.py:1.3 Wed Nov 28 11:12:13 2001
+++ Zope/lib/python/Products/Sessions/common.py Wed Aug 14 18:25:09 2002
@@ -1,5 +1,5 @@
############################################################################
-#
+#
# Copyright (c) 2001 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,