Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
16688f87
Commit
16688f87
authored
Oct 08, 2008
by
Sidnei da Silva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Some PEP-328 related changes. Need to make imports conditionally
relative using new syntax so that they work on Python 2.6.
parent
6219e315
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
13 deletions
+52
-13
lib/python/DocumentTemplate/DT_Return.py
lib/python/DocumentTemplate/DT_Return.py
+5
-1
lib/python/DocumentTemplate/DT_String.py
lib/python/DocumentTemplate/DT_String.py
+11
-3
lib/python/DocumentTemplate/DT_Util.py
lib/python/DocumentTemplate/DT_Util.py
+16
-3
lib/python/DocumentTemplate/DT_Var.py
lib/python/DocumentTemplate/DT_Var.py
+11
-3
lib/python/DocumentTemplate/DocumentTemplate.py
lib/python/DocumentTemplate/DocumentTemplate.py
+8
-2
lib/python/DocumentTemplate/cDocumentTemplate.c
lib/python/DocumentTemplate/cDocumentTemplate.c
+1
-1
No files found.
lib/python/DocumentTemplate/DT_Return.py
View file @
16688f87
...
...
@@ -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'
...
...
lib/python/DocumentTemplate/DT_String.py
View file @
16688f87
...
...
@@ -16,9 +16,17 @@ import os
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.
...
...
lib/python/DocumentTemplate/DT_Util.py
View file @
16688f87
...
...
@@ -16,12 +16,25 @@ $Id$"""
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!
...
...
lib/python/DocumentTemplate/DT_Var.py
View file @
16688f87
...
...
@@ -151,14 +151,22 @@ Evaluating expressions without rendering results
'''
# '
__rcs_id__
=
'$Id$'
__version__
=
'$Revision: 1.60 $'
[
11
:
-
2
]
from
cgi
import
escape
import
string
,
re
,
sys
from
cgi
import
escape
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
...
...
lib/python/DocumentTemplate/DocumentTemplate.py
View file @
16688f87
...
...
@@ -109,6 +109,12 @@ __version__='$Revision: 1.14 $'[11:-2]
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
lib/python/DocumentTemplate/cDocumentTemplate.c
View file @
16688f87
...
...
@@ -972,7 +972,7 @@ initcDocumentTemplate(void)
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"
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment