[Zope-Checkins] CVS: Zope/lib/python/App - ApplicationManager.py:1.81 CacheManager.py:1.26 Common.py:1.15 DavLockManager.py:1.8 Dialogs.py:1.8 Extensions.py:1.19 Factory.py:1.26 FactoryDispatcher.py:1.21 FindHomes.py:1.11 Hotfixes.py:1.8 ImageFile.py:1.18 Management.py:1.61 Permission.py:1.8 PersistentExtra.py:1.8 Product.py:1.58 ProductContext.py:1.41 ProductRegistry.py:1.15 RefreshFuncs.py:1.6 Undo.py:1.31 __init__.py:1.5 class_init.py:1.14 special_dtml.py:1.24 tar.py:1.6 version_txt.py:1.8
Martijn Pieters
mj@zope.com
Wed, 14 Aug 2002 17:31:42 -0400
Update of /cvs-repository/Zope/lib/python/App
In directory cvs.zope.org:/tmp/cvs-serv12915
Modified Files:
ApplicationManager.py CacheManager.py Common.py
DavLockManager.py Dialogs.py Extensions.py Factory.py
FactoryDispatcher.py FindHomes.py Hotfixes.py ImageFile.py
Management.py Permission.py PersistentExtra.py Product.py
ProductContext.py ProductRegistry.py RefreshFuncs.py Undo.py
__init__.py class_init.py special_dtml.py tar.py
version_txt.py
Log Message:
Clean up indentation and trailing whitespace.
=== Zope/lib/python/App/ApplicationManager.py 1.80 => 1.81 ===
--- Zope/lib/python/App/ApplicationManager.py:1.80 Tue Jul 9 11:14:50 2002
+++ Zope/lib/python/App/ApplicationManager.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
__doc__="""System management components"""
__version__='$Revision$'[11:-2]
@@ -82,7 +82,7 @@
'help':('OFSP','Version-Management_Version.stx')},
)
)
-
+
Globals.default__class_init__(VersionManager)
@@ -110,7 +110,7 @@
)
manage_debug=DTMLFile('dtml/debug', globals())
-
+
def refcount(self, n=None, t=(type(Fake), type(Acquisition.Implicit))):
# return class reference info
dict={}
@@ -212,7 +212,7 @@
def version_txt(self):
if not hasattr(self, '_v_version_txt'):
self._v_version_txt=version_txt()
-
+
return self._v_version_txt
def sys_version(self): return sys.version
@@ -238,7 +238,7 @@
)
+Undo.UndoSupport.manage_options
)
-
+
id ='Control_Panel'
name=title='Control Panel'
meta_type ='Control Panel'
@@ -284,13 +284,13 @@
raise 'Redirect', URL2+'/manage'
def process_time(self):
- s=int(time.time())-self.process_start
+ s=int(time.time())-self.process_start
d=int(s/86400)
s=s-(d*86400)
h=int(s/3600)
s=s-(h*3600)
m=int(s/60)
- s=s-(m*60)
+ s=s-(m*60)
d=d and ('%d day%s' % (d, (d != 1 and 's' or ''))) or ''
h=h and ('%d hour%s' % (h, (h != 1 and 's' or ''))) or ''
m=m and ('%d min' % m) or ''
@@ -315,7 +315,7 @@
if hasattr(sys, 'ZMANAGED'):
-
+
manage_restartable=1
def manage_restart(self, URL1):
"""Shut down the application"""
@@ -412,7 +412,7 @@
db.abortVersion(v)
if REQUEST is not None:
REQUEST['RESPONSE'].redirect(REQUEST['URL1']+'/manage_main')
-
+
def getSOFTWARE_HOME(self):
return SOFTWARE_HOME
@@ -441,4 +441,3 @@
self._objects = tuple(lst)
return Folder.objectIds(self, spec)
-
=== Zope/lib/python/App/CacheManager.py 1.25 => 1.26 ===
--- Zope/lib/python/App/CacheManager.py:1.25 Mon Jun 10 16:20:43 2002
+++ Zope/lib/python/App/CacheManager.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
__doc__='''Cache management support
@@ -43,10 +43,10 @@
else: return db.cacheSize()
def cache_detail_length(self):
- try: db=self._p_jar.db()
- except:
- return ()
- else: return db.cacheDetailSize()
+ try: db=self._p_jar.db()
+ except:
+ return ()
+ else: return db.cacheDetailSize()
def database_size(self):
try: db=self._p_jar.db()
@@ -99,7 +99,7 @@
"set cache size"
try:
v=self._p_jar.getVersion()
- except:
+ except:
# BoboPOS2:
if self._p_jar.db is not Globals.Bobobase._jar.db:
raise 'Version Error', (
@@ -137,7 +137,7 @@
))
),
)
-
+
# BoboPOS 2
def cache_mean_age(self):
@@ -320,7 +320,7 @@
load_len = max(int(segment_height * loads / limit), 1)
else:
load_len = 0
-
+
t = div['end'] - analysis[-1]['end'] # Show negative numbers.
if segment_time >= 3600:
# Show hours.
@@ -362,4 +362,3 @@
Globals.default__class_init__(CacheManager)
-
=== Zope/lib/python/App/Common.py 1.14 => 1.15 ===
--- Zope/lib/python/App/Common.py:1.14 Fri Jul 19 17:01:04 2002
+++ Zope/lib/python/App/Common.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
"""Commonly used utility functions."""
@@ -85,7 +85,7 @@
if hasattr(parent, absId):
# Consider direct attributes not acquired
return 0
-
+
if hasattr(parent, '__getitem__'):
# Use __getitem__ as opposed to has_key to avoid TTW namespace
# issues, and to support the most minimal mapping objects
@@ -94,8 +94,8 @@
# This object is an item of the aq_parent, its not acquired
return 0
except KeyError:
- pass
-
+ pass
+
if hasattr(parent,'_objects'):
# XXX This is really icky
# This ugly mess is for ZClass methods I think
@@ -126,7 +126,7 @@
return default
def Dictionary(**kw): return kw # Sorry Guido
-
+
def realpath(p):
""" Computes the 'real' path of a file or directory devoid of
any symlink in any element of the path """
=== Zope/lib/python/App/DavLockManager.py 1.7 => 1.8 ===
--- Zope/lib/python/App/DavLockManager.py:1.7 Wed Nov 28 10:50:52 2001
+++ Zope/lib/python/App/DavLockManager.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
__version__ = "$Revision$"[11:-2]
@@ -37,7 +37,7 @@
{'label': 'Write Locks', 'action': 'manage_main',
'help': ('OFSP', 'DavLocks-ManageLocks.stx'), },
)
-
+
def locked_in_version(self): return 0
def findLockedObjects(self, frompath=''):
@@ -104,5 +104,5 @@
return result
-
+
Globals.default__class_init__(DavLockManager)
=== Zope/lib/python/App/Dialogs.py 1.7 => 1.8 ===
--- Zope/lib/python/App/Dialogs.py:1.7 Wed Nov 28 10:50:52 2001
+++ Zope/lib/python/App/Dialogs.py Wed Aug 14 17:31:40 2002
@@ -1,25 +1,25 @@
##############################################################################
#
# 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
-#
+#
##############################################################################
"""Common HTML dialog boxes
MessageDialog(title, message, action, [target])
- A very simple dialog used to display an HTML page titled title,
- displaying message message and an OK button. Clicking the OK
- button will take the browser to the URL specified in action.
- The *optional* target argument can be used to force a (frames
- capable) browser to load the URL specified in action into a specific
+ A very simple dialog used to display an HTML page titled title,
+ displaying message message and an OK button. Clicking the OK
+ button will take the browser to the URL specified in action.
+ The *optional* target argument can be used to force a (frames
+ capable) browser to load the URL specified in action into a specific
frame. (Specifying '_new' will cause the browser to load the
specified URL into a new window, for example).
@@ -33,7 +33,7 @@
__version__='$Revision$'[11:-2]
-
+
from Globals import HTML
MessageDialog = HTML("""
=== Zope/lib/python/App/Extensions.py 1.18 => 1.19 ===
--- Zope/lib/python/App/Extensions.py:1.18 Thu Feb 7 12:37:10 2002
+++ Zope/lib/python/App/Extensions.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
__doc__='''Standard routines for handling extensions.
@@ -22,7 +22,7 @@
path_split=os.path.split
path_join=os.path.join
exists=os.path.exists
-
+
class FuncCode:
def __init__(self, f, im=0):
@@ -71,20 +71,20 @@
The search takes on multiple homes which are INSTANCE_HOME,
the directory containing the directory containing SOFTWARE_HOME, and
- possibly product areas.
+ possibly product areas.
"""
d,n = path_split(name)
if d: raise ValueError, (
'The file name, %s, should be a simple file name' % name)
if checkProduct:
- l = name.find('.')
- if l > 0:
- p = name[:l]
- n = name[l + 1:]
- for product_dir in Products.__path__:
- r = _getPath(product_dir, os.path.join(p, prefix), n, suffixes)
- if r is not None: return r
+ l = name.find('.')
+ if l > 0:
+ p = name[:l]
+ n = name[l + 1:]
+ for product_dir in Products.__path__:
+ r = _getPath(product_dir, os.path.join(p, prefix), n, suffixes)
+ if r is not None: return r
sw=path_split(path_split(SOFTWARE_HOME)[0])[0]
for home in (INSTANCE_HOME, sw):
@@ -94,7 +94,7 @@
def getObject(module, name, reload=0,
# The use of a mutable default is intentional here,
# because modules is a module cache.
- modules={}
+ modules={}
):
# The use of modules here is not thread safe, however, there is
@@ -134,7 +134,7 @@
execsrc=compile(data, module, 'exec')
m={}
exec execsrc in m
-
+
else:
try: execsrc=open(p)
except: raise "Module Error", (
@@ -169,5 +169,5 @@
if not hasattr(c,'__bases__'): raise ValueError, (
'%s, is not a class' % class_name)
-
+
return c
=== Zope/lib/python/App/Factory.py 1.25 => 1.26 ===
--- Zope/lib/python/App/Factory.py:1.25 Wed Nov 28 10:50:52 2001
+++ Zope/lib/python/App/Factory.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
__doc__='''Factory objects
@@ -29,7 +29,7 @@
permission='' # Waaaa
_setObject=_getOb=Acquisition.Acquired
-
+
__ac_permissions__=(
('Edit Factories', ('manage_edit','manage_main')),
('Use Factories', ('index_html','')),
@@ -43,7 +43,7 @@
+AccessControl.Role.RoleManager.manage_options
+OFS.SimpleItem.Item.manage_options
)
-
+
def __init__(self, id, title, object_type, initial, permission=''):
self.id=id
self.title=title
@@ -112,4 +112,3 @@
)
class ProductFactory(Factory): pass
-
=== Zope/lib/python/App/FactoryDispatcher.py 1.20 => 1.21 ===
--- Zope/lib/python/App/FactoryDispatcher.py:1.20 Thu Feb 7 12:37:10 2002
+++ Zope/lib/python/App/FactoryDispatcher.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
@@ -60,7 +60,7 @@
return self.__dict__['_d'] # we don't want to wrap the result!
this=Destination
this__roles__=Destination__roles__=None
-
+
def DestinationURL(self):
"Return the URL for the destination for factory output"
@@ -79,14 +79,14 @@
w=getattr(m, '_permissionMapper', None)
if w is not None:
m=ofWrapper(aqwrap(m, getattr(w,'aq_base',w), self))
-
+
return m
# Waaa
m='Products.%s' % p.id
if sys.modules.has_key(m) and sys.modules[m]._m.has_key(name):
return sys.modules[m]._m[name]
-
+
raise AttributeError, name
# Provide acquired indicators for critical OM methods:
@@ -99,7 +99,7 @@
def manage_main(trueself, self, REQUEST, update_menu=0):
"""Implement a contents view by redirecting to the true view
"""
- d = update_menu and '/manage_main?update_menu=1' or '/manage_main'
+ d = update_menu and '/manage_main?update_menu=1' or '/manage_main'
REQUEST['RESPONSE'].redirect(self.DestinationURL()+d)
@@ -109,5 +109,3 @@
self._o=o
def __of__(self, parent): return self.__dict__['_o']
-
-
=== Zope/lib/python/App/FindHomes.py 1.10 => 1.11 ===
--- Zope/lib/python/App/FindHomes.py:1.10 Tue Jul 9 11:14:50 2002
+++ Zope/lib/python/App/FindHomes.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
"""Commonly used utility functions."""
@@ -25,7 +25,7 @@
home=package_home(Products.__dict__)
if not os.path.isabs(home):
home=path_join(os.getcwd(), home)
-
+
home,e=path_split(home)
if path_split(home)[1]=='.': home=path_split(home)[0]
if path_split(home)[1]=='..':
@@ -76,7 +76,7 @@
if disallow in ('no', 'off', '0', ''):
ppath.insert(0, ip)
ippart = 1
-
+
ppathpat = os.environ.get('PRODUCTS_PATH', None)
if ppathpat is not None:
psep = os.pathsep
=== Zope/lib/python/App/Hotfixes.py 1.7 => 1.8 ===
--- Zope/lib/python/App/Hotfixes.py:1.7 Fri Jun 14 15:57:57 2002
+++ Zope/lib/python/App/Hotfixes.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
from version_txt import getZopeVersion
@@ -57,4 +57,3 @@
apply_hotfix = APPLY
logHotfix(id, apply_hotfix)
return apply_hotfix
-
=== Zope/lib/python/App/ImageFile.py 1.17 => 1.18 ===
--- Zope/lib/python/App/ImageFile.py:1.17 Mon Apr 15 10:30:20 2002
+++ Zope/lib/python/App/ImageFile.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
"""Image object that is stored in a file"""
@@ -35,7 +35,7 @@
self.path=path
if Globals.DevelopmentMode:
# In development mode, a shorter time is handy
- max_age = 60 # One minute
+ max_age = 60 # One minute
else:
# A longer time reduces latency in production mode
max_age = 3600 # One hour
@@ -96,8 +96,7 @@
def __len__(self):
# This is bogus and needed because of the way Python tests truth.
- return 1
+ return 1
def __str__(self):
- return '<img src="%s" alt="" />' % self.__name__
-
+ return '<img src="%s" alt="" />' % self.__name__
=== Zope/lib/python/App/Management.py 1.60 => 1.61 ===
--- Zope/lib/python/App/Management.py:1.60 Fri Apr 12 15:45:33 2002
+++ Zope/lib/python/App/Management.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
"""Standard management interface support
@@ -27,7 +27,7 @@
manage_tabs__roles__=('Anonymous',)
manage_tabs=DTMLFile('dtml/manage_tabs', globals())
-
+
manage_options =()
@@ -35,7 +35,7 @@
def filtered_manage_options(self, REQUEST=None):
validate=getSecurityManager().validate
-
+
result=[]
try: options=tuple(self.manage_options)
@@ -61,8 +61,8 @@
result.append(d)
return result
-
-
+
+
manage_workspace__roles__=('Authenticated',)
def manage_workspace(self, REQUEST):
"""Dispatch to first interface in manage_options
@@ -78,9 +78,9 @@
if m.find('/'):
raise 'Redirect', (
"%s/%s" % (REQUEST['URL1'], m))
-
+
return getattr(self, m)(self, REQUEST)
-
+
def tabs_path_default(self, REQUEST,
# Static var
unquote=urllib.unquote,
=== Zope/lib/python/App/Permission.py 1.7 => 1.8 ===
--- Zope/lib/python/App/Permission.py:1.7 Wed Nov 28 10:50:52 2001
+++ Zope/lib/python/App/Permission.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
__doc__='''Zope registerable permissions
@@ -33,7 +33,7 @@
+AccessControl.Role.RoleManager.manage_options
+OFS.SimpleItem.Item.manage_options
)
-
+
def __init__(self, id, title, name):
self.id=id
self.title=title
@@ -89,4 +89,3 @@
self._setObject(id,i)
if REQUEST is not None:
return self.manage_main(self,REQUEST,update_menu=1)
-
=== Zope/lib/python/App/PersistentExtra.py 1.7 => 1.8 ===
--- Zope/lib/python/App/PersistentExtra.py:1.7 Wed Nov 28 10:50:52 2001
+++ Zope/lib/python/App/PersistentExtra.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
from class_init import default__class_init__
@@ -24,7 +24,7 @@
jar=self._p_jar
oid=self._p_oid
if jar is None or oid is None: return DateTime()
-
+
try:
t=self._p_mtime
if t is None: return DateTime()
@@ -40,7 +40,7 @@
try: mv=jar.modifiedInVersion
except: pass
else: return mv(oid)
-
+
# BoboPOS 2 code:
oid=self._p_oid
return (oid
@@ -68,5 +68,5 @@
try: jar.db[self._p_oid]
except: return 0
return 1
-
+
for k, v in PersistentUtil.__dict__.items(): Persistent.__dict__[k]=v
=== Zope/lib/python/App/Product.py 1.57 => 1.58 ===
--- Zope/lib/python/App/Product.py:1.57 Thu Aug 1 12:00:39 2002
+++ Zope/lib/python/App/Product.py Wed Aug 14 17:31:40 2002
@@ -1,35 +1,35 @@
##############################################################################
#
# 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
-#
+#
##############################################################################
"""Product objects
"""
# The new Product model:
-#
+#
# Products may be defined in the Products folder or by placing directories
# in lib/python/Products.
-#
+#
# Products in lib/python/Products may have up to three sources of information:
-#
+#
# - Static information defined via Python. This information is
# described and made available via __init__.py.
-#
+#
# - Dynamic object data that gets copied into the Bobobase.
# This is contained in product.dat (which is obfuscated).
-#
+#
# - Static extensions supporting the dynamic data. These too
# are obfuscated.
-#
+#
# Products may be copied and pasted only within the products folder.
-#
+#
# If a product is deleted (or cut), it is automatically recreated
# on restart if there is still a product directory.
@@ -106,8 +106,8 @@
start = match.start()
end = match.end()
return v[:start] + str(1 + int(v[start:end])) + v[end:]
-
-
+
+
meta_types=(
ZClasses.meta_types+PermissionManager.meta_types+
(
@@ -117,7 +117,7 @@
},
)
)
-
+
manage_addZClassForm=ZClasses.methods['manage_addZClassForm']
manage_addZClass =ZClasses.methods['manage_addZClass']
manage_subclassableClassNames=ZClasses.methods[
@@ -164,7 +164,7 @@
self._setObject('Help', ProductHelp('Help', id))
except:
pass
-
+
def Destination(self):
"Return the destination for factory output"
return self
@@ -185,14 +185,14 @@
self.redistributable=redistributable
RESPONSE.redirect('Distributions/%s-%s.tar.gz' %
(quote(self.id), quote(version)))
-
+
def _distribution(self):
# Return a distribution
if self.__dict__.has_key('manage_options'):
raise TypeError, 'This product is <b>not</b> redistributable.'
id=self.id
-
+
import tar
rot=rotor.newrotor(id+' shshsh')
ar=tar.tgzarchive("%s-%s" % (id, self.version))
@@ -471,7 +471,7 @@
class Distribution:
"A distribution builder"
-
+
def __init__(self, product):
self._product=product
@@ -500,7 +500,7 @@
# Version hasn't changed. Don't reinitialize.
return old
except: pass
-
+
disable_distribution = 1
try:
f=CompressedInputFile(open(home+'/product.dat','rb'), name+' shshsh')
=== Zope/lib/python/App/ProductContext.py 1.40 => 1.41 ===
--- Zope/lib/python/App/ProductContext.py:1.40 Fri Jun 7 13:18:28 2002
+++ Zope/lib/python/App/ProductContext.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
"""Objects providing context for product initialization
"""
@@ -41,7 +41,7 @@
self.__app=app
self.__pack=package
- def registerClass(self, instance_class=None, meta_type='',
+ def registerClass(self, instance_class=None, meta_type='',
permission=None, constructors=(),
icon=None, permissions=None, legacy=(),
visibility="Global",interfaces=_marker,
@@ -52,7 +52,7 @@
Keyword arguments are used to provide meta data:
instance_class -- The class of the object that will be created.
-
+
This is not currently used, but may be used in the future to
increase object mobility.
@@ -81,7 +81,7 @@
permissions -- Additional permissions to be registered
If not provided, then permissions defined in the
class will be registered.
-
+
legacy -- A list of legacy methods to be added to ObjectManager
for backward compatibility
@@ -95,7 +95,7 @@
filter is called before showing ObjectManager's Add list,
and before pasting (after object copy or cut), but not
before calling an object's constructor.
-
+
"""
app=self.__app
pack=self.__pack
@@ -216,18 +216,18 @@
module=base_class.__module__
name=base_class.__name__
-
+
key="%s/%s" % (module, name)
if module[:9]=='Products.': module=module.split('.')[1]
else: module=module.split('.')[0]
-
+
info="%s: %s" % (module, name)
Products.meta_class_info[key]=info # meta_type
Products.meta_classes[key]=Z
-
-
+
+
def registerBaseClass(self, base_class, meta_type=None):
#
@@ -274,7 +274,7 @@
HelpTopics are created for these kind of files
.dtml -- DTMLHelpTopic
- .html .htm -- TextHelpTopic
+ .html .htm -- TextHelpTopic
.stx .txt -- STXHelpTopic
.jpg .png .gif -- ImageHelpTopic
.py -- APIHelpTopic
@@ -333,5 +333,3 @@
continue
ht=APIHelpTopic.APIHelpTopic(file, '', os.path.join(path, file))
self.registerHelpTopic(file, ht)
-
-
=== Zope/lib/python/App/ProductRegistry.py 1.14 => 1.15 ===
--- Zope/lib/python/App/ProductRegistry.py:1.14 Wed Nov 28 10:50:52 2001
+++ Zope/lib/python/App/ProductRegistry.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
# Product registry and new product factory model. There will be a new
@@ -28,7 +28,7 @@
# are defined through the web.
# This class is a mix-in class for the top-level application object.
-
+
def _manage_remove_product_meta_type(self, product,
id=None, meta_type=None):
r=[]
@@ -40,12 +40,12 @@
continue
elif meta_type==mt['name']: continue
r.append(mt)
-
+
self._setProductRegistryMetaTypes(tuple(r))
def _constructor_prefix_string(self, pid):
return 'manage_addProduct/%s/' % pid
-
+
def _manage_add_product_meta_type(self, product, id, meta_type,
permission=''):
pid=product.id
@@ -70,9 +70,9 @@
'product': pid
}
if permission: mt['permission']=permission
-
+
self._setProductRegistryMetaTypes(meta_types+(mt,))
-
+
def _manage_remove_product_permission(self, product, permission=None):
r=[]
r2=[]
@@ -85,7 +85,7 @@
elif permission==d['name']: continue
r.append(d)
r2.append((d['name'], d['methods'], d['default']))
-
+
self._setProductRegistryData('permissions', tuple(r))
self._setProductRegistryData('ac_permissions', tuple(r2))
@@ -100,10 +100,10 @@
raise 'Type Exists', (
'The permission <em>%s</em> is already defined.'
% permission)
-
+
d={'name': permission, 'methods': methods, 'permission': permission,
'default': default, 'product': product.id}
-
+
self._setProductRegistryData('permissions', permissions + (d,))
self._setProductRegistryData(
'ac_permissions',
@@ -175,5 +175,3 @@
return setattr(self, name, v)
else:
raise AttributeError, name
-
-
=== Zope/lib/python/App/RefreshFuncs.py 1.5 => 1.6 ===
--- Zope/lib/python/App/RefreshFuncs.py:1.5 Sat Jun 15 21:56:00 2002
+++ Zope/lib/python/App/RefreshFuncs.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
'''
Functions for refreshing products.
@@ -52,7 +52,7 @@
if create:
root['RefreshData'] = rd
return rd
-
+
def isAutoRefreshEnabled(jar, productid):
rd = _getCentralRefreshData(jar)
ids = rd.get('auto', None)
@@ -118,7 +118,7 @@
reload_var = getattr(module, '__reload_module__', _marker)
if reload_var is _marker:
reload_var = 1
- return reload_var
+ return reload_var
def listRefreshableModules(productid):
prefix = "Products.%s" % productid
@@ -329,4 +329,3 @@
connection_open_hooks.append(autoRefresh)
# Init mod times.
checkAutoRefresh(jar)
-
=== Zope/lib/python/App/Undo.py 1.30 => 1.31 ===
--- Zope/lib/python/App/Undo.py:1.30 Fri Feb 8 13:58:23 2002
+++ Zope/lib/python/App/Undo.py Wed Aug 14 17:31:40 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
-#
+#
##############################################################################
__doc__='''short description
@@ -74,10 +74,10 @@
first_transaction+PrincipiaUndoBatchSize)
spec={}
-
+
# A user is allowed to undo transactions that were initiated
# by any member of a user folder in the place where the user
- # is defined.
+ # is defined.
user = getSecurityManager().getUser()
if hasattr(user, 'aq_parent'):
path = '/'.join(user.aq_parent.getPhysicalPath()[1:-1])
@@ -109,7 +109,7 @@
return r
-
+
def manage_undo_transactions(self, transaction_info=(), REQUEST=None):
"""
"""
@@ -120,26 +120,26 @@
get_transaction().note("Undo %s" % ''.join(tid[1:]))
tid=decode64(tid[0])
undo(tid)
-
+
if REQUEST is None: return
REQUEST['RESPONSE'].redirect("%s/manage_UndoForm" % REQUEST['URL1'])
return ''
-
+
Globals.default__class_init__(UndoSupport)
class Prefix:
-
+
__no_side_effects__=1
def __init__(self, path):
self.value = len(path), path
-
+
def __cmp__(self, o):
l,v = self.value
rval = cmp(o[:l],v)
return rval
-
+
########################################################################
=== Zope/lib/python/App/__init__.py 1.4 => 1.5 ===
--- Zope/lib/python/App/__init__.py:1.4 Wed Nov 28 10:50:53 2001
+++ Zope/lib/python/App/__init__.py Wed Aug 14 17:31:41 2002
@@ -1,12 +1,12 @@
##############################################################################
#
# 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
-#
+#
##############################################################################
=== Zope/lib/python/App/class_init.py 1.13 => 1.14 ===
--- Zope/lib/python/App/class_init.py:1.13 Fri Apr 12 11:23:56 2002
+++ Zope/lib/python/App/class_init.py Wed Aug 14 17:31:41 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
-#
+#
##############################################################################
from AccessControl.PermissionRole import PermissionRole
@@ -18,7 +18,7 @@
_View_Permission='Manager', 'Anonymous'
_Access_contents_information_Permission='Manager', 'Anonymous'
-
+
def default__class_init__(self):
dict=self.__dict__
have=dict.has_key
@@ -56,7 +56,7 @@
# delete the SecurityInfo from the class dict after it has been
# applied out of paranoia.
for key, value in dict_items:
- if hasattr(value, '__security_info__'):
+ if hasattr(value, '__security_info__'):
security_info=value
security_info.apply(self)
del dict[key]
=== Zope/lib/python/App/special_dtml.py 1.23 => 1.24 ===
--- Zope/lib/python/App/special_dtml.py:1.23 Thu Aug 1 12:00:39 2002
+++ Zope/lib/python/App/special_dtml.py Wed Aug 14 17:31:41 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
-#
+#
##############################################################################
import DocumentTemplate, Common, Persistence, MethodObject, Globals, os, sys
@@ -75,7 +75,7 @@
class DTMLFile(Bindings, Explicit, ClassicHTMLFile):
"HTMLFile with bindings and support for __render_with_namespace__"
-
+
func_code = None
func_defaults = None
_need__name__=1
@@ -99,7 +99,7 @@
self._setFuncSignature()
apply(DTMLFile.inheritedAttribute('__init__'),
(self, name, _prefix), kw)
-
+
def getOwner(self, info=0):
'''
This method is required of all objects that go into
@@ -110,14 +110,14 @@
def _exec(self, bound_data, args, kw):
# Cook if we haven't already
self._cook_check()
-
+
# Get our caller's namespace, and set up our own.
cns = bound_data['caller_namespace']
ns = self._Bindings_ns_class()
push = ns._push
ns.guarded_getattr = None
ns.guarded_getitem = None
-
+
req = None
kw_bind = kw
if cns:
@@ -173,9 +173,9 @@
if value is _marker:
try: result = render_blocks(self._v_blocks, ns)
except DTReturn, v: result = v.v
- except AttributeError:
+ except AttributeError:
if type(sys.exc_value)==InstanceType and sys.exc_value.args[0]=="_v_blocks":
- LOG("ZPublisher",WARNING,"DTML file '%s' could not be read" % self.raw)
+ LOG("ZPublisher",WARNING,"DTML file '%s' could not be read" % self.raw)
raise "DTML file error","Check logfile for details"
else:
raise
@@ -192,4 +192,3 @@
HTMLFile = ClassicHTMLFile
-
=== Zope/lib/python/App/tar.py 1.5 => 1.6 ===
--- Zope/lib/python/App/tar.py:1.5 Thu Feb 7 12:37:10 2002
+++ Zope/lib/python/App/tar.py Wed Aug 14 17:31:41 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
-#
+#
##############################################################################
__doc__='''Simple module for writing tar files
@@ -20,7 +20,7 @@
from newstruct import pack
except:
from struct import pack
-
+
def oct8(i):
i=oct(i)
@@ -29,7 +29,7 @@
def oct12(i):
i=oct(i)
return '0'*(11-len(i))+i+' '
-
+
def pad(s,l):
ls=len(s)
if ls >= l: raise ValueError, 'value, %s, too wide for field (%d)' % (s,l)
@@ -73,7 +73,7 @@
l=len(data)
if l%512: data=data+'\0'*(512-l%512)
return self.header+data
-
+
def tar(entries):
r=[]
ra=r.append
@@ -103,7 +103,7 @@
def finish(self):
self._f.write('\0'*1024)
-
+
def __str__(self):
return self._f.getdata()
=== Zope/lib/python/App/version_txt.py 1.7 => 1.8 ===
--- Zope/lib/python/App/version_txt.py:1.7 Thu Feb 7 12:37:10 2002
+++ Zope/lib/python/App/version_txt.py Wed Aug 14 17:31:41 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
-#
+#
##############################################################################
import os,sys,re
@@ -37,7 +37,7 @@
def _prep_version_data():
global _version_string, _zope_version
if _version_string is None:
- try:
+ try:
s = open(os.path.join(SOFTWARE_HOME,'version.txt')).read()
ss = re.sub("\(.*?\)\?","",s)
ss = '%s, python %d.%d.%d, %s' % (ss,v[0],v[1],v[2],sys.platform)
@@ -59,7 +59,7 @@
v[0],v[1],v[2],sys.platform)
_version_string = ss
_zope_version = (-1, -1, -1, '', -1)
-
+
def version_txt():
_prep_version_data()
@@ -73,4 +73,3 @@
"""
_prep_version_data()
return _zope_version
-