Commit 5d5311ef authored by Jim Fulton's avatar Jim Fulton

added _ prefix to push and pop methods to make them private

parent 69b6187e
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
of the module 'Missing', if present. of the module 'Missing', if present.
''' #' ''' #'
__rcs_id__='$Id: DT_In.py,v 1.11 1997/11/12 23:25:56 jim Exp $' __rcs_id__='$Id: DT_In.py,v 1.12 1997/11/19 15:42:46 jim Exp $'
############################################################################ ############################################################################
# Copyright # Copyright
...@@ -284,7 +284,7 @@ __rcs_id__='$Id: DT_In.py,v 1.11 1997/11/12 23:25:56 jim Exp $' ...@@ -284,7 +284,7 @@ __rcs_id__='$Id: DT_In.py,v 1.11 1997/11/12 23:25:56 jim Exp $'
# (540) 371-6909 # (540) 371-6909
# #
############################################################################ ############################################################################
__version__='$Revision: 1.11 $'[11:-2] __version__='$Revision: 1.12 $'[11:-2]
from DT_Util import * from DT_Util import *
from string import find, atoi, join from string import find, atoi, join
...@@ -397,7 +397,7 @@ class In: ...@@ -397,7 +397,7 @@ class In:
kw['sequence-step-end']=end kw['sequence-step-end']=end
kw['sequence-step-orphan']=orphan kw['sequence-step-orphan']=orphan
try: try:
md.push(vars) md._push(vars)
if previous: if previous:
if first > 0: if first > 0:
pstart,pend,psize=opt(None,first+overlap, pstart,pend,psize=opt(None,first+overlap,
...@@ -463,7 +463,7 @@ class In: ...@@ -463,7 +463,7 @@ class In:
result.append(section(client,md)) result.append(section(client,md))
result=join(result, '') result=join(result, '')
finally: finally:
md.pop(1) md._pop(1)
return result return result
...@@ -791,6 +791,9 @@ class sequence_variables: ...@@ -791,6 +791,9 @@ class sequence_variables:
############################################################################ ############################################################################
# $Log: DT_In.py,v $ # $Log: DT_In.py,v $
# Revision 1.12 1997/11/19 15:42:46 jim
# added _ prefix to push and pop methods to make them private
#
# Revision 1.11 1997/11/12 23:25:56 jim # Revision 1.11 1997/11/12 23:25:56 jim
# Fixed bug in expr handling. # Fixed bug in expr handling.
# #
......
...@@ -329,13 +329,13 @@ class String: ...@@ -329,13 +329,13 @@ class String:
if pushed is not None: if pushed is not None:
# We were passed a TemplateDict, so we must be a sub-template # We were passed a TemplateDict, so we must be a sub-template
md=mapping md=mapping
push=md.push push=md._push
if globals: if globals:
push(self.globals) push(self.globals)
pushed=pushed+1 pushed=pushed+1
else: else:
md=TemplateDict() md=TemplateDict()
push=md.push push=md._push
shared_globals=self.shared_globals shared_globals=self.shared_globals
if shared_globals: push(shared_globals) if shared_globals: push(shared_globals)
if globals: push(globals) if globals: push(globals)
...@@ -367,7 +367,7 @@ class String: ...@@ -367,7 +367,7 @@ class String:
try: try:
return render_blocks(self,md) return render_blocks(self,md)
finally: finally:
if pushed: md.pop(pushed) # Get rid of circular reference! if pushed: md._pop(pushed) # Get rid of circular reference!
md.level=level # Restore previous level md.level=level # Restore previous level
validate=None validate=None
......
'''$Id: DT_Util.py,v 1.16 1997/11/19 15:33:32 jim Exp $''' '''$Id: DT_Util.py,v 1.17 1997/11/19 15:42:47 jim Exp $'''
############################################################################ ############################################################################
# Copyright # Copyright
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
# (540) 371-6909 # (540) 371-6909
# #
############################################################################ ############################################################################
__version__='$Revision: 1.16 $'[11:-2] __version__='$Revision: 1.17 $'[11:-2]
import sys, regex, string, types, math, os import sys, regex, string, types, math, os
from string import rfind, strip, joinfields, atoi,lower,upper,capitalize from string import rfind, strip, joinfields, atoi,lower,upper,capitalize
...@@ -285,10 +285,11 @@ def parse_params(text, ...@@ -285,10 +285,11 @@ def parse_params(text,
try: from cDocumentTemplate import InstanceDict, TemplateDict, render_blocks try: from cDocumentTemplate import InstanceDict, TemplateDict, render_blocks
except: from pDocumentTemplate import InstanceDict, TemplateDict, render_blocks except: from pDocumentTemplate import InstanceDict, TemplateDict, render_blocks
# TemplateDict.pop.__roles__=TemplateDict.push.__roles__=()
############################################################################ ############################################################################
# $Log: DT_Util.py,v $ # $Log: DT_Util.py,v $
# Revision 1.17 1997/11/19 15:42:47 jim
# added _ prefix to push and pop methods to make them private
#
# Revision 1.16 1997/11/19 15:33:32 jim # Revision 1.16 1997/11/19 15:33:32 jim
# Updated parse_params so that you can define an attribute that, if # Updated parse_params so that you can define an attribute that, if
# used, must have a value. This is done by specifying None as a default # used, must have a value. This is done by specifying None as a default
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
static char cDocumentTemplate_module_documentation[] = static char cDocumentTemplate_module_documentation[] =
"" ""
"\n$Id: cDocumentTemplate.c,v 1.7 1997/11/07 18:51:47 jim Exp $" "\n$Id: cDocumentTemplate.c,v 1.8 1997/11/19 15:42:47 jim Exp $"
; ;
#include "ExtensionClass.h" #include "ExtensionClass.h"
...@@ -341,10 +341,10 @@ MM_has_key(MM *self, PyObject *args) ...@@ -341,10 +341,10 @@ MM_has_key(MM *self, PyObject *args)
static struct PyMethodDef MM_methods[] = { static struct PyMethodDef MM_methods[] = {
{"__init__", (PyCFunction)MM__init__, 0, {"__init__", (PyCFunction)MM__init__, 0,
"__init__() -- Create a new empty multi-mapping"}, "__init__() -- Create a new empty multi-mapping"},
{"push", (PyCFunction) MM_push, 0, {"_push", (PyCFunction) MM_push, 0,
"push(mapping_object) -- Add a data source"}, "_push(mapping_object) -- Add a data source"},
{"pop", (PyCFunction) MM_pop, 0, {"_pop", (PyCFunction) MM_pop, 0,
"pop() -- Remove and return the last data source added"}, "_pop() -- Remove and return the last data source added"},
{"getitem", (PyCFunction) MM_get, METH_VARARGS, {"getitem", (PyCFunction) MM_get, METH_VARARGS,
"getitem(key[,call]) -- Get a value\n\n" "getitem(key[,call]) -- Get a value\n\n"
"Normally, callable objects that can be called without arguments are\n" "Normally, callable objects that can be called without arguments are\n"
...@@ -529,7 +529,7 @@ void ...@@ -529,7 +529,7 @@ void
initcDocumentTemplate() initcDocumentTemplate()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.7 $"; char *rev="$Revision: 1.8 $";
UNLESS(py_isDocTemp=PyString_FromString("isDocTemp")) return; UNLESS(py_isDocTemp=PyString_FromString("isDocTemp")) return;
UNLESS(py_blocks=PyString_FromString("blocks")) return; UNLESS(py_blocks=PyString_FromString("blocks")) return;
...@@ -561,6 +561,9 @@ initcDocumentTemplate() ...@@ -561,6 +561,9 @@ initcDocumentTemplate()
Revision Log: Revision Log:
$Log: cDocumentTemplate.c,v $ $Log: cDocumentTemplate.c,v $
Revision 1.8 1997/11/19 15:42:47 jim
added _ prefix to push and pop methods to make them private
Revision 1.7 1997/11/07 18:51:47 jim Revision 1.7 1997/11/07 18:51:47 jim
Fixed bug in new call logic. Fixed bug in new call logic.
......
...@@ -58,8 +58,8 @@ ...@@ -58,8 +58,8 @@
__doc__='''Python implementations of document template some features __doc__='''Python implementations of document template some features
$Id: pDocumentTemplate.py,v 1.6 1997/11/11 18:39:29 jim Exp $''' $Id: pDocumentTemplate.py,v 1.7 1997/11/19 15:42:48 jim Exp $'''
__version__='$Revision: 1.6 $'[11:-2] __version__='$Revision: 1.7 $'[11:-2]
import regex, string import regex, string
...@@ -140,13 +140,13 @@ class TemplateDict: ...@@ -140,13 +140,13 @@ class TemplateDict:
level=0 level=0
def pop(self, n): return self.dicts.pop(n) def _pop(self, n): return self.dicts.pop(n)
def push(self, d): return self.dicts.push(d) def _push(self, d): return self.dicts.push(d)
def __init__(self): def __init__(self):
m=self.dicts=MultiMapping() m=self.dicts=MultiMapping()
self.pop=m.pop self._pop=m.pop
self.push=m.push self._push=m.push
try: self.keys=m.keys try: self.keys=m.keys
except: pass except: pass
...@@ -177,6 +177,9 @@ def render_blocks(self, md): ...@@ -177,6 +177,9 @@ def render_blocks(self, md):
############################################################################## ##############################################################################
# #
# $Log: pDocumentTemplate.py,v $ # $Log: pDocumentTemplate.py,v $
# Revision 1.7 1997/11/19 15:42:48 jim
# added _ prefix to push and pop methods to make them private
#
# Revision 1.6 1997/11/11 18:39:29 jim # Revision 1.6 1997/11/11 18:39:29 jim
# Added a little compatibility with cDocumentTemplate. # Added a little compatibility with cDocumentTemplate.
# #
......
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