comparison docs/keylist.rst @ 71:854c5d361011

Documentation cleanup.
author Brian Neal <bgneal@gmail.com>
date Tue, 23 Jul 2013 20:18:05 -0500
parents 2173ac4c2d9b
children
comparison
equal deleted inserted replaced
70:753974fc7619 71:854c5d361011
30 between 0 and 6, inclusive. Each integer represents a lug position where 30 between 0 and 6, inclusive. Each integer represents a lug position where
31 0 is a neutral position, and 1-6 correspond to key wheel positions. If 31 0 is a neutral position, and 1-6 correspond to key wheel positions. If
32 m & n are both non-zero, they cannot be equal. 32 m & n are both non-zero, they cannot be equal.
33 33
34 If a string has less than 27 pairs, it is assumed all remaining bars have both 34 If a string has less than 27 pairs, it is assumed all remaining bars have both
35 lugs in the neutral (0) positions. 35 lugs in the neutral positions, i.e. ``0-0``.
36 36
37 Order of the pairs within the string does not matter. 37 The order of the pairs within the string does not matter.
38 38
39 To reduce typing and to aid in readability, an alternate shortcut notation is 39 To reduce typing and to aid in readability, an alternate shortcut notation is
40 supported:: 40 supported::
41 41
42 lugs = '1-0 2-0*2 0-3 0-5*3 0-6 2-4 3-6' 42 lugs = '1-0 2-0*2 0-3 0-5*3 0-6 2-4 3-6'
110 110
111 Writes the key lists to the file named ``fname`` in config file format. 111 Writes the key lists to the file named ``fname`` in config file format.
112 112
113 ``key_lists`` must be an iterable of :class:`~m209.keylist.KeyList` objects. 113 ``key_lists`` must be an iterable of :class:`~m209.keylist.KeyList` objects.
114 114
115 .. _key-list-file-format-label:
116
115 Key list file format 117 Key list file format
116 ~~~~~~~~~~~~~~~~~~~~ 118 ~~~~~~~~~~~~~~~~~~~~
117 119
118 An example key list file in config file format is presented below. The label 120 An example key list file in config file format is presented below. The label
119 for each section of the file is the key list indicator. 121 for each section of the file is the key list indicator.
142 144
143 Generating key lists 145 Generating key lists
144 ~~~~~~~~~~~~~~~~~~~~ 146 ~~~~~~~~~~~~~~~~~~~~
145 147
146 The ``m209`` library contains a function to pseudo-randomly generate a key list 148 The ``m209`` library contains a function to pseudo-randomly generate a key list
147 that is based on the procedure described in the 1944 M-209 manual. 149 that is based on the procedure described in the 1944 M-209 manual
150 (see :ref:`references-label` [4]).
148 151
149 .. function:: m209.keylist.generate.generate_key_list(indicator[, lug_selection=None, max_lug_attempts=MAX_LUG_ATTEMPTS, max_pin_attempts=MAX_PIN_ATTEMPTS]) 152 .. function:: m209.keylist.generate.generate_key_list(indicator[, lug_selection=None[, max_lug_attempts=MAX_LUG_ATTEMPTS[, max_pin_attempts=MAX_PIN_ATTEMPTS]]])
150 153
151 The only required parameter is ``indicator``, the two-letter indicator for 154 The only required parameter is ``indicator``, the two-letter indicator for
152 the key list. 155 the key list.
153 156
154 If successful, a :class:`~m209.keylist.KeyList` object is returned. 157 If successful, a :class:`~m209.keylist.KeyList` object is returned.