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
e5a0dc12
Commit
e5a0dc12
authored
Mar 04, 1998
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added comment and raise tags
parent
3305e327
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
221 additions
and
0 deletions
+221
-0
lib/python/DocumentTemplate/DT_Comment.py
lib/python/DocumentTemplate/DT_Comment.py
+87
-0
lib/python/DocumentTemplate/DT_Raise.py
lib/python/DocumentTemplate/DT_Raise.py
+132
-0
lib/python/DocumentTemplate/Setup
lib/python/DocumentTemplate/Setup
+2
-0
No files found.
lib/python/DocumentTemplate/DT_Comment.py
0 → 100644
View file @
e5a0dc12
#!/usr/local/bin/python
# $What$
__doc__
=
'''Comments
The 'comment' tag can be used to simply include comments
in DTML source.
'''
# '
__rcs_id__
=
'$Id: DT_Comment.py,v 1.1 1998/03/04 18:19:56 jim Exp $'
############################################################################
# Copyright
#
# Copyright 1996 Digital Creations, L.C., 910 Princess Anne
# Street, Suite 300, Fredericksburg, Virginia 22401 U.S.A. All
# rights reserved. Copyright in this software is owned by DCLC,
# unless otherwise indicated. Permission to use, copy and
# distribute this software is hereby granted, provided that the
# above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear. Note that
# any product, process or technology described in this software
# may be the subject of other Intellectual Property rights
# reserved by Digital Creations, L.C. and are not licensed
# hereunder.
#
# Trademarks
#
# Digital Creations & DCLC, are trademarks of Digital Creations, L.C..
# All other trademarks are owned by their respective companies.
#
# No Warranty
#
# The software is provided "as is" without warranty of any kind,
# either express or implied, including, but not limited to, the
# implied warranties of merchantability, fitness for a particular
# purpose, or non-infringement. This software could include
# technical inaccuracies or typographical errors. Changes are
# periodically made to the software; these changes will be
# incorporated in new editions of the software. DCLC may make
# improvements and/or changes in this software at any time
# without notice.
#
# Limitation Of Liability
#
# In no event will DCLC be liable for direct, indirect, special,
# incidental, economic, cover, or consequential damages arising
# out of the use of or inability to use this software even if
# advised of the possibility of such damages. Some states do not
# allow the exclusion or limitation of implied warranties or
# limitation of liability for incidental or consequential
# damages, so the above limitation or exclusion may not apply to
# you.
#
#
# If you have questions regarding this software,
# contact:
#
# Jim Fulton, jim@digicool.com
#
# (540) 371-6909
#
############################################################################
__version__
=
'$Revision: 1.1 $'
[
11
:
-
2
]
from
DT_Util
import
*
from
string
import
find
,
split
,
join
class
Comment
:
name
=
'comment'
blockContinuations
=
()
def
__init__
(
self
,
args
,
fmt
=
''
):
pass
def
render
(
self
,
md
):
return
''
__call__
=
render
############################################################################
# $Log: DT_Comment.py,v $
# Revision 1.1 1998/03/04 18:19:56 jim
# added comment and raise tags
#
#
lib/python/DocumentTemplate/DT_Raise.py
0 → 100644
View file @
e5a0dc12
'''Raising exceptions
Errors can be raised from DTML using the 'raise' tag.
For example:
<!--#if expr="condition_that_tests_input"-->
<!--#raise type="Input Error"-->
The value you entered is not valid
<!--#/raise-->
<!--#/if-->
'''
############################################################################
# Copyright
#
# Copyright 1996 Digital Creations, L.C., 910 Princess Anne
# Street, Suite 300, Fredericksburg, Virginia 22401 U.S.A. All
# rights reserved. Copyright in this software is owned by DCLC,
# unless otherwise indicated. Permission to use, copy and
# distribute this software is hereby granted, provided that the
# above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear. Note that
# any product, process or technology described in this software
# may be the subject of other Intellectual Property rights
# reserved by Digital Creations, L.C. and are not licensed
# hereunder.
#
# Trademarks
#
# Digital Creations & DCLC, are trademarks of Digital Creations, L.C..
# All other trademarks are owned by their respective companies.
#
# No Warranty
#
# The software is provided "as is" without warranty of any kind,
# either express or implied, including, but not limited to, the
# implied warranties of merchantability, fitness for a particular
# purpose, or non-infringement. This software could include
# technical inaccuracies or typographical errors. Changes are
# periodically made to the software; these changes will be
# incorporated in new editions of the software. DCLC may make
# improvements and/or changes in this software at any time
# without notice.
#
# Limitation Of Liability
#
# In no event will DCLC be liable for direct, indirect, special,
# incidental, economic, cover, or consequential damages arising
# out of the use of or inability to use this software even if
# advised of the possibility of such damages. Some states do not
# allow the exclusion or limitation of implied warranties or
# limitation of liability for incidental or consequential
# damages, so the above limitation or exclusion may not apply to
# you.
#
#
# If you have questions regarding this software,
# contact:
#
# Jim Fulton, jim@digicool.com
#
# (540) 371-6909
#
############################################################################
__rcs_id__
=
'$Id: DT_Raise.py,v 1.1 1998/03/04 18:19:56 jim Exp $'
__version__
=
'$Revision: 1.1 $'
[
11
:
-
2
]
from
DT_Util
import
*
import
sys
class
Raise
:
blockContinuations
=
()
name
=
'raise'
expr
=
''
def
__init__
(
self
,
blocks
):
tname
,
args
,
self
.
section
=
blocks
[
0
]
args
=
parse_params
(
args
,
type
=
''
,
expr
=
''
)
self
.
__name__
,
self
.
expr
=
name_param
(
args
,
'raise'
,
1
,
attr
=
'type'
)
def
render
(
self
,
md
):
expr
=
self
.
expr
if
expr
is
None
:
t
=
self
.
__name__
if
__builtins__
.
has_key
(
t
):
t
=
__builtins__
[
t
]
else
:
try
:
t
=
expr
.
eval
(
md
)
except
:
t
=
'Invalid Error Type Expression'
try
:
v
=
self
.
section
(
None
,
md
)
except
:
v
=
'Invalid Error Value'
raise
t
,
v
__call__
=
render
##########################################################################
#
# $Log: DT_Raise.py,v $
# Revision 1.1 1998/03/04 18:19:56 jim
# added comment and raise tags
#
# Revision 1.8 1998/01/14 18:23:42 jim
# Added expr to unless.
#
# Revision 1.7 1998/01/14 18:03:25 jim
# Added Unless tag as replacement for else tag.
#
# Revision 1.6 1997/12/31 20:32:11 jim
# If and else blocks now cache variables.
#
# Revision 1.5 1997/11/07 17:08:11 jim
# Changed so exception is raised if a sequence cannot be gotten during
# rendering.
#
# Revision 1.4 1997/09/25 18:56:38 jim
# fixed problem in reporting errors
#
# Revision 1.3 1997/09/22 14:42:49 jim
# added expr
#
# Revision 1.2 1997/09/08 15:35:40 jim
# Fixed bug that caused else blocks to render if blocks.
#
# Revision 1.1 1997/08/27 18:55:42 jim
# initial
#
lib/python/DocumentTemplate/Setup
View file @
e5a0dc12
...
@@ -6,6 +6,8 @@ cDocumentTemplate ./cDocumentTemplate.c -I/projects/_/ExtensionClass
...
@@ -6,6 +6,8 @@ cDocumentTemplate ./cDocumentTemplate.c -I/projects/_/ExtensionClass
# install DT_HTML.py
# install DT_HTML.py
# install DT_If.py
# install DT_If.py
# install DT_In.py
# install DT_In.py
# install DT_Comment.py
# install DT_Raise.py
# install DT_String.py
# install DT_String.py
# install DT_UI.py
# install DT_UI.py
# install DT_Util.py
# install DT_Util.py
...
...
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