Log message for revision 91894:
  - Some PEP-328 related changes. Need to make imports conditionally
    relative using new syntax so that they work on Python 2.6.
  
  

Changed:
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Return.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_String.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
  U   Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Var.py
  U   
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DocumentTemplate.py
  U   
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/cDocumentTemplate.c

-=-
Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Return.py
===================================================================
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Return.py      
2008-10-08 05:02:37 UTC (rev 91893)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Return.py      
2008-10-08 06:43:00 UTC (rev 91894)
@@ -12,7 +12,11 @@
 ##############################################################################
 __version__='$Revision: 1.9 $'[11:-2]
 
-from DT_Util import parse_params, name_param
+try:
+    from DT_Util import parse_params, name_param
+except ImportError:
+    # See PEP-328
+    from .DT_Util import parse_params, name_param
 
 class ReturnTag:
     name='return'

Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_String.py
===================================================================
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_String.py      
2008-10-08 05:02:37 UTC (rev 91893)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_String.py      
2008-10-08 06:43:00 UTC (rev 91894)
@@ -16,9 +16,17 @@
 import thread
 import re
 
-from DT_Util import ParseError, InstanceDict, TemplateDict, render_blocks, str
-from DT_Var import Var, Call, Comment
-from DT_Return import ReturnTag, DTReturn
+try:
+    from DT_Util import ParseError, InstanceDict
+    from DT_Util import TemplateDict, render_blocks, str
+    from DT_Var import Var, Call, Comment
+    from DT_Return import ReturnTag, DTReturn
+except ImportError:
+    # See PEP-328
+    from .DT_Util import ParseError, InstanceDict
+    from .DT_Util import TemplateDict, render_blocks, str
+    from .DT_Var import Var, Call, Comment
+    from .DT_Return import ReturnTag, DTReturn
 
 _marker = []  # Create a new marker object.
 

Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py
===================================================================
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py        
2008-10-08 05:02:37 UTC (rev 91893)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Util.py        
2008-10-08 06:43:00 UTC (rev 91894)
@@ -16,12 +16,25 @@
 
 import re
 
-from html_quote import html_quote, ustr # for import by other modules, dont 
remove!
+try:
+    # for import by other modules, dont remove!
+    from html_quote import html_quote, ustr
+
+    from cDocumentTemplate import InstanceDict, TemplateDict
+    from cDocumentTemplate import render_blocks, safe_callable
+    from cDocumentTemplate import join_unicode
+except ImportError:
+    # See PEP-328: 
+    # for import by other modules, dont remove!
+    from .html_quote import html_quote, ustr
+
+    from .cDocumentTemplate import InstanceDict, TemplateDict
+    from .cDocumentTemplate import render_blocks, safe_callable
+    from .cDocumentTemplate import join_unicode
+
 from RestrictedPython.Guards import safe_builtins
 from RestrictedPython.Utilities import utility_builtins
 from RestrictedPython.Eval import RestrictionCapableEval
-from cDocumentTemplate import InstanceDict, TemplateDict, \
-         render_blocks, safe_callable, join_unicode
 
 test = utility_builtins['test'] # for backwards compatibility, dont remove!
 

Modified: Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Var.py
===================================================================
--- Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Var.py 
2008-10-08 05:02:37 UTC (rev 91893)
+++ Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DT_Var.py 
2008-10-08 06:43:00 UTC (rev 91894)
@@ -151,14 +151,22 @@
 
 
 ''' # '
+
 __rcs_id__='$Id$'
 __version__='$Revision: 1.60 $'[11:-2]
 
+import string, re, sys
 from cgi import escape
-import string, re,  sys
 from urllib import quote, quote_plus, unquote, unquote_plus
-from DT_Util import parse_params, name_param, str, ustr
-from html_quote import html_quote # for import by other modules, dont remove!
+
+try:
+    # for import by other modules, dont remove!
+    from html_quote import html_quote
+    from DT_Util import parse_params, name_param, str, ustr
+except ImportError:
+    from .html_quote import html_quote
+    from .DT_Util import parse_params, name_param, str, ustr
+
 from Acquisition import aq_base
 from ZPublisher.TaintedString import TaintedString
 from zope.structuredtext.html import HTMLWithImages, HTML

Modified: 
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DocumentTemplate.py
===================================================================
--- 
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DocumentTemplate.py   
    2008-10-08 05:02:37 UTC (rev 91893)
+++ 
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/DocumentTemplate.py   
    2008-10-08 06:43:00 UTC (rev 91894)
@@ -109,6 +109,12 @@
 
 ParseError='Document Template Parse Error'
 
-from DT_String import String, File
-from DT_HTML import HTML, HTMLFile, HTMLDefault
+try:
+    from DT_String import String, File
+    from DT_HTML import HTML, HTMLFile, HTMLDefault
+except ImportError:
+    # See PEP-328
+    from .DT_String import String, File
+    from .DT_HTML import HTML, HTMLFile, HTMLDefault
+
 # import DT_UI # Install HTML editing

Modified: 
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/cDocumentTemplate.c
===================================================================
--- 
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/cDocumentTemplate.c   
    2008-10-08 05:02:37 UTC (rev 91893)
+++ 
Zope/branches/gsoc-python-2.5/lib/python/DocumentTemplate/cDocumentTemplate.c   
    2008-10-08 06:43:00 UTC (rev 91894)
@@ -972,7 +972,7 @@
 
   DictInstanceType.ob_type=&PyType_Type;
 
-  UNLESS (html_quote = PyImport_ImportModule("html_quote")) return;
+  UNLESS (html_quote = PyImport_ImportModule("DocumentTemplate.html_quote")) 
return;
   ASSIGN(ustr, PyObject_GetAttrString(html_quote, "ustr"));
   UNLESS (ustr) return;
   ASSIGN(html_quote, PyObject_GetAttrString(html_quote, "html_quote"));

_______________________________________________
Zope-Checkins maillist  -  Zope-Checkins@zope.org
http://mail.zope.org/mailman/listinfo/zope-checkins

Reply via email to