[Zope-Checkins] CVS: Zope/lib/python/App - DavLockManager.py:1.5.8.1 Product.py:1.51.8.1 ProductContext.py:1.33.8.1 RefreshFuncs.py:1.1.8.2 Undo.py:1.25.34.1 special_dtml.py:1.19.6.1 version_txt.py:1.3.8.1

Shane Hathaway shane@digicool.com
Thu, 9 Aug 2001 13:34:02 -0400


Update of /cvs-repository/Zope/lib/python/App
In directory cvs.zope.org:/tmp/cvs-serv29115/lib/python/App

Modified Files:
      Tag: NR-branch
	DavLockManager.py Product.py ProductContext.py RefreshFuncs.py 
	Undo.py special_dtml.py version_txt.py 
Log Message:
Sync NR-branch with trunk.  Sorry about so many checkin messages...


=== Zope/lib/python/App/DavLockManager.py 1.5 => 1.5.8.1 ===
                     addlockinfo({'owner':lock.getCreatorPath(),
                                  'token':token})
-                addresult(p, li)
+                addresult((p, li))
                 dflag = 0
             if hasattr(bs, 'objectItems'):
                 self._findapply(ob, result, p)


=== Zope/lib/python/App/Product.py 1.51 => 1.51.8.1 ===
 import re, zlib, Globals, cPickle, marshal, rotor
 import ZClasses, ZClasses.ZClass, AccessControl.Owned
+from urllib import quote
 
 from OFS.Folder import Folder
-from string import rfind, atoi, find, strip, join
+from string import atoi, find, strip, join
 from Factory import Factory
 from Permission import PermissionManager
 import ZClasses, ZClasses.ZClass
@@ -158,14 +159,24 @@
     _isBeingUsedAsAMethod_=1
 
     def new_version(self,
-                    _intending=re.compile(r"[.]?[0-9]+$").search, #TS
+                    _intending=re.compile(r"[0-9]+").search, #TS
                     ):
         # Return a new version number based on the existing version.
         v=str(self.version)
         if not v: return '1.0'
-        if _intending(v) is None: return v
-        l=rfind(v,'.')
-        return v[:l+1]+str(1+atoi(v[l+1:]))            
+        match = _intending(v)
+        if match is None:
+            return v
+        while 1:
+            # Find the last set of digits.
+            m = _intending(v, match.end())
+            if m is None:
+                break
+            else:
+                match = m
+        start = match.start()
+        end = match.end()
+        return v[:start] + str(1 + int(v[start:end])) + v[end:]
                     
     
     meta_types=(
@@ -243,7 +254,8 @@
         self.version=version=strip(version)
         self.configurable_objects_=configurable_objects
         self.redistributable=redistributable
-        RESPONSE.redirect('Distributions/%s-%s.tar.gz' % (self.id, version))
+        RESPONSE.redirect('Distributions/%s-%s.tar.gz' %
+                          (quote(self.id), quote(version)))
         
     def _distribution(self):
         # Return a distribution


=== Zope/lib/python/App/ProductContext.py 1.33 => 1.33.8.1 ===
 
         if clear:
-            for id in help.objectIds('Help Topic'):
+            for id in help.objectIds(['Help Topic','Help Image']):
                 help._delObject(id)
 
         for file in os.listdir(path):


=== Zope/lib/python/App/RefreshFuncs.py 1.1.8.1 => 1.1.8.2 ===


=== Zope/lib/python/App/Undo.py 1.25 => 1.25.34.1 ===
         return r
     
-    def manage_undo_transactions(self, transaction_info, REQUEST=None):
+    def manage_undo_transactions(self, transaction_info=(), REQUEST=None):
         """
         """
         undo=Globals.UndoManager.undo


=== Zope/lib/python/App/special_dtml.py 1.19 => 1.19.6.1 ===
 ##############################################################################
 
-import DocumentTemplate, Common, Persistence, MethodObject, Globals, os
+import DocumentTemplate, Common, Persistence, MethodObject, Globals, os, sys
+from types import InstanceType
+from zLOG import LOG,WARNING
 
 class HTML(DocumentTemplate.HTML,Persistence.Persistent,):
     "Persistent HTML Document Templates"
@@ -164,6 +166,7 @@
     _Bindings_client = 'container'
 
     def __init__(self, name, _prefix=None, **kw):
+
         self.ZBindings_edit(defaultBindings)
         self._setFuncSignature()
         apply(DTMLFile.inheritedAttribute('__init__'),
@@ -240,6 +243,13 @@
             if value is _marker:
                 try: result = render_blocks(self._v_blocks, ns)
                 except DTReturn, v: result = v.v
+                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) 
+                        raise "DTML file error","Check logfile for details"
+                    else:
+                        raise
+
                 self.ZDocumentTemplate_afterRender(ns, result)
                 return result
             else:


=== Zope/lib/python/App/version_txt.py 1.3 => 1.3.8.1 ===
     try: 
         s = open(os.path.join(SOFTWARE_HOME,'version.txt')).read()
-        s = re.sub("\(.*?)\?","",s)
+        s = re.sub("\(.*?\)\?","",s)
         s= '(%s, python %d.%d.%d, %s)' % (s,v[0],v[1],v[2],sys.platform)
         return s
     except: