[Python-checkins] CVS: python/dist/src/Doc/lib liblocale.tex,1.20,1.21

Fred L. Drake python-dev@python.org
Wed, 29 Nov 2000 23:14:02 -0800


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory slayer.i.sourceforge.net:/tmp/cvs-serv18192/lib

Modified Files:
	liblocale.tex 
Log Message:

Use a table to describe the keys to the locale information dictionary;
this is slightly easier to read than the list environment that had been
used.


Index: liblocale.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/liblocale.tex,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -r1.20 -r1.21
*** liblocale.tex	2000/11/17 19:09:34	1.20
--- liblocale.tex	2000/11/30 07:13:58	1.21
***************
*** 46,50 ****
  \begin{verbatim}
  import locale
! locale.setlocale(locale.LC_ALL,"")
  \end{verbatim}
  
--- 46,50 ----
  \begin{verbatim}
  import locale
! locale.setlocale(locale.LC_ALL, '')
  \end{verbatim}
  
***************
*** 62,126 ****
    This dictionary has the following strings as keys:
  
!   \begin{itemize}
!     \item
!     \code{'decimal_point'} specifies the decimal point used in floating
!     point number representations for the \constant{LC_NUMERIC}
!     category.
! 
!     \item
!     \code{'groupin'} is a sequence of numbers specifying at which
!     relative positions the \code{'thousands_sep'} is expected.  If the
!     sequence is terminated with \constant{CHAR_MAX}, no further
!     grouping is performed. If the sequence terminates with a \code{0},
!     the last group size is repeatedly used.
! 
!     \item
!     \code{'thousands_sep'} is the character used between groups.
! 
!     \item
!     \code{'int_curr_symbol'} specifies the international currency
!     symbol from the \constant{LC_MONETARY} category.
! 
!     \item
!     \code{'currency_symbol'} is the local currency symbol.
! 
!     \item
!     \code{'mon_decimal_point'} is the decimal point used in monetary
!     values.
! 
!     \item
!     \code{'mon_thousands_sep'} is the separator for grouping of
!     monetary values.
! 
!     \item
!     \code{'mon_grouping'} has the same format as the \code{'grouping'}
!     key; it is used for monetary values.
! 
!     \item
!     \code{'positive_sign'} and \code{'negative_sign'} gives the sign
!     used for positive and negative monetary quantities.
! 
!     \item
!     \code{'int_frac_digits'} and \code{'frac_digits'} specify the number
!     of fractional digits used in the international and local
!     formatting of monetary values.
! 
!     \item
!     \code{'p_cs_precedes'} and \code{'n_cs_precedes'} specifies whether
!     the currency symbol precedes the value for positive or negative
!     values.
! 
!     \item
!     \code{'p_sep_by_space'} and \code{'n_sep_by_space'} specifies
!     whether there is a space between the positive or negative value
!     and the currency symbol.
! 
!     \item
!     \code{'p_sign_posn'} and \code{'n_sign_posn'} indicate how the
!     sign should be placed for positive and negative monetary values.
!   \end{itemize}
  
!   The possible values for \code{p_sign_posn} and
!   \code{n_sign_posn} are given below.
  
    \begin{tableii}{c|l}{code}{Value}{Explanation}
--- 62,101 ----
    This dictionary has the following strings as keys:
  
!   \begin{tableiii}{l|l|p{3in}}{constant}{Key}{Category}{Meaning}
!     \lineiii{LC_NUMERIC}{\code{'decimal_point'}}
!             {Decimal point character.}
!     \lineiii{}{\code{'grouping'}}
!             {Sequence of numbers specifying which relative positions
!              the \code{'thousands_sep'} is expected.  If the sequence is
!              terminated with \constant{CHAR_MAX}, no further grouping
!              is performed. If the sequence terminates with a \code{0}, 
!              the last group size is repeatedly used.}
!     \lineiii{}{\code{'thousands_sep'}}
!             {Character used between groups.}\hline
!     \lineiii{LC_MONETARY}{\code{'int_curr_symbol'}}
!             {International currency symbol.}
!     \lineiii{}{\code{'currency_symbol'}}
!             {Local currency symbol.}
!     \lineiii{}{\code{'mon_decimal_point'}}
!             {Decimal point used for monetary values.}
!     \lineiii{}{\code{'mon_thousands_sep'}}
!             {Group separator used for monetary values.}
!     \lineiii{}{\code{'mon_grouping'}}
!             {Equivalent to \code{'grouping'}, used for monetary
!              values.}
!     \lineiii{}{\code{'positive_sign'}}
!             {Symbol used to annotate a positive monetary value.}
!     \lineiii{}{\code{'negative_sign'}}
!             {Symbol used to annotate a nnegative monetary value.}
!     \lineiii{}{\code{'frac_digits'}}
!             {Number of fractional digits used in local formatting
!              of monetary values.}
!     \lineiii{}{\code{'int_frac_digits'}}
!             {Number of fractional digits used in international
!              formatting of monetary values.}
!   \end{tableiii}
  
!   The possible values for \code{'p_sign_posn'} and
!   \code{'n_sign_posn'} are given below.
  
    \begin{tableii}{c|l}{code}{Value}{Explanation}
***************
*** 130,134 ****
      \lineii{3}{The sign should immediately precede the value.}
      \lineii{4}{The sign should immediately follow the value.}
!     \lineii{LC_MAX}{Nothing is specified in this locale.}
    \end{tableii}
  \end{funcdesc}
--- 105,109 ----
      \lineii{3}{The sign should immediately precede the value.}
      \lineii{4}{The sign should immediately follow the value.}
!     \lineii{\constant{LC_MAX}}{Nothing is specified in this locale.}
    \end{tableii}
  \end{funcdesc}
***************
*** 290,297 ****
  >>> import locale
  >>> loc = locale.setlocale(locale.LC_ALL) # get current locale
! >>> locale.setlocale(locale.LC_ALL, "de") # use German locale
! >>> locale.strcoll("f\344n", "foo") # compare a string containing an umlaut 
! >>> locale.setlocale(locale.LC_ALL, "") # use user's preferred locale
! >>> locale.setlocale(locale.LC_ALL, "C") # use default (C) locale
  >>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale
  \end{verbatim}
--- 265,272 ----
  >>> import locale
  >>> loc = locale.setlocale(locale.LC_ALL) # get current locale
! >>> locale.setlocale(locale.LC_ALL, 'de') # use German locale
! >>> locale.strcoll('f\344n', 'foo') # compare a string containing an umlaut 
! >>> locale.setlocale(locale.LC_ALL, '') # use user's preferred locale
! >>> locale.setlocale(locale.LC_ALL, 'C') # use default (C) locale
  >>> locale.setlocale(locale.LC_ALL, loc) # restore saved locale
  \end{verbatim}
***************
*** 309,313 ****
  matter what the user's preferred locale is.  The program must
  explicitly say that it wants the user's preferred locale settings by
! calling \code{setlocale(LC_ALL, "")}.
  
  It is generally a bad idea to call \function{setlocale()} in some library
--- 284,288 ----
  matter what the user's preferred locale is.  The program must
  explicitly say that it wants the user's preferred locale settings by
! calling \code{setlocale(LC_ALL, '')}.
  
  It is generally a bad idea to call \function{setlocale()} in some library