opental-checkins
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OpenTAL-checkins] opental/PlacelessTranslationService PatchString...


From: Fernando Lalo Martins
Subject: [OpenTAL-checkins] opental/PlacelessTranslationService PatchString...
Date: Wed, 12 Mar 2003 20:23:01 -0500

CVSROOT:        /cvsroot/opental
Module name:    opental
Changes by:     Fernando Lalo Martins <address@hidden>  03/03/12 20:22:46

Modified files:
        PlacelessTranslationService: PatchStringIO.py __init__.py 

Log message:
        this should make PlacelessTS work in python 2.1 again

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/opental/opental/PlacelessTranslationService/PatchStringIO.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/opental/opental/PlacelessTranslationService/__init__.py.diff?tr1=1.9&tr2=1.10&r1=text&r2=text

Patches:
Index: opental/PlacelessTranslationService/PatchStringIO.py
diff -u opental/PlacelessTranslationService/PatchStringIO.py:1.1 
opental/PlacelessTranslationService/PatchStringIO.py:1.2
--- opental/PlacelessTranslationService/PatchStringIO.py:1.1    Tue Feb 18 
17:31:56 2003
+++ opental/PlacelessTranslationService/PatchStringIO.py        Wed Mar 12 
20:22:41 2003
@@ -42,7 +42,11 @@
 def new_publish(request, module_name, after_list, debug=0):
     Publish._requests[get_ident()] = request
     x = Publish.old_publish(request, module_name, after_list, debug)
-    del Publish._requests[get_ident()]
+    try:
+        del Publish._requests[get_ident()]
+    except KeyError:
+        # already deleted?
+        pass
 
     return x
 
Index: opental/PlacelessTranslationService/__init__.py
diff -u opental/PlacelessTranslationService/__init__.py:1.9 
opental/PlacelessTranslationService/__init__.py:1.10
--- opental/PlacelessTranslationService/__init__.py:1.9 Wed Mar  5 15:30:53 2003
+++ opental/PlacelessTranslationService/__init__.py     Wed Mar 12 20:22:41 2003
@@ -16,7 +16,7 @@
 #    along with this program; if not, write to the Free Software
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA
 __version__ = '''
-$Id: __init__.py,v 1.9 2003/03/05 20:30:53 lalo Exp $
+$Id: __init__.py,v 1.10 2003/03/13 01:22:41 lalo Exp $
 '''.strip()
 
 from AccessControl import ModuleSecurityInfo, allow_module, allow_class, 
allow_type
@@ -24,6 +24,12 @@
 from GettextMessageCatalog import GettextMessageCatalog
 from Products.PageTemplates.GlobalTranslationService import 
setGlobalTranslationService
 import os, fnmatch, zLOG, sys, Zope, Globals
+
+# in python 2.1 fnmatch doesn't have the filter function
+if not hasattr(fnmatch, 'filter'):
+    def fnfilter(names, pattern):
+        return [name for name in names if fnmatch.fnmatch(name, pattern)]
+    fnmatch.filter = fnfilter
 
 # patch flaky ZPT - this must be removed once someone fixes it
 # I'm leaving this enabled even for OpenPT, because it somehow manages




reply via email to

[Prev in Thread] Current Thread [Next in Thread]