Documentation/Source/Tools.html

branch
Py2 comp.
changeset 3056
9986ec0e559a
equal deleted inserted replaced
2911:ce77f0b1ee67 3056:9986ec0e559a
1 <!DOCTYPE html>
2 <html><head>
3 <title>Tools</title>
4 <meta charset="UTF-8">
5 <style>
6 body {
7 background: #EDECE6;
8 margin: 0em 1em 10em 1em;
9 color: black;
10 }
11
12 h1 { color: white; background: #85774A; }
13 h2 { color: white; background: #85774A; }
14 h3 { color: white; background: #9D936E; }
15 h4 { color: white; background: #9D936E; }
16
17 a { color: #BA6D36; }
18
19 </style>
20 </head>
21 <body><a NAME="top" ID="top"></a>
22 <h1>Tools</h1>
23 <p>
24 Module implementing tool functions.
25 </p>
26 <h3>Global Attributes</h3>
27 <table>
28 <tr><td>coding_regexps</td></tr>
29 </table>
30 <h3>Classes</h3>
31 <table>
32 <tr><td>None</td></tr>
33 </table>
34 <h3>Functions</h3>
35 <table>
36 <tr>
37 <td><a href="#decode">decode</a></td>
38 <td>Function to decode a text.</td>
39 </tr><tr>
40 <td><a href="#extractLineFlags">extractLineFlags</a></td>
41 <td>Function to extract flags starting and ending with '__' from a line comment.</td>
42 </tr><tr>
43 <td><a href="#get_coding">get_coding</a></td>
44 <td>Function to get the coding of a text.</td>
45 </tr><tr>
46 <td><a href="#normalizeCode">normalizeCode</a></td>
47 <td>Function to normalize the given code.</td>
48 </tr><tr>
49 <td><a href="#readEncodedFile">readEncodedFile</a></td>
50 <td>Function to read a file and decode its contents into proper text.</td>
51 </tr>
52 </table>
53 <hr /><hr />
54 <a NAME="decode" ID="decode"></a>
55 <h2>decode</h2>
56 <b>decode</b>(<i>text</i>)
57 <p>
58 Function to decode a text.
59 </p><dl>
60 <dt><i>text</i></dt>
61 <dd>
62 text to decode (string)
63 </dd>
64 </dl><dl>
65 <dt>Returns:</dt>
66 <dd>
67 decoded text and encoding
68 </dd>
69 </dl>
70 <div align="right"><a href="#top">Up</a></div>
71 <hr /><hr />
72 <a NAME="extractLineFlags" ID="extractLineFlags"></a>
73 <h2>extractLineFlags</h2>
74 <b>extractLineFlags</b>(<i>line, startComment="</i>)
75 <p>
76 Function to extract flags starting and ending with '__' from a line comment.
77 </p><dl>
78 <dt><i>line</i></dt>
79 <dd>
80 line to extract flags from (string)
81 </dd><dt><i>startComment=</i></dt>
82 <dd>
83 string identifying the start of the comment (string)
84 </dd><dt><i>endComment=</i></dt>
85 <dd>
86 string identifying the end of a comment (string)
87 </dd>
88 </dl><dl>
89 <dt>Returns:</dt>
90 <dd>
91 list containing the extracted flags (list of strings)
92 </dd>
93 </dl>
94 <div align="right"><a href="#top">Up</a></div>
95 <hr /><hr />
96 <a NAME="get_coding" ID="get_coding"></a>
97 <h2>get_coding</h2>
98 <b>get_coding</b>(<i>text</i>)
99 <p>
100 Function to get the coding of a text.
101 </p><dl>
102 <dt><i>text</i></dt>
103 <dd>
104 text to inspect (string)
105 </dd>
106 </dl><dl>
107 <dt>Returns:</dt>
108 <dd>
109 coding string
110 </dd>
111 </dl>
112 <div align="right"><a href="#top">Up</a></div>
113 <hr /><hr />
114 <a NAME="normalizeCode" ID="normalizeCode"></a>
115 <h2>normalizeCode</h2>
116 <b>normalizeCode</b>(<i>codestring</i>)
117 <p>
118 Function to normalize the given code.
119 </p><dl>
120 <dt><i>codestring</i></dt>
121 <dd>
122 code to be normalized (string)
123 </dd>
124 </dl><dl>
125 <dt>Returns:</dt>
126 <dd>
127 normalized code (string)
128 </dd>
129 </dl>
130 <div align="right"><a href="#top">Up</a></div>
131 <hr /><hr />
132 <a NAME="readEncodedFile" ID="readEncodedFile"></a>
133 <h2>readEncodedFile</h2>
134 <b>readEncodedFile</b>(<i>filename</i>)
135 <p>
136 Function to read a file and decode its contents into proper text.
137 </p><dl>
138 <dt><i>filename</i></dt>
139 <dd>
140 name of the file to read (string)
141 </dd>
142 </dl><dl>
143 <dt>Returns:</dt>
144 <dd>
145 tuple of decoded text and encoding (string, string)
146 </dd>
147 </dl>
148 <div align="right"><a href="#top">Up</a></div>
149 <hr />
150 </body></html>

eric ide

mercurial