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
20164192
Commit
20164192
authored
Sep 04, 2001
by
Evan Simpson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow subclassing of TemplateDict
parent
a8759581
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
lib/python/DocumentTemplate/DT_String.py
lib/python/DocumentTemplate/DT_String.py
+4
-2
lib/python/DocumentTemplate/DT_Util.py
lib/python/DocumentTemplate/DT_Util.py
+6
-3
No files found.
lib/python/DocumentTemplate/DT_String.py
View file @
20164192
...
@@ -82,7 +82,7 @@
...
@@ -82,7 +82,7 @@
# attributions are listed in the accompanying credits file.
# attributions are listed in the accompanying credits file.
#
#
##############################################################################
##############################################################################
"$Id: DT_String.py,v 1.4
6 2001/06/21 17:45:12 shane
Exp $"
"$Id: DT_String.py,v 1.4
7 2001/09/04 13:46:43 evan
Exp $"
from
string
import
split
,
strip
from
string
import
split
,
strip
import
thread
,
re
,
exceptions
,
os
import
thread
,
re
,
exceptions
,
os
...
@@ -486,7 +486,9 @@ class String:
...
@@ -486,7 +486,9 @@ class String:
pushed
=
None
pushed
=
None
try
:
try
:
if
mapping
.
__class__
is
TemplateDict
:
pushed
=
0
# Support Python 1.5.2, but work better in 2.1
if
(
mapping
.
__class__
is
TemplateDict
or
isinstance
(
mapping
,
TemplateDict
)):
pushed
=
0
except
:
pass
except
:
pass
globals
=
self
.
globals
globals
=
self
.
globals
...
...
lib/python/DocumentTemplate/DT_Util.py
View file @
20164192
...
@@ -82,8 +82,8 @@
...
@@ -82,8 +82,8 @@
# attributions are listed in the accompanying credits file.
# attributions are listed in the accompanying credits file.
#
#
##############################################################################
##############################################################################
'''$Id: DT_Util.py,v 1.8
2 2001/07/05 12:19:40 andreas
Exp $'''
'''$Id: DT_Util.py,v 1.8
3 2001/09/04 13:46:43 evan
Exp $'''
__version__
=
'$Revision: 1.8
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.8
3
$'
[
11
:
-
2
]
import
re
,
os
import
re
,
os
from
html_quote
import
html_quote
# for import by other modules, dont remove!
from
html_quote
import
html_quote
# for import by other modules, dont remove!
...
@@ -145,6 +145,7 @@ if LIMITED_BUILTINS:
...
@@ -145,6 +145,7 @@ if LIMITED_BUILTINS:
_marker
=
[]
# Create a new marker object.
_marker
=
[]
# Create a new marker object.
def
careful_getattr
(
md
,
inst
,
name
,
default
=
_marker
):
def
careful_getattr
(
md
,
inst
,
name
,
default
=
_marker
):
get
=
md
.
guarded_getattr
get
=
md
.
guarded_getattr
if
get
is
None
:
if
get
is
None
:
get
=
getattr
get
=
getattr
...
@@ -156,6 +157,7 @@ def careful_getattr(md, inst, name, default=_marker):
...
@@ -156,6 +157,7 @@ def careful_getattr(md, inst, name, default=_marker):
return
default
return
default
def
careful_hasattr
(
md
,
inst
,
name
):
def
careful_hasattr
(
md
,
inst
,
name
):
get
=
md
.
guarded_getattr
get
=
md
.
guarded_getattr
if
get
is
None
:
if
get
is
None
:
get
=
getattr
get
=
getattr
...
@@ -172,7 +174,8 @@ d['hasattr']=careful_hasattr
...
@@ -172,7 +174,8 @@ d['hasattr']=careful_hasattr
def
namespace
(
self
,
**
kw
):
def
namespace
(
self
,
**
kw
):
"""Create a tuple consisting of a single instance whose attributes are
"""Create a tuple consisting of a single instance whose attributes are
provided as keyword arguments."""
provided as keyword arguments."""
if
getattr
(
self
,
'__class__'
,
None
)
!=
TemplateDict
:
if
not
(
getattr
(
self
,
'__class__'
,
None
)
==
TemplateDict
or
isinstance
(
self
,
TemplateDict
)):
raise
TypeError
,
'''A call was made to DT_Util.namespace() with an
raise
TypeError
,
'''A call was made to DT_Util.namespace() with an
incorrect "self" argument. It could be caused by a product which
incorrect "self" argument. It could be caused by a product which
is not yet compatible with this version of Zope. The traceback
is not yet compatible with this version of Zope. The traceback
...
...
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