Commit eea8b328 authored by Jim Fulton's avatar Jim Fulton

Added Unless tag as replacement for else tag.

parent d9572241
...@@ -117,8 +117,8 @@ __doc__='''Conditional insertion ...@@ -117,8 +117,8 @@ __doc__='''Conditional insertion
# (540) 371-6909 # (540) 371-6909
# #
############################################################################ ############################################################################
__rcs_id__='$Id: DT_If.py,v 1.6 1997/12/31 20:32:11 jim Exp $' __rcs_id__='$Id: DT_If.py,v 1.7 1998/01/14 18:03:25 jim Exp $'
__version__='$Revision: 1.6 $'[11:-2] __version__='$Revision: 1.7 $'[11:-2]
from DT_Util import * from DT_Util import *
import sys import sys
...@@ -180,8 +180,8 @@ class If: ...@@ -180,8 +180,8 @@ class If:
__call__=render __call__=render
class Else: class Unless:
name='else' name='unless'
blockContinuations=() blockContinuations=()
def __init__(self, blocks): def __init__(self, blocks):
...@@ -205,9 +205,17 @@ class Else: ...@@ -205,9 +205,17 @@ class Else:
__call__=render __call__=render
class Else(Unless):
# The else tag is included for backward compatibility and is deprecated.
name='else'
########################################################################## ##########################################################################
# #
# $Log: DT_If.py,v $ # $Log: DT_If.py,v $
# 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 # Revision 1.6 1997/12/31 20:32:11 jim
# If and else blocks now cache variables. # If and else blocks now cache variables.
# #
......
...@@ -27,6 +27,7 @@ class String: ...@@ -27,6 +27,7 @@ class String:
'var': DT_Var.Var, 'var': DT_Var.Var,
'in': DT_In.In, 'in': DT_In.In,
'if': DT_If.If, 'if': DT_If.If,
'unless': DT_If.Unless,
'else': DT_If.Else, 'else': DT_If.Else,
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment