[Zodb-checkins] CVS: Packages/ZConfig/doc - zconfig.tex:1.35.10.7

Fred L. Drake, Jr. fred@zope.com
Fri, 20 Dec 2002 14:00:06 -0500


Update of /cvs-repository/Packages/ZConfig/doc
In directory cvs.zope.org:/tmp/cvs-serv7067

Modified Files:
      Tag: zconfig-schema-devel-branch
	zconfig.tex 
Log Message:
Document the standard data types.


=== Packages/ZConfig/doc/zconfig.tex 1.35.10.6 => 1.35.10.7 ===
--- Packages/ZConfig/doc/zconfig.tex:1.35.10.6	Fri Dec 20 12:49:01 2002
+++ Packages/ZConfig/doc/zconfig.tex	Fri Dec 20 14:00:05 2002
@@ -220,6 +220,87 @@
 \end{verbatim} %$ <-- bow to font-lock
 
 
+\section{Standard \module{ZConfig} Datatypes}
+
+There are a number of data types which can be identified using the
+\code{datatype} attribute on \code{key}, \code{multikey},
+\code{schema}, \code{section}, and \code{multisection} elements.
+Applications may extend the set of datatypes by calling the
+\method{register()} method of the data type regsitry being used or by
+using Python dotted-names to refer to conversion routines defined in
+code.
+
+The following datatypes are provided by the default type registry.
+
+\begin{definitions}
+\term{basic-key}
+  The default data type for a key in a ZConfig configuration file.
+  The result of conversion is always lower-case, and matches the
+  regular expression \regexp{[a-z][-._a-z0-9]*}.
+
+\term{boolean}
+  Convert a human-friendly string to a boolean value.  The names
+  \code{yes}, \code{on}, and \code{true} convert to \constant{True},
+  while \code{no}, \code{off}, and \code{false} convert to
+  \constant{False}.  Comparisons are case-insensitive.  All other
+  input strings are disallowed.
+
+\term{float}
+  A Python float.  \code{Inf}, \code{-Inf}, and \code{NaN} are not
+  allowed.
+
+\term{identifier}
+  Any valid Python identifier.
+
+\term{inet-address}
+  An internet address expressed as a \code{(\var{hostname},
+  \var{port})} pair.  If only the port is specified, an empty string
+  will be returned for \var{hostname}.  If the port is omitted,
+  \code{None} will be returned for \var{port}.
+
+\term{integer}
+  Convert a value to an integer.  This will be a Python \class{int} if
+  the value is in the range allowed by \class{int}, otherwise a Python
+  \class{long} is returned.
+
+\term{locale}
+  Any valid locale specifier accepted by the available
+  \function{locale.setlocale()} function.  Be aware that only the
+  \code{'C'} locale is supported on some platforms.
+
+\term{logging-level}
+  A logging level usable by the \module{logging} package.  Valid
+  values are the names \code{critical}, \code{fatal}, \code{error},
+  \code{warn}, \code{info}, \code{debug}, and \code{all}, as well as
+  integers in the range [0..50].  Converted values are always
+  expressed as integers.
+
+\term{null}
+  No conversion is performed; the value passed in is the value
+  returned.  This is the default data type for section values.
+
+\term{port-number}
+  Returns a valid port number as an integer.  Validity does not imply
+  that any particular use may be made of the port, however.  For
+  example, port number lower than 1024 generally cannot be bound by
+  non-root users.
+
+\term{socket-address}
+  An address for a socket.  The converted value is a pair containing
+  the address family (\constant{AF_INET} or \constant{AF_UNIX}) in the
+  first part and the specific address in the second part.  If the
+  family is \constant{AF_UNIX}, the specific address will be a
+  pathname; if the family is \constant{AF_INET}, the second part will
+  be the result of the \strong{inet-address} conversion.
+
+\term{str}
+  Returns the input value as a string.  If the source is a Unicode
+  string, this implies that it will be checked to be simple 7-bit
+  \ASCII.  This is the default data type for key values in
+  configuration files.
+\end{definitions}
+
+
 \section{\module{ZConfig} --- Basic configuration support}
 
 \declaremodule{}{ZConfig}