Module fileformat
[hide private]
[frames] | no frames]

Source Code for Module fileformat

 1  # -*- coding: utf-8 -*- 
 2  """ 
 3  Character encoding 
 4  ================== 
 5   
 6  A character enconding can be speciffied similar to :pep:`0263` using:: 
 7   
 8    # -*- coding: <encoding name> -*- 
 9   
10  in the first line. ``#`` is replaced with the actual `comment`_ mark. 
11   
12  More precisely, the first  line must match the regular 
13  expression:: 
14   
15    ^#.*coding[:=]\s*([-\w.]+) 
16   
17  Again ``#`` is treplaces by the actual `comment`_ mark.  The first group 
18  of this expression is then interpreted as encoding name. 
19   
20   
21  Data set 
22  ======== 
23   
24  A *data set* consists of zero or more `records <#record>`__  seperated  
25  by one or more empty lines. 
26   
27  Comment 
28  ======= 
29  Lines starting with the *comment mark* (default: ``#``) are  
30  ignored. Comments can be used in or between `records <#record>`__. 
31   
32   
33  Record 
34  ====== 
35  A *record* consists of one or more `fields <#field>`__  
36   
37  Field 
38  ===== 
39   
40  A *field* is a line that has the form:: 
41   
42     key: value 
43   
44  *key* is a string that 
45     - doesn't contain  a colon 
46     - doesn't start with the `comment`_ mark 
47     - doesn't start with the `continuation`_ mark 
48      
49  *value* is an arbitrary string. It can span multiple line using 
50  `continuation`_ marks. 
51   
52   
53  Continuation 
54  ============ 
55  If a line starts with the *continuation mark* (default: " " [one blank]) 
56  it gets appended to the preceding line, with the  
57  continuation mark removed. 
58   
59   
60  """ 
61