home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
You can browse this item here: tex
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| LaTeX document, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 73 65 63 74 69 6f 6e | 7b 53 74 61 6e 64 61 72 |\section|{Standar|
|00000010| 64 20 4d 6f 64 75 6c 65 | 20 5c 73 65 63 74 63 6f |d Module| \sectco|
|00000020| 64 65 7b 72 66 63 38 32 | 32 7d 7d 0a 5c 73 74 6d |de{rfc82|2}}.\stm|
|00000030| 6f 64 69 6e 64 65 78 7b | 72 66 63 38 32 32 7d 0a |odindex{|rfc822}.|
|00000040| 0a 5c 72 65 6e 65 77 63 | 6f 6d 6d 61 6e 64 7b 5c |.\renewc|ommand{\|
|00000050| 69 6e 64 65 78 73 75 62 | 69 74 65 6d 7d 7b 28 69 |indexsub|item}{(i|
|00000060| 6e 20 6d 6f 64 75 6c 65 | 20 72 66 63 38 32 32 29 |n module| rfc822)|
|00000070| 7d 0a 0a 54 68 69 73 20 | 6d 6f 64 75 6c 65 20 64 |}..This |module d|
|00000080| 65 66 69 6e 65 73 20 61 | 20 63 6c 61 73 73 2c 20 |efines a| class, |
|00000090| 5c 63 6f 64 65 7b 4d 65 | 73 73 61 67 65 7d 2c 20 |\code{Me|ssage}, |
|000000a0| 77 68 69 63 68 20 72 65 | 70 72 65 73 65 6e 74 73 |which re|presents|
|000000b0| 20 61 0a 63 6f 6c 6c 65 | 63 74 69 6f 6e 20 6f 66 | a.colle|ction of|
|000000c0| 20 60 60 65 6d 61 69 6c | 20 68 65 61 64 65 72 73 | ``email| headers|
|000000d0| 27 27 20 61 73 20 64 65 | 66 69 6e 65 64 20 62 79 |'' as de|fined by|
|000000e0| 20 74 68 65 20 49 6e 74 | 65 72 6e 65 74 20 73 74 | the Int|ernet st|
|000000f0| 61 6e 64 61 72 64 0a 52 | 46 43 20 38 32 32 2e 20 |andard.R|FC 822. |
|00000100| 20 49 74 20 69 73 20 75 | 73 65 64 20 69 6e 20 76 | It is u|sed in v|
|00000110| 61 72 69 6f 75 73 20 63 | 6f 6e 74 65 78 74 73 2c |arious c|ontexts,|
|00000120| 20 75 73 75 61 6c 6c 79 | 20 74 6f 20 72 65 61 64 | usually| to read|
|00000130| 20 73 75 63 68 20 68 65 | 61 64 65 72 73 0a 66 72 | such he|aders.fr|
|00000140| 6f 6d 20 61 20 66 69 6c | 65 2e 0a 0a 41 20 5c 63 |om a fil|e...A \c|
|00000150| 6f 64 65 7b 4d 65 73 73 | 61 67 65 7d 20 69 6e 73 |ode{Mess|age} ins|
|00000160| 74 61 6e 63 65 20 69 73 | 20 69 6e 73 74 61 6e 74 |tance is| instant|
|00000170| 69 61 74 65 64 20 77 69 | 74 68 20 61 6e 20 6f 70 |iated wi|th an op|
|00000180| 65 6e 20 66 69 6c 65 20 | 6f 62 6a 65 63 74 20 61 |en file |object a|
|00000190| 73 0a 70 61 72 61 6d 65 | 74 65 72 2e 20 20 49 6e |s.parame|ter. In|
|000001a0| 73 74 61 6e 74 69 61 74 | 69 6f 6e 20 72 65 61 64 |stantiat|ion read|
|000001b0| 73 20 68 65 61 64 65 72 | 73 20 66 72 6f 6d 20 74 |s header|s from t|
|000001c0| 68 65 20 66 69 6c 65 20 | 75 70 20 74 6f 20 61 20 |he file |up to a |
|000001d0| 62 6c 61 6e 6b 0a 6c 69 | 6e 65 20 61 6e 64 20 73 |blank.li|ne and s|
|000001e0| 74 6f 72 65 73 20 74 68 | 65 6d 20 69 6e 20 74 68 |tores th|em in th|
|000001f0| 65 20 69 6e 73 74 61 6e | 63 65 3b 20 61 66 74 65 |e instan|ce; afte|
|00000200| 72 20 69 6e 73 74 61 6e | 74 69 61 74 69 6f 6e 2c |r instan|tiation,|
|00000210| 20 74 68 65 20 66 69 6c | 65 20 69 73 0a 70 6f 73 | the fil|e is.pos|
|00000220| 69 74 69 6f 6e 65 64 20 | 64 69 72 65 63 74 6c 79 |itioned |directly|
|00000230| 20 61 66 74 65 72 20 74 | 68 65 20 62 6c 61 6e 6b | after t|he blank|
|00000240| 20 6c 69 6e 65 20 74 68 | 61 74 20 74 65 72 6d 69 | line th|at termi|
|00000250| 6e 61 74 65 73 20 74 68 | 65 20 68 65 61 64 65 72 |nates th|e header|
|00000260| 73 2e 0a 0a 49 6e 70 75 | 74 20 6c 69 6e 65 73 20 |s...Inpu|t lines |
|00000270| 61 73 20 72 65 61 64 20 | 66 72 6f 6d 20 74 68 65 |as read |from the|
|00000280| 20 66 69 6c 65 20 6d 61 | 79 20 65 69 74 68 65 72 | file ma|y either|
|00000290| 20 62 65 20 74 65 72 6d | 69 6e 61 74 65 64 20 62 | be term|inated b|
|000002a0| 79 20 43 52 2d 4c 46 20 | 6f 72 0a 62 79 20 61 20 |y CR-LF |or.by a |
|000002b0| 73 69 6e 67 6c 65 20 6c | 69 6e 65 66 65 65 64 3b |single l|inefeed;|
|000002c0| 20 61 20 74 65 72 6d 69 | 6e 61 74 69 6e 67 20 43 | a termi|nating C|
|000002d0| 52 2d 4c 46 20 69 73 20 | 72 65 70 6c 61 63 65 64 |R-LF is |replaced|
|000002e0| 20 62 79 20 61 20 73 69 | 6e 67 6c 65 0a 6c 69 6e | by a si|ngle.lin|
|000002f0| 65 66 65 65 64 20 62 65 | 66 6f 72 65 20 74 68 65 |efeed be|fore the|
|00000300| 20 6c 69 6e 65 20 69 73 | 20 73 74 6f 72 65 64 2e | line is| stored.|
|00000310| 0a 0a 41 6c 6c 20 68 65 | 61 64 65 72 20 6d 61 74 |..All he|ader mat|
|00000320| 63 68 69 6e 67 20 69 73 | 20 64 6f 6e 65 20 69 6e |ching is| done in|
|00000330| 64 65 70 65 6e 64 65 6e | 74 20 6f 66 20 75 70 70 |dependen|t of upp|
|00000340| 65 72 20 6f 72 20 6c 6f | 77 65 72 20 63 61 73 65 |er or lo|wer case|
|00000350| 3b 0a 65 2e 67 2e 20 5c | 63 6f 64 65 7b 6d 5b 27 |;.e.g. \|code{m['|
|00000360| 46 72 6f 6d 27 5d 7d 2c | 20 5c 63 6f 64 65 7b 6d |From']},| \code{m|
|00000370| 5b 27 66 72 6f 6d 27 5d | 7d 20 61 6e 64 20 5c 63 |['from']|} and \c|
|00000380| 6f 64 65 7b 6d 5b 27 46 | 52 4f 4d 27 5d 7d 20 61 |ode{m['F|ROM']} a|
|00000390| 6c 6c 20 79 69 65 6c 64 | 0a 74 68 65 20 73 61 6d |ll yield|.the sam|
|000003a0| 65 20 72 65 73 75 6c 74 | 2e 0a 0a 5c 73 75 62 73 |e result|...\subs|
|000003b0| 65 63 74 69 6f 6e 7b 4d | 65 73 73 61 67 65 20 4f |ection{M|essage O|
|000003c0| 62 6a 65 63 74 73 7d 0a | 0a 41 20 5c 63 6f 64 65 |bjects}.|.A \code|
|000003d0| 7b 4d 65 73 73 61 67 65 | 7d 20 69 6e 73 74 61 6e |{Message|} instan|
|000003e0| 63 65 20 68 61 73 20 74 | 68 65 20 66 6f 6c 6c 6f |ce has t|he follo|
|000003f0| 77 69 6e 67 20 6d 65 74 | 68 6f 64 73 3a 0a 0a 5c |wing met|hods:..\|
|00000400| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00000410| 72 65 77 69 6e 64 62 6f | 64 79 7d 7b 7d 0a 53 65 |rewindbo|dy}{}.Se|
|00000420| 65 6b 20 74 6f 20 74 68 | 65 20 73 74 61 72 74 20 |ek to th|e start |
|00000430| 6f 66 20 74 68 65 20 6d | 65 73 73 61 67 65 20 62 |of the m|essage b|
|00000440| 6f 64 79 2e 20 20 54 68 | 69 73 20 6f 6e 6c 79 20 |ody. Th|is only |
|00000450| 77 6f 72 6b 73 20 69 66 | 20 74 68 65 20 66 69 6c |works if| the fil|
|00000460| 65 0a 6f 62 6a 65 63 74 | 20 69 73 20 73 65 65 6b |e.object| is seek|
|00000470| 61 62 6c 65 2e 0a 5c 65 | 6e 64 7b 66 75 6e 63 64 |able..\e|nd{funcd|
|00000480| 65 73 63 7d 0a 0a 5c 62 | 65 67 69 6e 7b 66 75 6e |esc}..\b|egin{fun|
|00000490| 63 64 65 73 63 7d 7b 67 | 65 74 61 6c 6c 6d 61 74 |cdesc}{g|etallmat|
|000004a0| 63 68 69 6e 67 68 65 61 | 64 65 72 73 7d 7b 6e 61 |chinghea|ders}{na|
|000004b0| 6d 65 7d 0a 52 65 74 75 | 72 6e 20 61 20 6c 69 73 |me}.Retu|rn a lis|
|000004c0| 74 20 6f 66 20 6c 69 6e | 65 73 20 63 6f 6e 73 69 |t of lin|es consi|
|000004d0| 73 74 69 6e 67 20 6f 66 | 20 61 6c 6c 20 68 65 61 |sting of| all hea|
|000004e0| 64 65 72 73 20 6d 61 74 | 63 68 69 6e 67 0a 5c 76 |ders mat|ching.\v|
|000004f0| 61 72 7b 6e 61 6d 65 7d | 2c 20 69 66 20 61 6e 79 |ar{name}|, if any|
|00000500| 2e 20 20 45 61 63 68 20 | 70 68 79 73 69 63 61 6c |. Each |physical|
|00000510| 20 6c 69 6e 65 2c 20 77 | 68 65 74 68 65 72 20 69 | line, w|hether i|
|00000520| 74 20 69 73 20 61 20 63 | 6f 6e 74 69 6e 75 61 74 |t is a c|ontinuat|
|00000530| 69 6f 6e 0a 6c 69 6e 65 | 20 6f 72 20 6e 6f 74 2c |ion.line| or not,|
|00000540| 20 69 73 20 61 20 73 65 | 70 61 72 61 74 65 20 6c | is a se|parate l|
|00000550| 69 73 74 20 69 74 65 6d | 2e 20 20 52 65 74 75 72 |ist item|. Retur|
|00000560| 6e 20 74 68 65 20 65 6d | 70 74 79 20 6c 69 73 74 |n the em|pty list|
|00000570| 20 69 66 20 6e 6f 0a 68 | 65 61 64 65 72 20 6d 61 | if no.h|eader ma|
|00000580| 74 63 68 65 73 20 5c 76 | 61 72 7b 6e 61 6d 65 7d |tches \v|ar{name}|
|00000590| 2e 0a 5c 65 6e 64 7b 66 | 75 6e 63 64 65 73 63 7d |..\end{f|uncdesc}|
|000005a0| 0a 0a 5c 62 65 67 69 6e | 7b 66 75 6e 63 64 65 73 |..\begin|{funcdes|
|000005b0| 63 7d 7b 67 65 74 66 69 | 72 73 74 6d 61 74 63 68 |c}{getfi|rstmatch|
|000005c0| 69 6e 67 68 65 61 64 65 | 72 7d 7b 6e 61 6d 65 7d |ingheade|r}{name}|
|000005d0| 0a 52 65 74 75 72 6e 20 | 61 20 6c 69 73 74 20 6f |.Return |a list o|
|000005e0| 66 20 6c 69 6e 65 73 20 | 63 6f 6d 70 72 69 73 69 |f lines |comprisi|
|000005f0| 6e 67 20 74 68 65 20 66 | 69 72 73 74 20 68 65 61 |ng the f|irst hea|
|00000600| 64 65 72 20 6d 61 74 63 | 68 69 6e 67 0a 5c 76 61 |der matc|hing.\va|
|00000610| 72 7b 6e 61 6d 65 7d 2c | 20 61 6e 64 20 69 74 73 |r{name},| and its|
|00000620| 20 63 6f 6e 74 69 6e 75 | 61 74 69 6f 6e 20 6c 69 | continu|ation li|
|00000630| 6e 65 28 73 29 2c 20 69 | 66 20 61 6e 79 2e 20 20 |ne(s), i|f any. |
|00000640| 52 65 74 75 72 6e 20 5c | 63 6f 64 65 7b 4e 6f 6e |Return \|code{Non|
|00000650| 65 7d 0a 69 66 20 74 68 | 65 72 65 20 69 73 20 6e |e}.if th|ere is n|
|00000660| 6f 20 68 65 61 64 65 72 | 20 6d 61 74 63 68 69 6e |o header| matchin|
|00000670| 67 20 5c 76 61 72 7b 6e | 61 6d 65 7d 2e 0a 5c 65 |g \var{n|ame}..\e|
|00000680| 6e 64 7b 66 75 6e 63 64 | 65 73 63 7d 0a 0a 5c 62 |nd{funcd|esc}..\b|
|00000690| 65 67 69 6e 7b 66 75 6e | 63 64 65 73 63 7d 7b 67 |egin{fun|cdesc}{g|
|000006a0| 65 74 72 61 77 68 65 61 | 64 65 72 7d 7b 6e 61 6d |etrawhea|der}{nam|
|000006b0| 65 7d 0a 52 65 74 75 72 | 6e 20 61 20 73 69 6e 67 |e}.Retur|n a sing|
|000006c0| 6c 65 20 73 74 72 69 6e | 67 20 63 6f 6e 73 69 73 |le strin|g consis|
|000006d0| 74 69 6e 67 20 6f 66 20 | 74 68 65 20 74 65 78 74 |ting of |the text|
|000006e0| 20 61 66 74 65 72 20 74 | 68 65 20 63 6f 6c 6f 6e | after t|he colon|
|000006f0| 20 69 6e 20 74 68 65 0a | 66 69 72 73 74 20 68 65 | in the.|first he|
|00000700| 61 64 65 72 20 6d 61 74 | 63 68 69 6e 67 20 5c 76 |ader mat|ching \v|
|00000710| 61 72 7b 6e 61 6d 65 7d | 2e 20 20 54 68 69 73 20 |ar{name}|. This |
|00000720| 69 6e 63 6c 75 64 65 73 | 20 6c 65 61 64 69 6e 67 |includes| leading|
|00000730| 20 77 68 69 74 65 73 70 | 61 63 65 2c 0a 74 68 65 | whitesp|ace,.the|
|00000740| 20 74 72 61 69 6c 69 6e | 67 20 6c 69 6e 65 66 65 | trailin|g linefe|
|00000750| 65 64 2c 20 61 6e 64 20 | 69 6e 74 65 72 6e 61 6c |ed, and |internal|
|00000760| 20 6c 69 6e 65 66 65 65 | 64 73 20 61 6e 64 20 77 | linefee|ds and w|
|00000770| 68 69 74 65 73 70 61 63 | 65 20 69 66 20 74 68 65 |hitespac|e if the|
|00000780| 72 65 0a 61 6e 79 20 63 | 6f 6e 74 69 6e 75 61 74 |re.any c|ontinuat|
|00000790| 69 6f 6e 20 6c 69 6e 65 | 28 73 29 20 77 65 72 65 |ion line|(s) were|
|000007a0| 20 70 72 65 73 65 6e 74 | 2e 20 20 52 65 74 75 72 | present|. Retur|
|000007b0| 6e 20 5c 63 6f 64 65 7b | 4e 6f 6e 65 7d 20 69 66 |n \code{|None} if|
|000007c0| 20 74 68 65 72 65 20 69 | 73 0a 6e 6f 20 68 65 61 | there i|s.no hea|
|000007d0| 64 65 72 20 6d 61 74 63 | 68 69 6e 67 20 5c 76 61 |der matc|hing \va|
|000007e0| 72 7b 6e 61 6d 65 7d 2e | 0a 5c 65 6e 64 7b 66 75 |r{name}.|.\end{fu|
|000007f0| 6e 63 64 65 73 63 7d 0a | 0a 5c 62 65 67 69 6e 7b |ncdesc}.|.\begin{|
|00000800| 66 75 6e 63 64 65 73 63 | 7d 7b 67 65 74 68 65 61 |funcdesc|}{gethea|
|00000810| 64 65 72 7d 7b 6e 61 6d | 65 7d 0a 4c 69 6b 65 20 |der}{nam|e}.Like |
|00000820| 5c 63 6f 64 65 7b 67 65 | 74 72 61 77 68 65 61 64 |\code{ge|trawhead|
|00000830| 65 72 28 5c 76 61 72 7b | 6e 61 6d 65 7d 29 7d 2c |er(\var{|name})},|
|00000840| 20 62 75 74 20 73 74 72 | 69 70 20 6c 65 61 64 69 | but str|ip leadi|
|00000850| 6e 67 20 61 6e 64 20 74 | 72 61 69 6c 69 6e 67 0a |ng and t|railing.|
|00000860| 77 68 69 74 65 73 70 61 | 63 65 20 28 62 75 74 20 |whitespa|ce (but |
|00000870| 6e 6f 74 20 69 6e 74 65 | 72 6e 61 6c 20 77 68 69 |not inte|rnal whi|
|00000880| 74 65 73 70 61 63 65 29 | 2e 0a 5c 65 6e 64 7b 66 |tespace)|..\end{f|
|00000890| 75 6e 63 64 65 73 63 7d | 0a 0a 5c 62 65 67 69 6e |uncdesc}|..\begin|
|000008a0| 7b 66 75 6e 63 64 65 73 | 63 7d 7b 67 65 74 61 64 |{funcdes|c}{getad|
|000008b0| 64 72 7d 7b 6e 61 6d 65 | 7d 0a 52 65 74 75 72 6e |dr}{name|}.Return|
|000008c0| 20 61 20 70 61 69 72 20 | 28 66 75 6c 6c 20 6e 61 | a pair |(full na|
|000008d0| 6d 65 2c 20 65 6d 61 69 | 6c 20 61 64 64 72 65 73 |me, emai|l addres|
|000008e0| 73 29 20 70 61 72 73 65 | 64 20 66 72 6f 6d 20 74 |s) parse|d from t|
|000008f0| 68 65 20 73 74 72 69 6e | 67 0a 72 65 74 75 72 6e |he strin|g.return|
|00000900| 65 64 20 62 79 20 5c 63 | 6f 64 65 7b 67 65 74 68 |ed by \c|ode{geth|
|00000910| 65 61 64 65 72 28 5c 76 | 61 72 7b 6e 61 6d 65 7d |eader(\v|ar{name}|
|00000920| 29 7d 2e 20 20 49 66 20 | 6e 6f 20 68 65 61 64 65 |)}. If |no heade|
|00000930| 72 20 6d 61 74 63 68 69 | 6e 67 0a 5c 76 61 72 7b |r matchi|ng.\var{|
|00000940| 6e 61 6d 65 7d 20 65 78 | 69 73 74 73 2c 20 72 65 |name} ex|ists, re|
|00000950| 74 75 72 6e 20 5c 63 6f | 64 65 7b 4e 6f 6e 65 2c |turn \co|de{None,|
|00000960| 20 4e 6f 6e 65 7d 3b 20 | 6f 74 68 65 72 77 69 73 | None}; |otherwis|
|00000970| 65 20 62 6f 74 68 20 74 | 68 65 20 66 75 6c 6c 0a |e both t|he full.|
|00000980| 6e 61 6d 65 20 61 6e 64 | 20 74 68 65 20 61 64 64 |name and| the add|
|00000990| 72 65 73 73 20 61 72 65 | 20 28 70 6f 73 73 69 62 |ress are| (possib|
|000009a0| 6c 79 20 65 6d 70 74 79 | 20 29 73 74 72 69 6e 67 |ly empty| )string|
|000009b0| 73 2e 0a 0a 45 78 61 6d | 70 6c 65 3a 20 49 66 20 |s...Exam|ple: If |
|000009c0| 5c 63 6f 64 65 7b 6d 7d | 27 73 20 66 69 72 73 74 |\code{m}|'s first|
|000009d0| 20 5c 63 6f 64 65 7b 46 | 72 6f 6d 7d 20 68 65 61 | \code{F|rom} hea|
|000009e0| 64 65 72 20 63 6f 6e 74 | 61 69 6e 73 20 74 68 65 |der cont|ains the|
|000009f0| 20 73 74 72 69 6e 67 5c | 5c 0a 5c 63 6f 64 65 7b | string\|\.\code{|
|00000a00| 27 6a 61 63 6b 40 63 77 | 69 2e 6e 6c 20 28 4a 61 |'jack@cw|i.nl (Ja|
|00000a10| 63 6b 20 4a 61 6e 73 65 | 6e 29 27 7d 2c 20 74 68 |ck Janse|n)'}, th|
|00000a20| 65 6e 0a 5c 63 6f 64 65 | 7b 6d 2e 67 65 74 61 64 |en.\code|{m.getad|
|00000a30| 64 72 28 27 46 72 6f 6d | 27 29 7d 20 77 69 6c 6c |dr('From|')} will|
|00000a40| 20 79 69 65 6c 64 20 74 | 68 65 20 70 61 69 72 0a | yield t|he pair.|
|00000a50| 5c 63 6f 64 65 7b 28 27 | 4a 61 63 6b 20 4a 61 6e |\code{('|Jack Jan|
|00000a60| 73 65 6e 27 2c 20 27 6a | 61 63 6b 40 63 77 69 2e |sen', 'j|ack@cwi.|
|00000a70| 6e 6c 27 29 7d 2e 0a 49 | 66 20 74 68 65 20 68 65 |nl')}..I|f the he|
|00000a80| 61 64 65 72 20 63 6f 6e | 74 61 69 6e 65 64 0a 5c |ader con|tained.\|
|00000a90| 63 6f 64 65 7b 27 4a 61 | 63 6b 20 4a 61 6e 73 65 |code{'Ja|ck Janse|
|00000aa0| 6e 20 3c 6a 61 63 6b 40 | 63 77 69 2e 6e 6c 3e 27 |n <jack@|cwi.nl>'|
|00000ab0| 7d 20 69 6e 73 74 65 61 | 64 2c 20 69 74 20 77 6f |} instea|d, it wo|
|00000ac0| 75 6c 64 20 79 69 65 6c | 64 20 74 68 65 0a 65 78 |uld yiel|d the.ex|
|00000ad0| 61 63 74 20 73 61 6d 65 | 20 72 65 73 75 6c 74 2e |act same| result.|
|00000ae0| 0a 5c 65 6e 64 7b 66 75 | 6e 63 64 65 73 63 7d 0a |.\end{fu|ncdesc}.|
|00000af0| 0a 5c 62 65 67 69 6e 7b | 66 75 6e 63 64 65 73 63 |.\begin{|funcdesc|
|00000b00| 7d 7b 67 65 74 61 64 64 | 72 6c 69 73 74 7d 7b 6e |}{getadd|rlist}{n|
|00000b10| 61 6d 65 7d 0a 54 68 69 | 73 20 69 73 20 73 69 6d |ame}.Thi|s is sim|
|00000b20| 69 6c 61 72 20 74 6f 20 | 5c 63 6f 64 65 7b 67 65 |ilar to |\code{ge|
|00000b30| 74 61 64 64 72 28 5c 76 | 61 72 7b 6c 69 73 74 7d |taddr(\v|ar{list}|
|00000b40| 29 7d 2c 20 62 75 74 20 | 70 61 72 73 65 73 20 61 |)}, but |parses a|
|00000b50| 20 68 65 61 64 65 72 0a | 63 6f 6e 74 61 69 6e 69 | header.|containi|
|00000b60| 6e 67 20 61 20 6c 69 73 | 74 20 6f 66 20 65 6d 61 |ng a lis|t of ema|
|00000b70| 69 6c 20 61 64 64 72 65 | 73 73 65 73 20 28 65 2e |il addre|sses (e.|
|00000b80| 67 2e 20 61 20 5c 63 6f | 64 65 7b 54 6f 7d 20 68 |g. a \co|de{To} h|
|00000b90| 65 61 64 65 72 29 20 61 | 6e 64 0a 72 65 74 75 72 |eader) a|nd.retur|
|00000ba0| 6e 73 20 61 20 6c 69 73 | 74 20 6f 66 20 28 66 75 |ns a lis|t of (fu|
|00000bb0| 6c 6c 20 6e 61 6d 65 2c | 20 65 6d 61 69 6c 20 61 |ll name,| email a|
|00000bc0| 64 64 72 65 73 73 29 20 | 70 61 69 72 73 20 28 65 |ddress) |pairs (e|
|00000bd0| 76 65 6e 20 69 66 20 74 | 68 65 72 65 20 77 61 73 |ven if t|here was|
|00000be0| 0a 6f 6e 6c 79 20 6f 6e | 65 20 61 64 64 72 65 73 |.only on|e addres|
|00000bf0| 73 20 69 6e 20 74 68 65 | 20 68 65 61 64 65 72 29 |s in the| header)|
|00000c00| 2e 20 20 49 66 20 74 68 | 65 72 65 20 69 73 20 6e |. If th|ere is n|
|00000c10| 6f 20 68 65 61 64 65 72 | 20 6d 61 74 63 68 69 6e |o header| matchin|
|00000c20| 67 0a 5c 76 61 72 7b 6e | 61 6d 65 7d 2c 20 72 65 |g.\var{n|ame}, re|
|00000c30| 74 75 72 6e 20 61 6e 20 | 65 6d 70 74 79 20 6c 69 |turn an |empty li|
|00000c40| 73 74 2e 0a 0a 58 58 58 | 20 54 68 65 20 63 75 72 |st...XXX| The cur|
|00000c50| 72 65 6e 74 20 76 65 72 | 73 69 6f 6e 20 6f 66 20 |rent ver|sion of |
|00000c60| 74 68 69 73 20 66 75 6e | 63 74 69 6f 6e 20 69 73 |this fun|ction is|
|00000c70| 20 6e 6f 74 20 72 65 61 | 6c 6c 79 20 63 6f 72 72 | not rea|lly corr|
|00000c80| 65 63 74 2e 20 20 49 74 | 0a 79 69 65 6c 64 73 20 |ect. It|.yields |
|00000c90| 62 6f 67 75 73 20 72 65 | 73 75 6c 74 73 20 69 66 |bogus re|sults if|
|00000ca0| 20 61 20 66 75 6c 6c 20 | 6e 61 6d 65 20 63 6f 6e | a full |name con|
|00000cb0| 74 61 69 6e 73 20 61 20 | 63 6f 6d 6d 61 2e 0a 5c |tains a |comma..\|
|00000cc0| 65 6e 64 7b 66 75 6e 63 | 64 65 73 63 7d 0a 0a 5c |end{func|desc}..\|
|00000cd0| 62 65 67 69 6e 7b 66 75 | 6e 63 64 65 73 63 7d 7b |begin{fu|ncdesc}{|
|00000ce0| 67 65 74 64 61 74 65 7d | 7b 6e 61 6d 65 7d 0a 52 |getdate}|{name}.R|
|00000cf0| 65 74 72 69 65 76 65 20 | 61 20 68 65 61 64 65 72 |etrieve |a header|
|00000d00| 20 75 73 69 6e 67 20 5c | 63 6f 64 65 7b 67 65 74 | using \|code{get|
|00000d10| 68 65 61 64 65 72 7d 20 | 61 6e 64 20 70 61 72 73 |header} |and pars|
|00000d20| 65 20 69 74 20 69 6e 74 | 6f 20 61 20 39 2d 74 75 |e it int|o a 9-tu|
|00000d30| 70 6c 65 0a 63 6f 6d 70 | 61 74 69 62 6c 65 20 77 |ple.comp|atible w|
|00000d40| 69 74 68 20 5c 63 6f 64 | 65 7b 74 69 6d 65 2e 6d |ith \cod|e{time.m|
|00000d50| 6b 74 69 6d 65 28 29 7d | 2e 20 20 49 66 20 74 68 |ktime()}|. If th|
|00000d60| 65 72 65 20 69 73 20 6e | 6f 20 68 65 61 64 65 72 |ere is n|o header|
|00000d70| 20 6d 61 74 63 68 69 6e | 67 0a 5c 76 61 72 7b 6e | matchin|g.\var{n|
|00000d80| 61 6d 65 7d 2c 20 6f 72 | 20 69 74 20 69 73 20 75 |ame}, or| it is u|
|00000d90| 6e 70 61 72 73 61 62 6c | 65 2c 20 72 65 74 75 72 |nparsabl|e, retur|
|00000da0| 6e 20 5c 63 6f 64 65 7b | 4e 6f 6e 65 7d 2e 0a 0a |n \code{|None}...|
|00000db0| 44 61 74 65 20 70 61 72 | 73 69 6e 67 20 61 70 70 |Date par|sing app|
|00000dc0| 65 61 72 73 20 74 6f 20 | 62 65 20 61 20 62 6c 61 |ears to |be a bla|
|00000dd0| 63 6b 20 61 72 74 2c 20 | 61 6e 64 20 6e 6f 74 20 |ck art, |and not |
|00000de0| 61 6c 6c 20 6d 61 69 6c | 65 72 73 20 61 64 68 65 |all mail|ers adhe|
|00000df0| 72 65 20 74 6f 0a 74 68 | 65 20 73 74 61 6e 64 61 |re to.th|e standa|
|00000e00| 72 64 2e 20 20 57 68 69 | 6c 65 20 69 74 20 68 61 |rd. Whi|le it ha|
|00000e10| 73 20 62 65 65 6e 20 74 | 65 73 74 65 64 20 61 6e |s been t|ested an|
|00000e20| 64 20 66 6f 75 6e 64 20 | 63 6f 72 72 65 63 74 20 |d found |correct |
|00000e30| 6f 6e 20 61 20 6c 61 72 | 67 65 0a 63 6f 6c 6c 65 |on a lar|ge.colle|
|00000e40| 63 74 69 6f 6e 20 6f 66 | 20 65 6d 61 69 6c 20 66 |ction of| email f|
|00000e50| 72 6f 6d 20 6d 61 6e 79 | 20 73 6f 75 72 63 65 73 |rom many| sources|
|00000e60| 2c 20 69 74 20 69 73 20 | 73 74 69 6c 6c 20 70 6f |, it is |still po|
|00000e70| 73 73 69 62 6c 65 20 74 | 68 61 74 20 74 68 69 73 |ssible t|hat this|
|00000e80| 0a 66 75 6e 63 74 69 6f | 6e 20 6d 61 79 20 6f 63 |.functio|n may oc|
|00000e90| 63 61 73 69 6f 6e 61 6c | 6c 79 20 79 69 65 6c 64 |casional|ly yield|
|00000ea0| 20 61 6e 20 69 6e 63 6f | 72 72 65 63 74 20 72 65 | an inco|rrect re|
|00000eb0| 73 75 6c 74 2e 0a 5c 65 | 6e 64 7b 66 75 6e 63 64 |sult..\e|nd{funcd|
|00000ec0| 65 73 63 7d 0a 0a 5c 63 | 6f 64 65 7b 4d 65 73 73 |esc}..\c|ode{Mess|
|00000ed0| 61 67 65 7d 20 69 6e 73 | 74 61 6e 63 65 73 20 61 |age} ins|tances a|
|00000ee0| 6c 73 6f 20 73 75 70 70 | 6f 72 74 20 61 20 72 65 |lso supp|ort a re|
|00000ef0| 61 64 2d 6f 6e 6c 79 20 | 6d 61 70 70 69 6e 67 20 |ad-only |mapping |
|00000f00| 69 6e 74 65 72 66 61 63 | 65 2e 0a 49 6e 20 70 61 |interfac|e..In pa|
|00000f10| 72 74 69 63 75 6c 61 72 | 3a 20 5c 63 6f 64 65 7b |rticular|: \code{|
|00000f20| 6d 5b 6e 61 6d 65 5d 7d | 20 69 73 20 74 68 65 20 |m[name]}| is the |
|00000f30| 73 61 6d 65 20 61 73 20 | 5c 63 6f 64 65 7b 6d 2e |same as |\code{m.|
|00000f40| 67 65 74 68 65 61 64 65 | 72 28 6e 61 6d 65 29 7d |getheade|r(name)}|
|00000f50| 3b 0a 61 6e 64 20 5c 63 | 6f 64 65 7b 6c 65 6e 28 |;.and \c|ode{len(|
|00000f60| 6d 29 7d 2c 20 5c 63 6f | 64 65 7b 6d 2e 68 61 73 |m)}, \co|de{m.has|
|00000f70| 5f 6b 65 79 28 6e 61 6d | 65 29 7d 2c 20 5c 63 6f |_key(nam|e)}, \co|
|00000f80| 64 65 7b 6d 2e 6b 65 79 | 73 28 29 7d 2c 0a 5c 63 |de{m.key|s()},.\c|
|00000f90| 6f 64 65 7b 6d 2e 76 61 | 6c 75 65 73 28 29 7d 20 |ode{m.va|lues()} |
|00000fa0| 61 6e 64 20 5c 63 6f 64 | 65 7b 6d 2e 69 74 65 6d |and \cod|e{m.item|
|00000fb0| 73 28 29 7d 20 61 63 74 | 20 61 73 20 65 78 70 65 |s()} act| as expe|
|00000fc0| 63 74 65 64 20 28 61 6e | 64 0a 63 6f 6e 73 69 73 |cted (an|d.consis|
|00000fd0| 74 65 6e 74 6c 79 29 2e | 0a 0a 46 69 6e 61 6c 6c |tently).|..Finall|
|00000fe0| 79 2c 20 5c 63 6f 64 65 | 7b 4d 65 73 73 61 67 65 |y, \code|{Message|
|00000ff0| 7d 20 69 6e 73 74 61 6e | 63 65 73 20 68 61 76 65 |} instan|ces have|
|00001000| 20 74 77 6f 20 70 75 62 | 6c 69 63 20 69 6e 73 74 | two pub|lic inst|
|00001010| 61 6e 63 65 20 76 61 72 | 69 61 62 6c 65 73 3a 0a |ance var|iables:.|
|00001020| 0a 5c 62 65 67 69 6e 7b | 64 61 74 61 64 65 73 63 |.\begin{|datadesc|
|00001030| 7d 7b 68 65 61 64 65 72 | 73 7d 0a 41 20 6c 69 73 |}{header|s}.A lis|
|00001040| 74 20 63 6f 6e 74 61 69 | 6e 69 6e 67 20 74 68 65 |t contai|ning the|
|00001050| 20 65 6e 74 69 72 65 20 | 73 65 74 20 6f 66 20 68 | entire |set of h|
|00001060| 65 61 64 65 72 20 6c 69 | 6e 65 73 2c 20 69 6e 20 |eader li|nes, in |
|00001070| 74 68 65 20 6f 72 64 65 | 72 20 69 6e 0a 77 68 69 |the orde|r in.whi|
|00001080| 63 68 20 74 68 65 79 20 | 77 65 72 65 20 72 65 61 |ch they |were rea|
|00001090| 64 2e 20 20 45 61 63 68 | 20 6c 69 6e 65 20 63 6f |d. Each| line co|
|000010a0| 6e 74 61 69 6e 73 20 61 | 20 74 72 61 69 6c 69 6e |ntains a| trailin|
|000010b0| 67 20 6e 65 77 6c 69 6e | 65 2e 20 20 54 68 65 0a |g newlin|e. The.|
|000010c0| 62 6c 61 6e 6b 20 6c 69 | 6e 65 20 74 65 72 6d 69 |blank li|ne termi|
|000010d0| 6e 61 74 69 6e 67 20 74 | 68 65 20 68 65 61 64 65 |nating t|he heade|
|000010e0| 72 73 20 69 73 20 6e 6f | 74 20 63 6f 6e 74 61 69 |rs is no|t contai|
|000010f0| 6e 65 64 20 69 6e 20 74 | 68 65 20 6c 69 73 74 2e |ned in t|he list.|
|00001100| 0a 5c 65 6e 64 7b 64 61 | 74 61 64 65 73 63 7d 0a |.\end{da|tadesc}.|
|00001110| 0a 5c 62 65 67 69 6e 7b | 64 61 74 61 64 65 73 63 |.\begin{|datadesc|
|00001120| 7d 7b 66 70 7d 0a 54 68 | 65 20 66 69 6c 65 20 6f |}{fp}.Th|e file o|
|00001130| 62 6a 65 63 74 20 70 61 | 73 73 65 64 20 61 74 20 |bject pa|ssed at |
|00001140| 69 6e 73 74 61 6e 74 69 | 61 74 69 6f 6e 20 74 69 |instanti|ation ti|
|00001150| 6d 65 2e 0a 5c 65 6e 64 | 7b 64 61 74 61 64 65 73 |me..\end|{datades|
|00001160| 63 7d 0a | |c}. | |
+--------+-------------------------+-------------------------+--------+--------+