[Zope-Checkins] CVS: Zope2 - dtml-random.stx:1.1 dtml-funcs.stx:1.5 dtml-if.stx:1.2 dtml-in.stx:1.3 dtml-return.stx:1.3 dtml-tree.stx:1.6 dtml-try.stx:1.4 dtml-var.stx:1.7 dtml-whrandom.stx:NONE
Amos Latteier
amos@digicool.com
Tue, 17 Apr 2001 20:24:44 -0400 (EDT)
Update of /cvs-repository/Zope2/lib/python/Products/OFSP/help
In directory korak:/tmp/cvs-serv32479
Modified Files:
dtml-funcs.stx dtml-if.stx dtml-in.stx dtml-return.stx
dtml-tree.stx dtml-try.stx dtml-var.stx
Added Files:
dtml-random.stx
Removed Files:
dtml-whrandom.stx
Log Message:
Assorted formatting fixes and typos. Also changed whrandom module to random.
--- Added File dtml-random.stx in package Zope2 ---
random: DTML Pseudo-Random Number Functions
The 'random' module provides pseudo-random number functions. With
it, you can generate random numbers and select random elements from
sequences. This module is a standard Python module.
Functions
choice(seq) -- Chooses a random element from the non-empty sequence
'seq' and returns it.
randint(a, b) -- Returns a random integer 'N' such that 'a<=N<=b'.
random() -- Returns the next random floating point number in the range
[0.0 ... 1.0).
seed(x, y, z) -- Initializes the random number generator from the
integers 'x', 'y' and 'z'. When the module is first imported, the random
number is initialized using values derived from the current time.
uniform(a, b) -- Returns a random real number 'N' such that 'a<=N<b'.
See Also
"Python 'random' module":http://www.python.org/doc/current/lib/module-whrandom.html
--- Updated File dtml-funcs.stx in package Zope2 --
--- dtml-funcs.stx 2001/04/09 22:57:03 1.4
+++ dtml-funcs.stx 2001/04/18 00:24:44 1.5
@@ -46,7 +46,8 @@
returned if provided, otherwise 'AttributeError' is raised.
getitem(variable, render=0) -- Returns the value of a DTML variable.
- If 'render' is true, the variable is rendered.
+ If 'render' is true, the variable is rendered. See the 'render'
+ function.
hasattr(object, string) -- The arguments are an object and a
string. The result is 1 if the string is the name of one of the
@@ -138,13 +139,13 @@
equally close, rounding is done away from 0 (so e.g. round(0.5) is 1.0
and round(-0.5) is -1.0).
- render(object) -- Render 'object'. For DTML objects this renders
- (calls) the DTML. For other objects, this is equivalent to
- 'str(object)'.
+ render(object) -- Render 'object'. For DTML objects this
+ evaluates the DTML code with the current namespace. For other
+ objects, this is equivalent to 'str(object)'.
reorder(s [,with] [,without]) -- Reorder the items in s according
- to the order given in with and with items mentioned in without
- removed. Items from s not mentioned in with are removed. s,
+ to the order given in 'with' and without the items mentioned in
+ 'without'. Items from s not mentioned in with are removed. s,
with, and without are all either sequences of strings or
sequences of key-value tuples, with ordering done on the
keys. This function is useful for constructing ordered select
@@ -199,7 +200,7 @@
"'string' module":dtml-string.stx
- "'whrandom' module":dtml-whrandom.stx
+ "'random' module":dtml-random.stx
"'math' module":dtml-math.stx
--- Updated File dtml-if.stx in package Zope2 --
--- dtml-if.stx 2000/10/10 21:57:16 1.1
+++ dtml-if.stx 2001/04/18 00:24:44 1.2
@@ -23,8 +23,8 @@
If the initial condition is false, each 'elif' condition is tested
in turn. If any 'elif' condition is true, its block is
- executed. Finally the optional 'else' condition is tested. If it
- is true, the 'else' block is executed. Only one block will be
+ executed. Finally the optional 'else' block is executed if none of
+ the 'if' and 'elif' conditions were true. Only one block will be
executed.
Examples
--- Updated File dtml-in.stx in package Zope2 --
--- dtml-in.stx 2001/02/15 23:03:56 1.2
+++ dtml-in.stx 2001/04/18 00:24:44 1.3
@@ -54,7 +54,8 @@
Current Item Variables
- These variables describe the current item.
+ These variables describe the
+ current item.
sequence-item -- The current item.
@@ -118,13 +119,13 @@
count-1 degrees of freedom.
variance-n-*variable* -- The variance of an item variable with
- count degrees of freedom.
+ n degrees of freedom.
standard-deviation-*variable* -- The standard-deviation of an
item variable with count-1 degrees of freedom.
standard-deviation-n-*variable* -- The standard-deviation of
- an item variable with count degrees of freedom.
+ an item variable with n degrees of freedom.
Grouping Variables
@@ -146,7 +147,7 @@
sequence-step-size -- The batch size.
previous-sequence -- True if the current batch is not the
- first one. Note, this variable is only true the first loop
+ first one. Note, this variable is only true for the first loop
iteration.
previous-sequence-start-index -- The starting index of the
--- Updated File dtml-return.stx in package Zope2 --
--- dtml-return.stx 2001/03/06 01:28:17 1.2
+++ dtml-return.stx 2001/04/18 00:24:44 1.3
@@ -11,8 +11,7 @@
Stops execution of DTML and returns a variable or expression. The
DTML output is not returned. Usually a return expression is more
- useful than a return variable. Python Methods largely obsolete
- this tag.
+ useful than a return variable. Scripts largely obsolete this tag.
Examples
--- Updated File dtml-tree.stx in package Zope2 --
--- dtml-tree.stx 2001/03/08 23:13:06 1.5
+++ dtml-tree.stx 2001/04/18 00:24:44 1.6
@@ -102,7 +102,7 @@
Examples
- Display a rooted in the current object::
+ Display a tree rooted in the current object::
<dtml-tree>
<dtml-var title_or_id>
--- Updated File dtml-try.stx in package Zope2 --
--- dtml-try.stx 2001/03/06 19:22:43 1.3
+++ dtml-try.stx 2001/04/18 00:24:44 1.4
@@ -18,12 +18,12 @@
The 'try' tag encloses a block in which exceptions can be caught and
handled. There can be one or more 'except' tags that handles
- zero or more exceptions. If a 'except' tag does not specify an
+ zero or more exceptions. If an 'except' tag does not specify an
exception, then it handles all exceptions.
When an exception is raised, control jumps to the first 'except'
tag that handles the exception. If there is no 'except' tag to
- handled the exception, then the exception is raised normally.
+ handle the exception, then the exception is raised normally.
If no exception is raised, and there is an 'else' tag, then the
'else' tag will be executed after the body of the 'try' tag.
--- Updated File dtml-var.stx in package Zope2 --
--- dtml-var.stx 2001/03/20 23:32:42 1.6
+++ dtml-var.stx 2001/04/18 00:24:44 1.7
@@ -105,12 +105,12 @@
<dtml-var standard_html_header>
- Truncation. Suppose *colors* is the string 'red yellow green',
- then::
+ Truncation::
<dtml-var colors size=10 etc=", etc.">
- will produce the output::
+ will produce the following output if *colors* is the string 'red
+ yellow green'::
red yellow, etc.
@@ -127,13 +127,15 @@
<a href="&dtml-link;">Link</a>
- Inserting a variable using entity syntax with attributes::
+ Inserting a link to a document 'doc', using entity syntax with
+ attributes::
<a href="&dtml.url-doc;"><dtml-var doc fmt="title_or_id"></a>
This creates an HTML link to an object using its URL and
title. This example calls the object's 'absolute_url' method for
- the URL and its 'title_or_id' method for the title.
+ the URL (using the 'url' attribute) and its 'title_or_id' method
+ for the title.
--- Removed file dtml-whrandom.stx from package Zope2 --