Merge lp:~al-maisan/py-script/doc-500616 into lp:py-script

Proposed by Muharem Hrnjadovic
Status: Merged
Approved by: Muharem Hrnjadovic
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~al-maisan/py-script/doc-500616
Merge into: lp:py-script
Diff against target: 5792 lines (+1135/-2589)
21 files modified
doc/html/api-objects.txt (+0/-6)
doc/html/class-tree.html (+0/-132)
doc/html/epydoc.css (+0/-312)
doc/html/epydoc.js (+0/-280)
doc/html/frames.html (+0/-17)
doc/html/help.html (+0/-278)
doc/html/identifier-index.html (+0/-181)
doc/html/index.html (+0/-17)
doc/html/module-tree.html (+0/-115)
doc/html/redirect.html (+0/-38)
doc/html/scriptutil-module.html (+0/-509)
doc/html/scriptutil-pysrc.html (+0/-388)
doc/html/scriptutil.ScriptError-class.html (+0/-197)
doc/html/scriptutil.find-module.html (+494/-0)
doc/html/scriptutil.find-pysrc.html (+390/-0)
doc/html/scriptutil.find.ScriptError-class.html (+202/-0)
doc/html/toc-everything.html (+0/-37)
doc/html/toc-scriptutil-module.html (+0/-37)
doc/html/toc-scriptutil.find-module.html (+38/-0)
doc/html/toc.html (+0/-34)
src/scriptutil/find.py (+11/-11)
To merge this branch: bzr merge lp:~al-maisan/py-script/doc-500616
Reviewer Review Type Date Requested Status
Muharem Hrnjadovic Approve
Review via email: mp+16602@code.launchpad.net

Commit message

HTML doc re-generated.

To post a comment you must log in.
Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote :

HTML doc re-generated.

Revision history for this message
Muharem Hrnjadovic (al-maisan) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'doc/html'
=== removed directory 'doc/html'
=== added file 'doc/html/api-objects.txt'
--- doc/html/api-objects.txt 1970-01-01 00:00:00 +0000
+++ doc/html/api-objects.txt 2009-12-26 22:06:14 +0000
@@ -0,0 +1,9 @@
1scriptutil scriptutil-module.html
2scriptutil.__package__ scriptutil-module.html#__package__
3scriptutil.find scriptutil.find-module.html
4scriptutil.find.grep scriptutil.find-module.html#grep
5scriptutil.find.pprint scriptutil.find-module.html#pprint
6scriptutil.find.__package__ scriptutil.find-module.html#__package__
7scriptutil.find.replace scriptutil.find-module.html#replace
8scriptutil.find.find scriptutil.find-module.html#find
9scriptutil.find.ScriptError scriptutil.find.ScriptError-class.html
010
=== removed file 'doc/html/api-objects.txt'
--- doc/html/api-objects.txt 2009-12-26 20:49:38 +0000
+++ doc/html/api-objects.txt 1970-01-01 00:00:00 +0000
@@ -1,6 +0,0 @@
1scriptutil scriptutil-module.html
2scriptutil.printr scriptutil-module.html#printr
3scriptutil.freplace scriptutil-module.html#freplace
4scriptutil.ffind scriptutil-module.html#ffind
5scriptutil.ffindgrep scriptutil-module.html#ffindgrep
6scriptutil.ScriptError scriptutil.ScriptError-class.html
70
=== added file 'doc/html/class-tree.html'
--- doc/html/class-tree.html 1970-01-01 00:00:00 +0000
+++ doc/html/class-tree.html 2009-12-26 22:06:14 +0000
@@ -0,0 +1,132 @@
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title>Class Hierarchy</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12 alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
16 <tr valign="middle">
17 <!-- Home link -->
18 <th>&nbsp;&nbsp;&nbsp;<a
19 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21 <!-- Tree link -->
22 <th bgcolor="#70b0f0" class="navbar-select"
23 >&nbsp;&nbsp;&nbsp;Trees&nbsp;&nbsp;&nbsp;</th>
24
25 <!-- Index link -->
26 <th>&nbsp;&nbsp;&nbsp;<a
27 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29 <!-- Help link -->
30 <th>&nbsp;&nbsp;&nbsp;<a
31 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="https://launchpad.net/py-script">Project Homepage</a></th>
38 </tr></table></th>
39 </tr>
40</table>
41<table width="100%" cellpadding="0" cellspacing="0">
42 <tr valign="top">
43 <td width="100%">&nbsp;</td>
44 <td>
45 <table cellpadding="0" cellspacing="0">
46 <!-- hide/show private -->
47 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
48 onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
49 <tr><td align="right"><span class="options"
50 >[<a href="frames.html" target="_top">frames</a
51 >]&nbsp;|&nbsp;<a href="class-tree.html"
52 target="_top">no&nbsp;frames</a>]</span></td></tr>
53 </table>
54 </td>
55 </tr>
56</table>
57<center><b>
58 [ <a href="module-tree.html">Module Hierarchy</a>
59 | <a href="class-tree.html">Class Hierarchy</a> ]
60</b></center><br />
61<h1 class="epydoc">Class Hierarchy</h1>
62<ul class="nomargin-top">
63 <li> <strong class="uidlink">object</strong>:
64 <em class="summary">The most base type</em>
65 <ul>
66 <li> <strong class="uidlink">exceptions.BaseException</strong>:
67 <em class="summary">Common base class for all exceptions</em>
68 <ul>
69 <li> <strong class="uidlink">exceptions.Exception</strong>:
70 <em class="summary">Common base class for all non-exit exceptions.</em>
71 <ul>
72 <li> <strong class="uidlink"><a href="scriptutil.find.ScriptError-class.html">scriptutil.find.ScriptError</a></strong>:
73 <em class="summary">The exception raised in case of failures.</em>
74 </li>
75 </ul>
76 </li>
77 </ul>
78 </li>
79 </ul>
80 </li>
81</ul>
82<!-- ==================== NAVIGATION BAR ==================== -->
83<table class="navbar" border="0" width="100%" cellpadding="0"
84 bgcolor="#a0c0ff" cellspacing="0">
85 <tr valign="middle">
86 <!-- Home link -->
87 <th>&nbsp;&nbsp;&nbsp;<a
88 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
89
90 <!-- Tree link -->
91 <th bgcolor="#70b0f0" class="navbar-select"
92 >&nbsp;&nbsp;&nbsp;Trees&nbsp;&nbsp;&nbsp;</th>
93
94 <!-- Index link -->
95 <th>&nbsp;&nbsp;&nbsp;<a
96 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
97
98 <!-- Help link -->
99 <th>&nbsp;&nbsp;&nbsp;<a
100 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
101
102 <!-- Project homepage -->
103 <th class="navbar" align="right" width="100%">
104 <table border="0" cellpadding="0" cellspacing="0">
105 <tr><th class="navbar" align="center"
106 ><a class="navbar" target="_top" href="https://launchpad.net/py-script">Project Homepage</a></th>
107 </tr></table></th>
108 </tr>
109</table>
110<table border="0" cellpadding="0" cellspacing="0" width="100%%">
111 <tr>
112 <td align="left" class="footer">
113 Generated by Epydoc 3.0.1 on Sat Dec 26 23:01:34 2009
114 </td>
115 <td align="right" class="footer">
116 <a target="mainFrame" href="http://epydoc.sourceforge.net"
117 >http://epydoc.sourceforge.net</a>
118 </td>
119 </tr>
120</table>
121
122<script type="text/javascript">
123 <!--
124 // Private objects are initially displayed (because if
125 // javascript is turned off then we want them to be
126 // visible); but by default, we want to hide them. So hide
127 // them unless we have a cookie that says to show them.
128 checkCookie();
129 // -->
130</script>
131</body>
132</html>
0133
=== removed file 'doc/html/class-tree.html'
--- doc/html/class-tree.html 2009-12-26 20:49:38 +0000
+++ doc/html/class-tree.html 1970-01-01 00:00:00 +0000
@@ -1,132 +0,0 @@
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title>Class Hierarchy</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12 alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
16 <tr valign="middle">
17 <!-- Home link -->
18 <th>&nbsp;&nbsp;&nbsp;<a
19 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21 <!-- Tree link -->
22 <th bgcolor="#70b0f0" class="navbar-select"
23 >&nbsp;&nbsp;&nbsp;Trees&nbsp;&nbsp;&nbsp;</th>
24
25 <!-- Index link -->
26 <th>&nbsp;&nbsp;&nbsp;<a
27 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29 <!-- Help link -->
30 <th>&nbsp;&nbsp;&nbsp;<a
31 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="http://hrnjad.net/src/scriptutil">Module scriptutil</a></th>
38 </tr></table></th>
39 </tr>
40</table>
41<table width="100%" cellpadding="0" cellspacing="0">
42 <tr valign="top">
43 <td width="100%">&nbsp;</td>
44 <td>
45 <table cellpadding="0" cellspacing="0">
46 <!-- hide/show private -->
47 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
48 onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
49 <tr><td align="right"><span class="options"
50 >[<a href="frames.html" target="_top">frames</a
51 >]&nbsp;|&nbsp;<a href="class-tree.html"
52 target="_top">no&nbsp;frames</a>]</span></td></tr>
53 </table>
54 </td>
55 </tr>
56</table>
57<center><b>
58 [ <a href="module-tree.html">Module Hierarchy</a>
59 | <a href="class-tree.html">Class Hierarchy</a> ]
60</b></center><br />
61<h1 class="epydoc">Class Hierarchy</h1>
62<ul class="nomargin-top">
63 <li> <strong class="uidlink">object</strong>:
64 <em class="summary">The most base type</em>
65 <ul>
66 <li> <strong class="uidlink">exceptions.BaseException</strong>:
67 <em class="summary">Common base class for all exceptions</em>
68 <ul>
69 <li> <strong class="uidlink">exceptions.Exception</strong>:
70 <em class="summary">Common base class for all non-exit exceptions.</em>
71 <ul>
72 <li> <strong class="uidlink"><a href="scriptutil.ScriptError-class.html">scriptutil.ScriptError</a></strong>:
73 <em class="summary">The exception raised in case of failures.</em>
74 </li>
75 </ul>
76 </li>
77 </ul>
78 </li>
79 </ul>
80 </li>
81</ul>
82<!-- ==================== NAVIGATION BAR ==================== -->
83<table class="navbar" border="0" width="100%" cellpadding="0"
84 bgcolor="#a0c0ff" cellspacing="0">
85 <tr valign="middle">
86 <!-- Home link -->
87 <th>&nbsp;&nbsp;&nbsp;<a
88 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
89
90 <!-- Tree link -->
91 <th bgcolor="#70b0f0" class="navbar-select"
92 >&nbsp;&nbsp;&nbsp;Trees&nbsp;&nbsp;&nbsp;</th>
93
94 <!-- Index link -->
95 <th>&nbsp;&nbsp;&nbsp;<a
96 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
97
98 <!-- Help link -->
99 <th>&nbsp;&nbsp;&nbsp;<a
100 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
101
102 <!-- Project homepage -->
103 <th class="navbar" align="right" width="100%">
104 <table border="0" cellpadding="0" cellspacing="0">
105 <tr><th class="navbar" align="center"
106 ><a class="navbar" target="_top" href="http://hrnjad.net/src/scriptutil">Module scriptutil</a></th>
107 </tr></table></th>
108 </tr>
109</table>
110<table border="0" cellpadding="0" cellspacing="0" width="100%%">
111 <tr>
112 <td align="left" class="footer">
113 Generated by Epydoc 3.0beta1 on Thu May 22 18:10:51 2008
114 </td>
115 <td align="right" class="footer">
116 <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
117 </td>
118 </tr>
119</table>
120
121<script type="text/javascript">
122 <!--
123 // Private objects are initially displayed (because if
124 // javascript is turned off then we want them to be
125 // visible); but by default, we want to hide them. So hide
126 // them unless we have a cookie that says to show them.
127 checkCookie()
128 // -->
129</script>
130
131</body>
132</html>
1330
=== added file 'doc/html/crarr.png'
134Binary files doc/html/crarr.png 1970-01-01 00:00:00 +0000 and doc/html/crarr.png 2009-12-26 22:06:14 +0000 differ1Binary files doc/html/crarr.png 1970-01-01 00:00:00 +0000 and doc/html/crarr.png 2009-12-26 22:06:14 +0000 differ
=== removed file 'doc/html/crarr.png'
135Binary files doc/html/crarr.png 2009-12-26 20:49:38 +0000 and doc/html/crarr.png 1970-01-01 00:00:00 +0000 differ2Binary files doc/html/crarr.png 2009-12-26 20:49:38 +0000 and doc/html/crarr.png 1970-01-01 00:00:00 +0000 differ
=== added file 'doc/html/epydoc.css'
--- doc/html/epydoc.css 1970-01-01 00:00:00 +0000
+++ doc/html/epydoc.css 2009-12-26 22:06:14 +0000
@@ -0,0 +1,322 @@
1
2
3/* Epydoc CSS Stylesheet
4 *
5 * This stylesheet can be used to customize the appearance of epydoc's
6 * HTML output.
7 *
8 */
9
10/* Default Colors & Styles
11 * - Set the default foreground & background color with 'body'; and
12 * link colors with 'a:link' and 'a:visited'.
13 * - Use bold for decision list terms.
14 * - The heading styles defined here are used for headings *within*
15 * docstring descriptions. All headings used by epydoc itself use
16 * either class='epydoc' or class='toc' (CSS styles for both
17 * defined below).
18 */
19body { background: #ffffff; color: #000000; }
20p { margin-top: 0.5em; margin-bottom: 0.5em; }
21a:link { color: #0000ff; }
22a:visited { color: #204080; }
23dt { font-weight: bold; }
24h1 { font-size: +140%; font-style: italic;
25 font-weight: bold; }
26h2 { font-size: +125%; font-style: italic;
27 font-weight: bold; }
28h3 { font-size: +110%; font-style: italic;
29 font-weight: normal; }
30code { font-size: 100%; }
31/* N.B.: class, not pseudoclass */
32a.link { font-family: monospace; }
33
34/* Page Header & Footer
35 * - The standard page header consists of a navigation bar (with
36 * pointers to standard pages such as 'home' and 'trees'); a
37 * breadcrumbs list, which can be used to navigate to containing
38 * classes or modules; options links, to show/hide private
39 * variables and to show/hide frames; and a page title (using
40 * <h1>). The page title may be followed by a link to the
41 * corresponding source code (using 'span.codelink').
42 * - The footer consists of a navigation bar, a timestamp, and a
43 * pointer to epydoc's homepage.
44 */
45h1.epydoc { margin: 0; font-size: +140%; font-weight: bold; }
46h2.epydoc { font-size: +130%; font-weight: bold; }
47h3.epydoc { font-size: +115%; font-weight: bold;
48 margin-top: 0.2em; }
49td h3.epydoc { font-size: +115%; font-weight: bold;
50 margin-bottom: 0; }
51table.navbar { background: #a0c0ff; color: #000000;
52 border: 2px groove #c0d0d0; }
53table.navbar table { color: #000000; }
54th.navbar-select { background: #70b0ff;
55 color: #000000; }
56table.navbar a { text-decoration: none; }
57table.navbar a:link { color: #0000ff; }
58table.navbar a:visited { color: #204080; }
59span.breadcrumbs { font-size: 85%; font-weight: bold; }
60span.options { font-size: 70%; }
61span.codelink { font-size: 85%; }
62td.footer { font-size: 85%; }
63
64/* Table Headers
65 * - Each summary table and details section begins with a 'header'
66 * row. This row contains a section title (marked by
67 * 'span.table-header') as well as a show/hide private link
68 * (marked by 'span.options', defined above).
69 * - Summary tables that contain user-defined groups mark those
70 * groups using 'group header' rows.
71 */
72td.table-header { background: #70b0ff; color: #000000;
73 border: 1px solid #608090; }
74td.table-header table { color: #000000; }
75td.table-header table a:link { color: #0000ff; }
76td.table-header table a:visited { color: #204080; }
77span.table-header { font-size: 120%; font-weight: bold; }
78th.group-header { background: #c0e0f8; color: #000000;
79 text-align: left; font-style: italic;
80 font-size: 115%;
81 border: 1px solid #608090; }
82
83/* Summary Tables (functions, variables, etc)
84 * - Each object is described by a single row of the table with
85 * two cells. The left cell gives the object's type, and is
86 * marked with 'code.summary-type'. The right cell gives the
87 * object's name and a summary description.
88 * - CSS styles for the table's header and group headers are
89 * defined above, under 'Table Headers'
90 */
91table.summary { border-collapse: collapse;
92 background: #e8f0f8; color: #000000;
93 border: 1px solid #608090;
94 margin-bottom: 0.5em; }
95td.summary { border: 1px solid #608090; }
96code.summary-type { font-size: 85%; }
97table.summary a:link { color: #0000ff; }
98table.summary a:visited { color: #204080; }
99
100
101/* Details Tables (functions, variables, etc)
102 * - Each object is described in its own div.
103 * - A single-row summary table w/ table-header is used as
104 * a header for each details section (CSS style for table-header
105 * is defined above, under 'Table Headers').
106 */
107table.details { border-collapse: collapse;
108 background: #e8f0f8; color: #000000;
109 border: 1px solid #608090;
110 margin: .2em 0 0 0; }
111table.details table { color: #000000; }
112table.details a:link { color: #0000ff; }
113table.details a:visited { color: #204080; }
114
115/* Fields */
116dl.fields { margin-left: 2em; margin-top: 1em;
117 margin-bottom: 1em; }
118dl.fields dd ul { margin-left: 0em; padding-left: 0em; }
119dl.fields dd ul li ul { margin-left: 2em; padding-left: 0em; }
120div.fields { margin-left: 2em; }
121div.fields p { margin-bottom: 0.5em; }
122
123/* Index tables (identifier index, term index, etc)
124 * - link-index is used for indices containing lists of links
125 * (namely, the identifier index & term index).
126 * - index-where is used in link indices for the text indicating
127 * the container/source for each link.
128 * - metadata-index is used for indices containing metadata
129 * extracted from fields (namely, the bug index & todo index).
130 */
131table.link-index { border-collapse: collapse;
132 background: #e8f0f8; color: #000000;
133 border: 1px solid #608090; }
134td.link-index { border-width: 0px; }
135table.link-index a:link { color: #0000ff; }
136table.link-index a:visited { color: #204080; }
137span.index-where { font-size: 70%; }
138table.metadata-index { border-collapse: collapse;
139 background: #e8f0f8; color: #000000;
140 border: 1px solid #608090;
141 margin: .2em 0 0 0; }
142td.metadata-index { border-width: 1px; border-style: solid; }
143table.metadata-index a:link { color: #0000ff; }
144table.metadata-index a:visited { color: #204080; }
145
146/* Function signatures
147 * - sig* is used for the signature in the details section.
148 * - .summary-sig* is used for the signature in the summary
149 * table, and when listing property accessor functions.
150 * */
151.sig-name { color: #006080; }
152.sig-arg { color: #008060; }
153.sig-default { color: #602000; }
154.summary-sig { font-family: monospace; }
155.summary-sig-name { color: #006080; font-weight: bold; }
156table.summary a.summary-sig-name:link
157 { color: #006080; font-weight: bold; }
158table.summary a.summary-sig-name:visited
159 { color: #006080; font-weight: bold; }
160.summary-sig-arg { color: #006040; }
161.summary-sig-default { color: #501800; }
162
163/* Subclass list
164 */
165ul.subclass-list { display: inline; }
166ul.subclass-list li { display: inline; }
167
168/* To render variables, classes etc. like functions */
169table.summary .summary-name { color: #006080; font-weight: bold;
170 font-family: monospace; }
171table.summary
172 a.summary-name:link { color: #006080; font-weight: bold;
173 font-family: monospace; }
174table.summary
175 a.summary-name:visited { color: #006080; font-weight: bold;
176 font-family: monospace; }
177
178/* Variable values
179 * - In the 'variable details' sections, each varaible's value is
180 * listed in a 'pre.variable' box. The width of this box is
181 * restricted to 80 chars; if the value's repr is longer than
182 * this it will be wrapped, using a backslash marked with
183 * class 'variable-linewrap'. If the value's repr is longer
184 * than 3 lines, the rest will be ellided; and an ellipsis
185 * marker ('...' marked with 'variable-ellipsis') will be used.
186 * - If the value is a string, its quote marks will be marked
187 * with 'variable-quote'.
188 * - If the variable is a regexp, it is syntax-highlighted using
189 * the re* CSS classes.
190 */
191pre.variable { padding: .5em; margin: 0;
192 background: #dce4ec; color: #000000;
193 border: 1px solid #708890; }
194.variable-linewrap { color: #604000; font-weight: bold; }
195.variable-ellipsis { color: #604000; font-weight: bold; }
196.variable-quote { color: #604000; font-weight: bold; }
197.variable-group { color: #008000; font-weight: bold; }
198.variable-op { color: #604000; font-weight: bold; }
199.variable-string { color: #006030; }
200.variable-unknown { color: #a00000; font-weight: bold; }
201.re { color: #000000; }
202.re-char { color: #006030; }
203.re-op { color: #600000; }
204.re-group { color: #003060; }
205.re-ref { color: #404040; }
206
207/* Base tree
208 * - Used by class pages to display the base class hierarchy.
209 */
210pre.base-tree { font-size: 80%; margin: 0; }
211
212/* Frames-based table of contents headers
213 * - Consists of two frames: one for selecting modules; and
214 * the other listing the contents of the selected module.
215 * - h1.toc is used for each frame's heading
216 * - h2.toc is used for subheadings within each frame.
217 */
218h1.toc { text-align: center; font-size: 105%;
219 margin: 0; font-weight: bold;
220 padding: 0; }
221h2.toc { font-size: 100%; font-weight: bold;
222 margin: 0.5em 0 0 -0.3em; }
223
224/* Syntax Highlighting for Source Code
225 * - doctest examples are displayed in a 'pre.py-doctest' block.
226 * If the example is in a details table entry, then it will use
227 * the colors specified by the 'table pre.py-doctest' line.
228 * - Source code listings are displayed in a 'pre.py-src' block.
229 * Each line is marked with 'span.py-line' (used to draw a line
230 * down the left margin, separating the code from the line
231 * numbers). Line numbers are displayed with 'span.py-lineno'.
232 * The expand/collapse block toggle button is displayed with
233 * 'a.py-toggle' (Note: the CSS style for 'a.py-toggle' should not
234 * modify the font size of the text.)
235 * - If a source code page is opened with an anchor, then the
236 * corresponding code block will be highlighted. The code
237 * block's header is highlighted with 'py-highlight-hdr'; and
238 * the code block's body is highlighted with 'py-highlight'.
239 * - The remaining py-* classes are used to perform syntax
240 * highlighting (py-string for string literals, py-name for names,
241 * etc.)
242 */
243pre.py-doctest { padding: .5em; margin: 1em;
244 background: #e8f0f8; color: #000000;
245 border: 1px solid #708890; }
246table pre.py-doctest { background: #dce4ec;
247 color: #000000; }
248pre.py-src { border: 2px solid #000000;
249 background: #f0f0f0; color: #000000; }
250.py-line { border-left: 2px solid #000000;
251 margin-left: .2em; padding-left: .4em; }
252.py-lineno { font-style: italic; font-size: 90%;
253 padding-left: .5em; }
254a.py-toggle { text-decoration: none; }
255div.py-highlight-hdr { border-top: 2px solid #000000;
256 border-bottom: 2px solid #000000;
257 background: #d8e8e8; }
258div.py-highlight { border-bottom: 2px solid #000000;
259 background: #d0e0e0; }
260.py-prompt { color: #005050; font-weight: bold;}
261.py-more { color: #005050; font-weight: bold;}
262.py-string { color: #006030; }
263.py-comment { color: #003060; }
264.py-keyword { color: #600000; }
265.py-output { color: #404040; }
266.py-name { color: #000050; }
267.py-name:link { color: #000050 !important; }
268.py-name:visited { color: #000050 !important; }
269.py-number { color: #005000; }
270.py-defname { color: #000060; font-weight: bold; }
271.py-def-name { color: #000060; font-weight: bold; }
272.py-base-class { color: #000060; }
273.py-param { color: #000060; }
274.py-docstring { color: #006030; }
275.py-decorator { color: #804020; }
276/* Use this if you don't want links to names underlined: */
277/*a.py-name { text-decoration: none; }*/
278
279/* Graphs & Diagrams
280 * - These CSS styles are used for graphs & diagrams generated using
281 * Graphviz dot. 'img.graph-without-title' is used for bare
282 * diagrams (to remove the border created by making the image
283 * clickable).
284 */
285img.graph-without-title { border: none; }
286img.graph-with-title { border: 1px solid #000000; }
287span.graph-title { font-weight: bold; }
288span.graph-caption { }
289
290/* General-purpose classes
291 * - 'p.indent-wrapped-lines' defines a paragraph whose first line
292 * is not indented, but whose subsequent lines are.
293 * - The 'nomargin-top' class is used to remove the top margin (e.g.
294 * from lists). The 'nomargin' class is used to remove both the
295 * top and bottom margin (but not the left or right margin --
296 * for lists, that would cause the bullets to disappear.)
297 */
298p.indent-wrapped-lines { padding: 0 0 0 7em; text-indent: -7em;
299 margin: 0; }
300.nomargin-top { margin-top: 0; }
301.nomargin { margin-top: 0; margin-bottom: 0; }
302
303/* HTML Log */
304div.log-block { padding: 0; margin: .5em 0 .5em 0;
305 background: #e8f0f8; color: #000000;
306 border: 1px solid #000000; }
307div.log-error { padding: .1em .3em .1em .3em; margin: 4px;
308 background: #ffb0b0; color: #000000;
309 border: 1px solid #000000; }
310div.log-warning { padding: .1em .3em .1em .3em; margin: 4px;
311 background: #ffffb0; color: #000000;
312 border: 1px solid #000000; }
313div.log-info { padding: .1em .3em .1em .3em; margin: 4px;
314 background: #b0ffb0; color: #000000;
315 border: 1px solid #000000; }
316h2.log-hdr { background: #70b0ff; color: #000000;
317 margin: 0; padding: 0em 0.5em 0em 0.5em;
318 border-bottom: 1px solid #000000; font-size: 110%; }
319p.log { font-weight: bold; margin: .5em 0 .5em 0; }
320tr.opt-changed { color: #000000; font-weight: bold; }
321tr.opt-default { color: #606060; }
322pre.log { margin: 0; padding: 0; padding-left: 1em; }
0323
=== removed file 'doc/html/epydoc.css'
--- doc/html/epydoc.css 2009-12-26 20:49:38 +0000
+++ doc/html/epydoc.css 1970-01-01 00:00:00 +0000
@@ -1,312 +0,0 @@
1
2
3/* Epydoc CSS Stylesheet
4 *
5 * This stylesheet can be used to customize the appearance of epydoc's
6 * HTML output.
7 *
8 */
9
10/* Default Colors & Styles
11 * - Set the default foreground & background color with 'body'; and
12 * link colors with 'a:link' and 'a:visited'.
13 * - Use bold for decision list terms.
14 * - The heading styles defined here are used for headings *within*
15 * docstring descriptions. All headings used by epydoc itself use
16 * either class='epydoc' or class='toc' (CSS styles for both
17 * defined below).
18 */
19body { background: #ffffff; color: #000000; }
20a:link { color: #0000ff; }
21a:visited { color: #204080; }
22dt { font-weight: bold; }
23h1 { font-size: +140%; font-style: italic;
24 font-weight: bold; }
25h2 { font-size: +125%; font-style: italic;
26 font-weight: bold; }
27h3 { font-size: +110%; font-style: italic;
28 font-weight: normal; }
29code { font-size: 100%; }
30
31/* Page Header & Footer
32 * - The standard page header consists of a navigation bar (with
33 * pointers to standard pages such as 'home' and 'trees'); a
34 * breadcrumbs list, which can be used to navigate to containing
35 * classes or modules; options links, to show/hide private
36 * variables and to show/hide frames; and a page title (using
37 * <h1>). The page title may be followed by a link to the
38 * corresponding source code (using 'span.codelink').
39 * - The footer consists of a navigation bar, a timestamp, and a
40 * pointer to epydoc's homepage.
41 */
42h1.epydoc { margin: 0; font-size: +140%; font-weight: bold; }
43h2.epydoc { font-size: +130%; font-weight: bold; }
44h3.epydoc { font-size: +115%; font-weight: bold; }
45td h3.epydoc { font-size: +115%; font-weight: bold;
46 margin-bottom: 0; }
47table.navbar { background: #a0c0ff; color: #000000;
48 border: 2px groove #c0d0d0; }
49table.navbar table { color: #000000; }
50th.navbar-select { background: #70b0ff;
51 color: #000000; }
52table.navbar a { text-decoration: none; }
53table.navbar a:link { color: #0000ff; }
54table.navbar a:visited { color: #204080; }
55span.breadcrumbs { font-size: 85%; font-weight: bold; }
56span.options { font-size: 70%; }
57span.codelink { font-size: 85%; }
58td.footer { font-size: 85%; }
59
60/* Table Headers
61 * - Each summary table and details section begins with a 'header'
62 * row. This row contains a section title (marked by
63 * 'span.table-header') as well as a show/hide private link
64 * (marked by 'span.options', defined above).
65 * - Summary tables that contain user-defined groups mark those
66 * groups using 'group header' rows.
67 */
68td.table-header { background: #70b0ff; color: #000000;
69 border: 1px solid #608090; }
70td.table-header table { color: #000000; }
71td.table-header table a:link { color: #0000ff; }
72td.table-header table a:visited { color: #204080; }
73span.table-header { font-size: 120%; font-weight: bold; }
74th.group-header { background: #c0e0f8; color: #000000;
75 text-align: left; font-style: italic;
76 font-size: 115%;
77 border: 1px solid #608090; }
78
79/* Summary Tables (functions, variables, etc)
80 * - Each object is described by a single row of the table with
81 * two cells. The left cell gives the object's type, and is
82 * marked with 'code.summary-type'. The right cell gives the
83 * object's name and a summary description.
84 * - CSS styles for the table's header and group headers are
85 * defined above, under 'Table Headers'
86 */
87table.summary { border-collapse: collapse;
88 background: #e8f0f8; color: #000000;
89 border: 1px solid #608090;
90 margin-bottom: 0.5em; }
91td.summary { border: 1px solid #608090; }
92code.summary-type { font-size: 85%; }
93table.summary a:link { color: #0000ff; }
94table.summary a:visited { color: #204080; }
95
96
97/* Details Tables (functions, variables, etc)
98 * - Each object is described in its own div.
99 * - A single-row summary table w/ table-header is used as
100 * a header for each details section (CSS style for table-header
101 * is defined above, under 'Table Headers').
102 */
103table.details { border-collapse: collapse;
104 background: #e8f0f8; color: #000000;
105 border: 1px solid #608090;
106 margin: .2em 0 0 0; }
107table.details table { color: #000000; }
108table.details a:link { color: #0000ff; }
109table.details a:visited { color: #204080; }
110
111/* Fields */
112dl.fields { margin-left: 2em; margin-top: 1em;
113 margin-bottom: 1em; }
114dl.fields dd ul { margin-left: 0em; padding-left: 0em; }
115div.fields { margin-left: 2em; }
116div.fields p { margin-bottom: 0.5em; }
117
118/* Index tables (identifier index, term index, etc)
119 * - link-index is used for indices containing lists of links
120 * (namely, the identifier index & term index).
121 * - index-where is used in link indices for the text indicating
122 * the container/source for each link.
123 * - metadata-index is used for indices containing metadata
124 * extracted from fields (namely, the bug index & todo index).
125 */
126table.link-index { border-collapse: collapse;
127 background: #e8f0f8; color: #000000;
128 border: 1px solid #608090; }
129td.link-index { border-width: 0px; }
130table.link-index a:link { color: #0000ff; }
131table.link-index a:visited { color: #204080; }
132span.index-where { font-size: 70%; }
133table.metadata-index { border-collapse: collapse;
134 background: #e8f0f8; color: #000000;
135 border: 1px solid #608090;
136 margin: .2em 0 0 0; }
137td.metadata-index { border-width: 1px; border-style: solid; }
138table.metadata-index a:link { color: #0000ff; }
139table.metadata-index a:visited { color: #204080; }
140
141/* Function signatures
142 * - sig* is used for the signature in the details section.
143 * - .summary-sig* is used for the signature in the summary
144 * table, and when listing property accessor functions.
145 * */
146.sig-name { color: #006080; }
147.sig-arg { color: #008060; }
148.sig-default { color: #602000; }
149.summary-sig { font-family: monospace; }
150.summary-sig-name { color: #006080; font-weight: bold; }
151table.summary a.summary-sig-name:link
152 { color: #006080; font-weight: bold; }
153table.summary a.summary-sig-name:visited
154 { color: #006080; font-weight: bold; }
155.summary-sig-arg { color: #006040; }
156.summary-sig-default { color: #501800; }
157
158/* To render variables, classes etc. like functions */
159table.summary .summary-name { color: #006080; font-weight: bold;
160 font-family: monospace; }
161table.summary
162 a.summary-name:link { color: #006080; font-weight: bold;
163 font-family: monospace; }
164table.summary
165 a.summary-name:visited { color: #006080; font-weight: bold;
166 font-family: monospace; }
167
168/* Variable values
169 * - In the 'variable details' sections, each varaible's value is
170 * listed in a 'pre.variable' box. The width of this box is
171 * restricted to 80 chars; if the value's repr is longer than
172 * this it will be wrapped, using a backslash marked with
173 * class 'variable-linewrap'. If the value's repr is longer
174 * than 3 lines, the rest will be ellided; and an ellipsis
175 * marker ('...' marked with 'variable-ellipsis') will be used.
176 * - If the value is a string, its quote marks will be marked
177 * with 'variable-quote'.
178 * - If the variable is a regexp, it is syntax-highlighted using
179 * the re* CSS classes.
180 */
181pre.variable { padding: .5em; margin: 0;
182 background: #dce4ec; color: #000000;
183 border: 1px solid #708890; }
184.variable-linewrap { color: #604000; font-weight: bold; }
185.variable-ellipsis { color: #604000; font-weight: bold; }
186.variable-quote { color: #604000; font-weight: bold; }
187.variable-group { color: #008000; font-weight: bold; }
188.variable-op { color: #604000; font-weight: bold; }
189.variable-string { color: #006030; }
190.variable-unknown { color: #a00000; font-weight: bold; }
191.re { color: #000000; }
192.re-char { color: #006030; }
193.re-op { color: #600000; }
194.re-group { color: #003060; }
195.re-ref { color: #404040; }
196
197/* Base tree
198 * - Used by class pages to display the base class hierarchy.
199 */
200pre.base-tree { font-size: 80%; margin: 0; }
201
202/* Frames-based table of contents headers
203 * - Consists of two frames: one for selecting modules; and
204 * the other listing the contents of the selected module.
205 * - h1.toc is used for each frame's heading
206 * - h2.toc is used for subheadings within each frame.
207 */
208h1.toc { text-align: center; font-size: 105%;
209 margin: 0; font-weight: bold;
210 padding: 0; }
211h2.toc { font-size: 100%; font-weight: bold;
212 margin: 0.5em 0 0 -0.3em; }
213
214/* Syntax Highlighting for Source Code
215 * - doctest examples are displayed in a 'pre.py-doctest' block.
216 * If the example is in a details table entry, then it will use
217 * the colors specified by the 'table pre.py-doctest' line.
218 * - Source code listings are displayed in a 'pre.py-src' block.
219 * Each line is marked with 'span.py-line' (used to draw a line
220 * down the left margin, separating the code from the line
221 * numbers). Line numbers are displayed with 'span.py-lineno'.
222 * The expand/collapse block toggle button is displayed with
223 * 'a.py-toggle' (Note: the CSS style for 'a.py-toggle' should not
224 * modify the font size of the text.)
225 * - If a source code page is opened with an anchor, then the
226 * corresponding code block will be highlighted. The code
227 * block's header is highlighted with 'py-highlight-hdr'; and
228 * the code block's body is highlighted with 'py-highlight'.
229 * - The remaining py-* classes are used to perform syntax
230 * highlighting (py-string for string literals, py-name for names,
231 * etc.)
232 */
233pre.py-doctest { padding: .5em; margin: 1em;
234 background: #e8f0f8; color: #000000;
235 border: 1px solid #708890; }
236table pre.py-doctest { background: #dce4ec;
237 color: #000000; }
238pre.py-src { border: 2px solid #000000;
239 background: #f0f0f0; color: #000000; }
240.py-line { border-left: 2px solid #000000;
241 margin-left: .2em; padding-left: .4em; }
242.py-lineno { font-style: italic; font-size: 90%;
243 padding-left: .5em; }
244a.py-toggle { text-decoration: none; }
245div.py-highlight-hdr { border-top: 2px solid #000000;
246 border-bottom: 2px solid #000000;
247 background: #d8e8e8; }
248div.py-highlight { border-bottom: 2px solid #000000;
249 background: #d0e0e0; }
250.py-prompt { color: #005050; font-weight: bold;}
251.py-more { color: #005050; font-weight: bold;}
252.py-string { color: #006030; }
253.py-comment { color: #003060; }
254.py-keyword { color: #600000; }
255.py-output { color: #404040; }
256.py-name { color: #000050; }
257.py-name:link { color: #000050 !important; }
258.py-name:visited { color: #000050 !important; }
259.py-number { color: #005000; }
260.py-defname { color: #000060; font-weight: bold; }
261.py-def-name { color: #000060; font-weight: bold; }
262.py-base-class { color: #000060; }
263.py-param { color: #000060; }
264.py-docstring { color: #006030; }
265.py-decorator { color: #804020; }
266/* Use this if you don't want links to names underlined: */
267/*a.py-name { text-decoration: none; }*/
268
269/* Graphs & Diagrams
270 * - These CSS styles are used for graphs & diagrams generated using
271 * Graphviz dot. 'img.graph-without-title' is used for bare
272 * diagrams (to remove the border created by making the image
273 * clickable).
274 */
275img.graph-without-title { border: none; }
276img.graph-with-title { border: 1px solid #000000; }
277span.graph-title { font-weight: bold; }
278span.graph-caption { }
279
280/* General-purpose classes
281 * - 'p.indent-wrapped-lines' defines a paragraph whose first line
282 * is not indented, but whose subsequent lines are.
283 * - The 'nomargin-top' class is used to remove the top margin (e.g.
284 * from lists). The 'nomargin' class is used to remove both the
285 * top and bottom margin (but not the left or right margin --
286 * for lists, that would cause the bullets to disappear.)
287 */
288p.indent-wrapped-lines { padding: 0 0 0 7em; text-indent: -7em;
289 margin: 0; }
290.nomargin-top { margin-top: 0; }
291.nomargin { margin-top: 0; margin-bottom: 0; }
292
293/* HTML Log */
294div.log-block { padding: 0; margin: .5em 0 .5em 0;
295 background: #e8f0f8; color: #000000;
296 border: 1px solid #000000; }
297div.log-error { padding: .1em .3em .1em .3em; margin: 4px;
298 background: #ffb0b0; color: #000000;
299 border: 1px solid #000000; }
300div.log-warning { padding: .1em .3em .1em .3em; margin: 4px;
301 background: #ffffb0; color: #000000;
302 border: 1px solid #000000; }
303div.log-info { padding: .1em .3em .1em .3em; margin: 4px;
304 background: #b0ffb0; color: #000000;
305 border: 1px solid #000000; }
306h2.log-hdr { background: #70b0ff; color: #000000;
307 margin: 0; padding: 0em 0.5em 0em 0.5em;
308 border-bottom: 1px solid #000000; font-size: 110%; }
309p.log { font-weight: bold; margin: .5em 0 .5em 0; }
310tr.opt-changed { color: #000000; font-weight: bold; }
311tr.opt-default { color: #606060; }
312pre.log { margin: 0; padding: 0; padding-left: 1em; }
3130
=== added file 'doc/html/epydoc.js'
--- doc/html/epydoc.js 1970-01-01 00:00:00 +0000
+++ doc/html/epydoc.js 2009-12-26 22:06:14 +0000
@@ -0,0 +1,293 @@
1function toggle_private() {
2 // Search for any private/public links on this page. Store
3 // their old text in "cmd," so we will know what action to
4 // take; and change their text to the opposite action.
5 var cmd = "?";
6 var elts = document.getElementsByTagName("a");
7 for(var i=0; i<elts.length; i++) {
8 if (elts[i].className == "privatelink") {
9 cmd = elts[i].innerHTML;
10 elts[i].innerHTML = ((cmd && cmd.substr(0,4)=="show")?
11 "hide&nbsp;private":"show&nbsp;private");
12 }
13 }
14 // Update all DIVs containing private objects.
15 var elts = document.getElementsByTagName("div");
16 for(var i=0; i<elts.length; i++) {
17 if (elts[i].className == "private") {
18 elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"none":"block");
19 }
20 else if (elts[i].className == "public") {
21 elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"block":"none");
22 }
23 }
24 // Update all table rows containing private objects. Note, we
25 // use "" instead of "block" becaue IE & firefox disagree on what
26 // this should be (block vs table-row), and "" just gives the
27 // default for both browsers.
28 var elts = document.getElementsByTagName("tr");
29 for(var i=0; i<elts.length; i++) {
30 if (elts[i].className == "private") {
31 elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"none":"");
32 }
33 }
34 // Update all list items containing private objects.
35 var elts = document.getElementsByTagName("li");
36 for(var i=0; i<elts.length; i++) {
37 if (elts[i].className == "private") {
38 elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?
39 "none":"");
40 }
41 }
42 // Update all list items containing private objects.
43 var elts = document.getElementsByTagName("ul");
44 for(var i=0; i<elts.length; i++) {
45 if (elts[i].className == "private") {
46 elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"none":"block");
47 }
48 }
49 // Set a cookie to remember the current option.
50 document.cookie = "EpydocPrivate="+cmd;
51 }
52function show_private() {
53 var elts = document.getElementsByTagName("a");
54 for(var i=0; i<elts.length; i++) {
55 if (elts[i].className == "privatelink") {
56 cmd = elts[i].innerHTML;
57 if (cmd && cmd.substr(0,4)=="show")
58 toggle_private();
59 }
60 }
61 }
62function getCookie(name) {
63 var dc = document.cookie;
64 var prefix = name + "=";
65 var begin = dc.indexOf("; " + prefix);
66 if (begin == -1) {
67 begin = dc.indexOf(prefix);
68 if (begin != 0) return null;
69 } else
70 { begin += 2; }
71 var end = document.cookie.indexOf(";", begin);
72 if (end == -1)
73 { end = dc.length; }
74 return unescape(dc.substring(begin + prefix.length, end));
75 }
76function setFrame(url1, url2) {
77 parent.frames[1].location.href = url1;
78 parent.frames[2].location.href = url2;
79 }
80function checkCookie() {
81 var cmd=getCookie("EpydocPrivate");
82 if (cmd && cmd.substr(0,4)!="show" && location.href.indexOf("#_") < 0)
83 toggle_private();
84 }
85function toggleCallGraph(id) {
86 var elt = document.getElementById(id);
87 if (elt.style.display == "none")
88 elt.style.display = "block";
89 else
90 elt.style.display = "none";
91 }
92function expand(id) {
93 var elt = document.getElementById(id+"-expanded");
94 if (elt) elt.style.display = "block";
95 var elt = document.getElementById(id+"-expanded-linenums");
96 if (elt) elt.style.display = "block";
97 var elt = document.getElementById(id+"-collapsed");
98 if (elt) { elt.innerHTML = ""; elt.style.display = "none"; }
99 var elt = document.getElementById(id+"-collapsed-linenums");
100 if (elt) { elt.innerHTML = ""; elt.style.display = "none"; }
101 var elt = document.getElementById(id+"-toggle");
102 if (elt) { elt.innerHTML = "-"; }
103}
104
105function collapse(id) {
106 var elt = document.getElementById(id+"-expanded");
107 if (elt) elt.style.display = "none";
108 var elt = document.getElementById(id+"-expanded-linenums");
109 if (elt) elt.style.display = "none";
110 var elt = document.getElementById(id+"-collapsed-linenums");
111 if (elt) { elt.innerHTML = "<br />"; elt.style.display="block"; }
112 var elt = document.getElementById(id+"-toggle");
113 if (elt) { elt.innerHTML = "+"; }
114 var elt = document.getElementById(id+"-collapsed");
115 if (elt) {
116 elt.style.display = "block";
117
118 var indent = elt.getAttribute("indent");
119 var pad = elt.getAttribute("pad");
120 var s = "<tt class='py-lineno'>";
121 for (var i=0; i<pad.length; i++) { s += "&nbsp;" }
122 s += "</tt>";
123 s += "&nbsp;&nbsp;<tt class='py-line'>";
124 for (var i=0; i<indent.length; i++) { s += "&nbsp;" }
125 s += "<a href='#' onclick='expand(\"" + id;
126 s += "\");return false'>...</a></tt><br />";
127 elt.innerHTML = s;
128 }
129}
130
131function toggle(id) {
132 elt = document.getElementById(id+"-toggle");
133 if (elt.innerHTML == "-")
134 collapse(id);
135 else
136 expand(id);
137 return false;
138}
139
140function highlight(id) {
141 var elt = document.getElementById(id+"-def");
142 if (elt) elt.className = "py-highlight-hdr";
143 var elt = document.getElementById(id+"-expanded");
144 if (elt) elt.className = "py-highlight";
145 var elt = document.getElementById(id+"-collapsed");
146 if (elt) elt.className = "py-highlight";
147}
148
149function num_lines(s) {
150 var n = 1;
151 var pos = s.indexOf("\n");
152 while ( pos > 0) {
153 n += 1;
154 pos = s.indexOf("\n", pos+1);
155 }
156 return n;
157}
158
159// Collapse all blocks that mave more than `min_lines` lines.
160function collapse_all(min_lines) {
161 var elts = document.getElementsByTagName("div");
162 for (var i=0; i<elts.length; i++) {
163 var elt = elts[i];
164 var split = elt.id.indexOf("-");
165 if (split > 0)
166 if (elt.id.substring(split, elt.id.length) == "-expanded")
167 if (num_lines(elt.innerHTML) > min_lines)
168 collapse(elt.id.substring(0, split));
169 }
170}
171
172function expandto(href) {
173 var start = href.indexOf("#")+1;
174 if (start != 0 && start != href.length) {
175 if (href.substring(start, href.length) != "-") {
176 collapse_all(4);
177 pos = href.indexOf(".", start);
178 while (pos != -1) {
179 var id = href.substring(start, pos);
180 expand(id);
181 pos = href.indexOf(".", pos+1);
182 }
183 var id = href.substring(start, href.length);
184 expand(id);
185 highlight(id);
186 }
187 }
188}
189
190function kill_doclink(id) {
191 var parent = document.getElementById(id);
192 parent.removeChild(parent.childNodes.item(0));
193}
194function auto_kill_doclink(ev) {
195 if (!ev) var ev = window.event;
196 if (!this.contains(ev.toElement)) {
197 var parent = document.getElementById(this.parentID);
198 parent.removeChild(parent.childNodes.item(0));
199 }
200}
201
202function doclink(id, name, targets_id) {
203 var elt = document.getElementById(id);
204
205 // If we already opened the box, then destroy it.
206 // (This case should never occur, but leave it in just in case.)
207 if (elt.childNodes.length > 1) {
208 elt.removeChild(elt.childNodes.item(0));
209 }
210 else {
211 // The outer box: relative + inline positioning.
212 var box1 = document.createElement("div");
213 box1.style.position = "relative";
214 box1.style.display = "inline";
215 box1.style.top = 0;
216 box1.style.left = 0;
217
218 // A shadow for fun
219 var shadow = document.createElement("div");
220 shadow.style.position = "absolute";
221 shadow.style.left = "-1.3em";
222 shadow.style.top = "-1.3em";
223 shadow.style.background = "#404040";
224
225 // The inner box: absolute positioning.
226 var box2 = document.createElement("div");
227 box2.style.position = "relative";
228 box2.style.border = "1px solid #a0a0a0";
229 box2.style.left = "-.2em";
230 box2.style.top = "-.2em";
231 box2.style.background = "white";
232 box2.style.padding = ".3em .4em .3em .4em";
233 box2.style.fontStyle = "normal";
234 box2.onmouseout=auto_kill_doclink;
235 box2.parentID = id;
236
237 // Get the targets
238 var targets_elt = document.getElementById(targets_id);
239 var targets = targets_elt.getAttribute("targets");
240 var links = "";
241 target_list = targets.split(",");
242 for (var i=0; i<target_list.length; i++) {
243 var target = target_list[i].split("=");
244 links += "<li><a href='" + target[1] +
245 "' style='text-decoration:none'>" +
246 target[0] + "</a></li>";
247 }
248
249 // Put it all together.
250 elt.insertBefore(box1, elt.childNodes.item(0));
251 //box1.appendChild(box2);
252 box1.appendChild(shadow);
253 shadow.appendChild(box2);
254 box2.innerHTML =
255 "Which <b>"+name+"</b> do you want to see documentation for?" +
256 "<ul style='margin-bottom: 0;'>" +
257 links +
258 "<li><a href='#' style='text-decoration:none' " +
259 "onclick='kill_doclink(\""+id+"\");return false;'>"+
260 "<i>None of the above</i></a></li></ul>";
261 }
262 return false;
263}
264
265function get_anchor() {
266 var href = location.href;
267 var start = href.indexOf("#")+1;
268 if ((start != 0) && (start != href.length))
269 return href.substring(start, href.length);
270 }
271function redirect_url(dottedName) {
272 // Scan through each element of the "pages" list, and check
273 // if "name" matches with any of them.
274 for (var i=0; i<pages.length; i++) {
275
276 // Each page has the form "<pagename>-m" or "<pagename>-c";
277 // extract the <pagename> portion & compare it to dottedName.
278 var pagename = pages[i].substring(0, pages[i].length-2);
279 if (pagename == dottedName.substring(0,pagename.length)) {
280
281 // We've found a page that matches `dottedName`;
282 // construct its URL, using leftover `dottedName`
283 // content to form an anchor.
284 var pagetype = pages[i].charAt(pages[i].length-1);
285 var url = pagename + ((pagetype=="m")?"-module.html":
286 "-class.html");
287 if (dottedName.length > pagename.length)
288 url += "#" + dottedName.substring(pagename.length+1,
289 dottedName.length);
290 return url;
291 }
292 }
293 }
0294
=== removed file 'doc/html/epydoc.js'
--- doc/html/epydoc.js 2009-12-26 20:49:38 +0000
+++ doc/html/epydoc.js 1970-01-01 00:00:00 +0000
@@ -1,280 +0,0 @@
1function toggle_private() {
2 // Search for any private/public links on this page. Store
3 // their old text in "cmd," so we will know what action to
4 // take; and change their text to the opposite action.
5 var cmd = "?";
6 var elts = document.getElementsByTagName("a");
7 for(var i=0; i<elts.length; i++) {
8 if (elts[i].className == "privatelink") {
9 cmd = elts[i].innerHTML;
10 elts[i].innerHTML = ((cmd && cmd.substr(0,4)=="show")?
11 "hide&nbsp;private":"show&nbsp;private");
12 }
13 }
14 // Update all DIVs containing private objects.
15 var elts = document.getElementsByTagName("div");
16 for(var i=0; i<elts.length; i++) {
17 if (elts[i].className == "private") {
18 elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"none":"block");
19 }
20 }
21 // Update all table rowss containing private objects. Note, we
22 // use "" instead of "block" becaue IE & firefox disagree on what
23 // this should be (block vs table-row), and "" just gives the
24 // default for both browsers.
25 var elts = document.getElementsByTagName("tr");
26 for(var i=0; i<elts.length; i++) {
27 if (elts[i].className == "private") {
28 elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"none":"");
29 }
30 }
31 // Update all list items containing private objects.
32 var elts = document.getElementsByTagName("li");
33 for(var i=0; i<elts.length; i++) {
34 if (elts[i].className == "private") {
35 elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?
36 "none":"list-item");
37 }
38 }
39 // Update all list items containing private objects.
40 var elts = document.getElementsByTagName("ul");
41 for(var i=0; i<elts.length; i++) {
42 if (elts[i].className == "private") {
43 elts[i].style.display = ((cmd && cmd.substr(0,4)=="hide")?"none":"block");
44 }
45 }
46 // Set a cookie to remember the current option.
47 document.cookie = "EpydocPrivate="+cmd;
48 }
49function getCookie(name) {
50 var dc = document.cookie;
51 var prefix = name + "=";
52 var begin = dc.indexOf("; " + prefix);
53 if (begin == -1) {
54 begin = dc.indexOf(prefix);
55 if (begin != 0) return null;
56 } else
57 { begin += 2; }
58 var end = document.cookie.indexOf(";", begin);
59 if (end == -1)
60 { end = dc.length; }
61 return unescape(dc.substring(begin + prefix.length, end));
62 }
63function setFrame(url1, url2) {
64 parent.frames[1].location.href = url1;
65 parent.frames[2].location.href = url2;
66 }
67function checkCookie() {
68 var cmd=getCookie("EpydocPrivate");
69 if (cmd && cmd.substr(0,4)!="show" && location.href.indexOf("#_") < 0)
70 toggle_private();
71 }
72function toggleCallGraph(id) {
73 var elt = document.getElementById(id);
74 if (elt.style.display == "none")
75 elt.style.display = "block";
76 else
77 elt.style.display = "none";
78 }
79function expand(id) {
80 var elt = document.getElementById(id+"-expanded");
81 if (elt) elt.style.display = "block";
82 var elt = document.getElementById(id+"-expanded-linenums");
83 if (elt) elt.style.display = "block";
84 var elt = document.getElementById(id+"-collapsed");
85 if (elt) { elt.innerHTML = ""; elt.style.display = "none"; }
86 var elt = document.getElementById(id+"-collapsed-linenums");
87 if (elt) { elt.innerHTML = ""; elt.style.display = "none"; }
88 var elt = document.getElementById(id+"-toggle");
89 if (elt) { elt.innerHTML = "-"; }
90}
91
92function collapse(id) {
93 var elt = document.getElementById(id+"-expanded");
94 if (elt) elt.style.display = "none";
95 var elt = document.getElementById(id+"-expanded-linenums");
96 if (elt) elt.style.display = "none";
97 var elt = document.getElementById(id+"-collapsed-linenums");
98 if (elt) { elt.innerHTML = "<br/>"; elt.style.display="block"; }
99 var elt = document.getElementById(id+"-toggle");
100 if (elt) { elt.innerHTML = "+"; }
101 var elt = document.getElementById(id+"-collapsed");
102 if (elt) {
103 elt.style.display = "block";
104
105 var indent = elt.getAttribute("indent");
106 var pad = elt.getAttribute("pad");
107 var s = "<tt class='py-lineno'>";
108 for (var i=0; i<pad.length; i++) { s += "&nbsp;" }
109 s += "</tt>";
110 s += "&nbsp;&nbsp;<tt class='py-line'>";
111 for (var i=0; i<indent.length; i++) { s += "&nbsp;" }
112 s += "<a href='#' onclick='expand(\"" + id;
113 s += "\");return false'>...</a></tt><br />";
114 elt.innerHTML = s;
115 }
116}
117
118function toggle(id) {
119 elt = document.getElementById(id+"-toggle");
120 if (elt.innerHTML == "-")
121 collapse(id);
122 else
123 expand(id);
124 return false;
125}
126
127function highlight(id) {
128 var elt = document.getElementById(id+"-def");
129 if (elt) elt.className = "py-highlight-hdr";
130 var elt = document.getElementById(id+"-expanded");
131 if (elt) elt.className = "py-highlight";
132 var elt = document.getElementById(id+"-collapsed");
133 if (elt) elt.className = "py-highlight";
134}
135
136function num_lines(s) {
137 var n = 1;
138 var pos = s.indexOf("\n");
139 while ( pos > 0) {
140 n += 1;
141 pos = s.indexOf("\n", pos+1);
142 }
143 return n;
144}
145
146// Collapse all blocks that mave more than `min_lines` lines.
147function collapse_all(min_lines) {
148 var elts = document.getElementsByTagName("div");
149 for (var i=0; i<elts.length; i++) {
150 var elt = elts[i];
151 var split = elt.id.indexOf("-");
152 if (split > 0)
153 if (elt.id.substring(split, elt.id.length) == "-expanded")
154 if (num_lines(elt.innerHTML) > min_lines)
155 collapse(elt.id.substring(0, split));
156 }
157}
158
159function expandto(href) {
160 var start = href.indexOf("#")+1;
161 if (start != 0 && start != href.length) {
162 if (href.substring(start, href.length) != "-") {
163 collapse_all(4);
164 pos = href.indexOf(".", start);
165 while (pos != -1) {
166 var id = href.substring(start, pos);
167 expand(id);
168 pos = href.indexOf(".", pos+1);
169 }
170 var id = href.substring(start, href.length);
171 expand(id);
172 highlight(id);
173 }
174 }
175}
176
177function kill_doclink(id) {
178 var parent = document.getElementById(id);
179 parent.removeChild(parent.childNodes.item(0));
180}
181function auto_kill_doclink(ev) {
182 if (!ev) var ev = window.event;
183 if (!this.contains(ev.toElement)) {
184 var parent = document.getElementById(this.parentID);
185 parent.removeChild(parent.childNodes.item(0));
186 }
187}
188
189function doclink(id, name, targets_id) {
190 var elt = document.getElementById(id);
191
192 // If we already opened the box, then destroy it.
193 // (This case should never occur, but leave it in just in case.)
194 if (elt.childNodes.length > 1) {
195 elt.removeChild(elt.childNodes.item(0));
196 }
197 else {
198 // The outer box: relative + inline positioning.
199 var box1 = document.createElement("div");
200 box1.style.position = "relative";
201 box1.style.display = "inline";
202 box1.style.top = 0;
203 box1.style.left = 0;
204
205 // A shadow for fun
206 var shadow = document.createElement("div");
207 shadow.style.position = "absolute";
208 shadow.style.left = "-1.3em";
209 shadow.style.top = "-1.3em";
210 shadow.style.background = "#404040";
211
212 // The inner box: absolute positioning.
213 var box2 = document.createElement("div");
214 box2.style.position = "relative";
215 box2.style.border = "1px solid #a0a0a0";
216 box2.style.left = "-.2em";
217 box2.style.top = "-.2em";
218 box2.style.background = "white";
219 box2.style.padding = ".3em .4em .3em .4em";
220 box2.style.fontStyle = "normal";
221 box2.onmouseout=auto_kill_doclink;
222 box2.parentID = id;
223
224 // Get the targets
225 var targets_elt = document.getElementById(targets_id);
226 var targets = targets_elt.getAttribute("targets");
227 var links = "";
228 target_list = targets.split(",");
229 for (var i=0; i<target_list.length; i++) {
230 var target = target_list[i].split("=");
231 links += "<li><a href='" + target[1] +
232 "' style='text-decoration:none'>" +
233 target[0] + "</a></li>";
234 }
235
236 // Put it all together.
237 elt.insertBefore(box1, elt.childNodes.item(0));
238 //box1.appendChild(box2);
239 box1.appendChild(shadow);
240 shadow.appendChild(box2);
241 box2.innerHTML =
242 "Which <b>"+name+"</b> do you want to see documentation for?" +
243 "<ul style='margin-bottom: 0;'>" +
244 links +
245 "<li><a href='#' style='text-decoration:none' " +
246 "onclick='kill_doclink(\""+id+"\");return false;'>"+
247 "<i>None of the above</i></a></li></ul>";
248 }
249 return false;
250}
251
252function get_anchor() {
253 var href = location.href;
254 var start = href.indexOf("#")+1;
255 if ((start != 0) && (start != href.length))
256 return href.substring(start, href.length);
257 }
258function redirect_url(dottedName) {
259 // Scan through each element of the "pages" list, and check
260 // if "name" matches with any of them.
261 for (var i=0; i<pages.length; i++) {
262
263 // Each page has the form "<pagename>-m" or "<pagename>-c";
264 // extract the <pagename> portion & compare it to dottedName.
265 var pagename = pages[i].substring(0, pages[i].length-2);
266 if (pagename == dottedName.substring(0,pagename.length)) {
267
268 // We've found a page that matches `dottedName`;
269 // construct its URL, using leftover `dottedName`
270 // content to form an anchor.
271 var pagetype = pages[i].charAt(pages[i].length-1);
272 var url = pagename + ((pagetype=="m")?"-module.html":
273 "-class.html");
274 if (dottedName.length > pagename.length)
275 url += "#" + dottedName.substring(pagename.length+1,
276 dottedName.length);
277 return url;
278 }
279 }
280 }
2810
=== added file 'doc/html/frames.html'
--- doc/html/frames.html 1970-01-01 00:00:00 +0000
+++ doc/html/frames.html 2009-12-26 22:06:14 +0000
@@ -0,0 +1,17 @@
1<?xml version="1.0" encoding="iso-8859-1"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
3 "DTD/xhtml1-frameset.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title> API Documentation </title>
7</head>
8<frameset cols="20%,80%">
9 <frameset rows="30%,70%">
10 <frame src="toc.html" name="moduleListFrame"
11 id="moduleListFrame" />
12 <frame src="toc-everything.html" name="moduleFrame"
13 id="moduleFrame" />
14 </frameset>
15 <frame src="scriptutil-module.html" name="mainFrame" id="mainFrame" />
16</frameset>
17</html>
018
=== removed file 'doc/html/frames.html'
--- doc/html/frames.html 2009-12-26 20:49:38 +0000
+++ doc/html/frames.html 1970-01-01 00:00:00 +0000
@@ -1,17 +0,0 @@
1<?xml version="1.0" encoding="iso-8859-1"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
3 "DTD/xhtml1-frameset.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title> Module scriptutil </title>
7</head>
8<frameset cols="20%,80%">
9 <frameset rows="30%,70%">
10 <frame src="toc.html" name="moduleListFrame"
11 id="moduleListFrame" />
12 <frame src="toc-everything.html" name="moduleFrame"
13 id="moduleFrame" />
14 </frameset>
15 <frame src="scriptutil-module.html" name="mainFrame" id="mainFrame" />
16</frameset>
17</html>
180
=== added file 'doc/html/help.html'
--- doc/html/help.html 1970-01-01 00:00:00 +0000
+++ doc/html/help.html 2009-12-26 22:06:14 +0000
@@ -0,0 +1,278 @@
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title>Help</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12 alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
16 <tr valign="middle">
17 <!-- Home link -->
18 <th>&nbsp;&nbsp;&nbsp;<a
19 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21 <!-- Tree link -->
22 <th>&nbsp;&nbsp;&nbsp;<a
23 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25 <!-- Index link -->
26 <th>&nbsp;&nbsp;&nbsp;<a
27 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29 <!-- Help link -->
30 <th bgcolor="#70b0f0" class="navbar-select"
31 >&nbsp;&nbsp;&nbsp;Help&nbsp;&nbsp;&nbsp;</th>
32
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="https://launchpad.net/py-script">Project Homepage</a></th>
38 </tr></table></th>
39 </tr>
40</table>
41<table width="100%" cellpadding="0" cellspacing="0">
42 <tr valign="top">
43 <td width="100%">&nbsp;</td>
44 <td>
45 <table cellpadding="0" cellspacing="0">
46 <!-- hide/show private -->
47 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
48 onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
49 <tr><td align="right"><span class="options"
50 >[<a href="frames.html" target="_top">frames</a
51 >]&nbsp;|&nbsp;<a href="help.html"
52 target="_top">no&nbsp;frames</a>]</span></td></tr>
53 </table>
54 </td>
55 </tr>
56</table>
57
58<h1 class="epydoc"> API Documentation </h1>
59
60<p> This document contains the API (Application Programming Interface)
61documentation for this project. Documentation for the Python
62objects defined by the project is divided into separate pages for each
63package, module, and class. The API documentation also includes two
64pages containing information about the project as a whole: a trees
65page, and an index page. </p>
66
67<h2> Object Documentation </h2>
68
69 <p>Each <strong>Package Documentation</strong> page contains: </p>
70 <ul>
71 <li> A description of the package. </li>
72 <li> A list of the modules and sub-packages contained by the
73 package. </li>
74 <li> A summary of the classes defined by the package. </li>
75 <li> A summary of the functions defined by the package. </li>
76 <li> A summary of the variables defined by the package. </li>
77 <li> A detailed description of each function defined by the
78 package. </li>
79 <li> A detailed description of each variable defined by the
80 package. </li>
81 </ul>
82
83 <p>Each <strong>Module Documentation</strong> page contains:</p>
84 <ul>
85 <li> A description of the module. </li>
86 <li> A summary of the classes defined by the module. </li>
87 <li> A summary of the functions defined by the module. </li>
88 <li> A summary of the variables defined by the module. </li>
89 <li> A detailed description of each function defined by the
90 module. </li>
91 <li> A detailed description of each variable defined by the
92 module. </li>
93 </ul>
94
95 <p>Each <strong>Class Documentation</strong> page contains: </p>
96 <ul>
97 <li> A class inheritance diagram. </li>
98 <li> A list of known subclasses. </li>
99 <li> A description of the class. </li>
100 <li> A summary of the methods defined by the class. </li>
101 <li> A summary of the instance variables defined by the class. </li>
102 <li> A summary of the class (static) variables defined by the
103 class. </li>
104 <li> A detailed description of each method defined by the
105 class. </li>
106 <li> A detailed description of each instance variable defined by the
107 class. </li>
108 <li> A detailed description of each class (static) variable defined
109 by the class. </li>
110 </ul>
111
112<h2> Project Documentation </h2>
113
114 <p> The <strong>Trees</strong> page contains the module and class hierarchies: </p>
115 <ul>
116 <li> The <em>module hierarchy</em> lists every package and module, with
117 modules grouped into packages. At the top level, and within each
118 package, modules and sub-packages are listed alphabetically. </li>
119 <li> The <em>class hierarchy</em> lists every class, grouped by base
120 class. If a class has more than one base class, then it will be
121 listed under each base class. At the top level, and under each base
122 class, classes are listed alphabetically. </li>
123 </ul>
124
125 <p> The <strong>Index</strong> page contains indices of terms and
126 identifiers: </p>
127 <ul>
128 <li> The <em>term index</em> lists every term indexed by any object's
129 documentation. For each term, the index provides links to each
130 place where the term is indexed. </li>
131 <li> The <em>identifier index</em> lists the (short) name of every package,
132 module, class, method, function, variable, and parameter. For each
133 identifier, the index provides a short description, and a link to
134 its documentation. </li>
135 </ul>
136
137<h2> The Table of Contents </h2>
138
139<p> The table of contents occupies the two frames on the left side of
140the window. The upper-left frame displays the <em>project
141contents</em>, and the lower-left frame displays the <em>module
142contents</em>: </p>
143
144<table class="help summary" border="1" cellspacing="0" cellpadding="3">
145 <tr style="height: 30%">
146 <td align="center" style="font-size: small">
147 Project<br />Contents<hr />...</td>
148 <td align="center" style="font-size: small" rowspan="2" width="70%">
149 API<br />Documentation<br />Frame<br /><br /><br />
150 </td>
151 </tr>
152 <tr>
153 <td align="center" style="font-size: small">
154 Module<br />Contents<hr />&nbsp;<br />...<br />&nbsp;
155 </td>
156 </tr>
157</table><br />
158
159<p> The <strong>project contents frame</strong> contains a list of all packages
160and modules that are defined by the project. Clicking on an entry
161will display its contents in the module contents frame. Clicking on a
162special entry, labeled "Everything," will display the contents of
163the entire project. </p>
164
165<p> The <strong>module contents frame</strong> contains a list of every
166submodule, class, type, exception, function, and variable defined by a
167module or package. Clicking on an entry will display its
168documentation in the API documentation frame. Clicking on the name of
169the module, at the top of the frame, will display the documentation
170for the module itself. </p>
171
172<p> The "<strong>frames</strong>" and "<strong>no frames</strong>" buttons below the top
173navigation bar can be used to control whether the table of contents is
174displayed or not. </p>
175
176<h2> The Navigation Bar </h2>
177
178<p> A navigation bar is located at the top and bottom of every page.
179It indicates what type of page you are currently viewing, and allows
180you to go to related pages. The following table describes the labels
181on the navigation bar. Note that not some labels (such as
182[Parent]) are not displayed on all pages. </p>
183
184<table class="summary" border="1" cellspacing="0" cellpadding="3" width="100%">
185<tr class="summary">
186 <th>Label</th>
187 <th>Highlighted when...</th>
188 <th>Links to...</th>
189</tr>
190 <tr><td valign="top"><strong>[Parent]</strong></td>
191 <td valign="top"><em>(never highlighted)</em></td>
192 <td valign="top"> the parent of the current package </td></tr>
193 <tr><td valign="top"><strong>[Package]</strong></td>
194 <td valign="top">viewing a package</td>
195 <td valign="top">the package containing the current object
196 </td></tr>
197 <tr><td valign="top"><strong>[Module]</strong></td>
198 <td valign="top">viewing a module</td>
199 <td valign="top">the module containing the current object
200 </td></tr>
201 <tr><td valign="top"><strong>[Class]</strong></td>
202 <td valign="top">viewing a class </td>
203 <td valign="top">the class containing the current object</td></tr>
204 <tr><td valign="top"><strong>[Trees]</strong></td>
205 <td valign="top">viewing the trees page</td>
206 <td valign="top"> the trees page </td></tr>
207 <tr><td valign="top"><strong>[Index]</strong></td>
208 <td valign="top">viewing the index page</td>
209 <td valign="top"> the index page </td></tr>
210 <tr><td valign="top"><strong>[Help]</strong></td>
211 <td valign="top">viewing the help page</td>
212 <td valign="top"> the help page </td></tr>
213</table>
214
215<p> The "<strong>show private</strong>" and "<strong>hide private</strong>" buttons below
216the top navigation bar can be used to control whether documentation
217for private objects is displayed. Private objects are usually defined
218as objects whose (short) names begin with a single underscore, but do
219not end with an underscore. For example, "<code>_x</code>",
220"<code>__pprint</code>", and "<code>epydoc.epytext._tokenize</code>"
221are private objects; but "<code>re.sub</code>",
222"<code>__init__</code>", and "<code>type_</code>" are not. However,
223if a module defines the "<code>__all__</code>" variable, then its
224contents are used to decide which objects are private. </p>
225
226<p> A timestamp below the bottom navigation bar indicates when each
227page was last updated. </p>
228<!-- ==================== NAVIGATION BAR ==================== -->
229<table class="navbar" border="0" width="100%" cellpadding="0"
230 bgcolor="#a0c0ff" cellspacing="0">
231 <tr valign="middle">
232 <!-- Home link -->
233 <th>&nbsp;&nbsp;&nbsp;<a
234 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
235
236 <!-- Tree link -->
237 <th>&nbsp;&nbsp;&nbsp;<a
238 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
239
240 <!-- Index link -->
241 <th>&nbsp;&nbsp;&nbsp;<a
242 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
243
244 <!-- Help link -->
245 <th bgcolor="#70b0f0" class="navbar-select"
246 >&nbsp;&nbsp;&nbsp;Help&nbsp;&nbsp;&nbsp;</th>
247
248 <!-- Project homepage -->
249 <th class="navbar" align="right" width="100%">
250 <table border="0" cellpadding="0" cellspacing="0">
251 <tr><th class="navbar" align="center"
252 ><a class="navbar" target="_top" href="https://launchpad.net/py-script">Project Homepage</a></th>
253 </tr></table></th>
254 </tr>
255</table>
256<table border="0" cellpadding="0" cellspacing="0" width="100%%">
257 <tr>
258 <td align="left" class="footer">
259 Generated by Epydoc 3.0.1 on Sat Dec 26 23:01:34 2009
260 </td>
261 <td align="right" class="footer">
262 <a target="mainFrame" href="http://epydoc.sourceforge.net"
263 >http://epydoc.sourceforge.net</a>
264 </td>
265 </tr>
266</table>
267
268<script type="text/javascript">
269 <!--
270 // Private objects are initially displayed (because if
271 // javascript is turned off then we want them to be
272 // visible); but by default, we want to hide them. So hide
273 // them unless we have a cookie that says to show them.
274 checkCookie();
275 // -->
276</script>
277</body>
278</html>
0279
=== removed file 'doc/html/help.html'
--- doc/html/help.html 2009-12-26 20:49:38 +0000
+++ doc/html/help.html 1970-01-01 00:00:00 +0000
@@ -1,278 +0,0 @@
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title>Help</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12 alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
16 <tr valign="middle">
17 <!-- Home link -->
18 <th>&nbsp;&nbsp;&nbsp;<a
19 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21 <!-- Tree link -->
22 <th>&nbsp;&nbsp;&nbsp;<a
23 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25 <!-- Index link -->
26 <th>&nbsp;&nbsp;&nbsp;<a
27 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29 <!-- Help link -->
30 <th bgcolor="#70b0f0" class="navbar-select"
31 >&nbsp;&nbsp;&nbsp;Help&nbsp;&nbsp;&nbsp;</th>
32
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="http://hrnjad.net/src/scriptutil">Module scriptutil</a></th>
38 </tr></table></th>
39 </tr>
40</table>
41<table width="100%" cellpadding="0" cellspacing="0">
42 <tr valign="top">
43 <td width="100%">&nbsp;</td>
44 <td>
45 <table cellpadding="0" cellspacing="0">
46 <!-- hide/show private -->
47 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
48 onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
49 <tr><td align="right"><span class="options"
50 >[<a href="frames.html" target="_top">frames</a
51 >]&nbsp;|&nbsp;<a href="help.html"
52 target="_top">no&nbsp;frames</a>]</span></td></tr>
53 </table>
54 </td>
55 </tr>
56</table>
57
58<h1 class="epydoc"> API Documentation </h1>
59
60<p> This document contains the API (Application Programming Interface)
61documentation for Module scriptutil. Documentation for the Python
62objects defined by the project is divided into separate pages for each
63package, module, and class. The API documentation also includes two
64pages containing information about the project as a whole: a trees
65page, and an index page. </p>
66
67<h2> Object Documentation </h2>
68
69 <p>Each <strong>Package Documentation</strong> page contains: </p>
70 <ul>
71 <li> A description of the package. </li>
72 <li> A list of the modules and sub-packages contained by the
73 package. </li>
74 <li> A summary of the classes defined by the package. </li>
75 <li> A summary of the functions defined by the package. </li>
76 <li> A summary of the variables defined by the package. </li>
77 <li> A detailed description of each function defined by the
78 package. </li>
79 <li> A detailed description of each variable defined by the
80 package. </li>
81 </ul>
82
83 <p>Each <strong>Module Documentation</strong> page contains:</p>
84 <ul>
85 <li> A description of the module. </li>
86 <li> A summary of the classes defined by the module. </li>
87 <li> A summary of the functions defined by the module. </li>
88 <li> A summary of the variables defined by the module. </li>
89 <li> A detailed description of each function defined by the
90 module. </li>
91 <li> A detailed description of each variable defined by the
92 module. </li>
93 </ul>
94
95 <p>Each <strong>Class Documentation</strong> page contains: </p>
96 <ul>
97 <li> A class inheritance diagram. </li>
98 <li> A list of known subclasses. </li>
99 <li> A description of the class. </li>
100 <li> A summary of the methods defined by the class. </li>
101 <li> A summary of the instance variables defined by the class. </li>
102 <li> A summary of the class (static) variables defined by the
103 class. </li>
104 <li> A detailed description of each method defined by the
105 class. </li>
106 <li> A detailed description of each instance variable defined by the
107 class. </li>
108 <li> A detailed description of each class (static) variable defined
109 by the class. </li>
110 </ul>
111
112<h2> Project Documentation </h2>
113
114 <p> The <strong>Trees</strong> page contains the module and class hierarchies: </p>
115 <ul>
116 <li> The <em>module hierarchy</em> lists every package and module, with
117 modules grouped into packages. At the top level, and within each
118 package, modules and sub-packages are listed alphabetically. </li>
119 <li> The <em>class hierarchy</em> lists every class, grouped by base
120 class. If a class has more than one base class, then it will be
121 listed under each base class. At the top level, and under each base
122 class, classes are listed alphabetically. </li>
123 </ul>
124
125 <p> The <strong>Index</strong> page contains indices of terms and
126 identifiers: </p>
127 <ul>
128 <li> The <em>term index</em> lists every term indexed by any object's
129 documentation. For each term, the index provides links to each
130 place where the term is indexed. </li>
131 <li> The <em>identifier index</em> lists the (short) name of every package,
132 module, class, method, function, variable, and parameter. For each
133 identifier, the index provides a short description, and a link to
134 its documentation. </li>
135 </ul>
136
137<h2> The Table of Contents </h2>
138
139<p> The table of contents occupies the two frames on the left side of
140the window. The upper-left frame displays the <em>project
141contents</em>, and the lower-left frame displays the <em>module
142contents</em>: </p>
143
144<table class="help summary" border="1" cellspacing="0" cellpadding="3">
145 <tr style="height: 30%">
146 <td align="center" style="font-size: small">
147 Project<br />Contents<hr />...</td>
148 <td align="center" style="font-size: small" rowspan="2" width="70%">
149 API<br />Documentation<br />Frame<br /><br /><br />
150 </td>
151 </tr>
152 <tr>
153 <td align="center" style="font-size: small">
154 Module<br />Contents<hr />&nbsp;<br />...<br />&nbsp;
155 </td>
156 </tr>
157</table><br />
158
159<p> The <strong>project contents frame</strong> contains a list of all packages
160and modules that are defined by the project. Clicking on an entry
161will display its contents in the module contents frame. Clicking on a
162special entry, labeled "Everything," will display the contents of
163the entire project. </p>
164
165<p> The <strong>module contents frame</strong> contains a list of every
166submodule, class, type, exception, function, and variable defined by a
167module or package. Clicking on an entry will display its
168documentation in the API documentation frame. Clicking on the name of
169the module, at the top of the frame, will display the documentation
170for the module itself. </p>
171
172<p> The "<strong>frames</strong>" and "<strong>no frames</strong>" buttons below the top
173navigation bar can be used to control whether the table of contents is
174displayed or not. </p>
175
176<h2> The Navigation Bar </h2>
177
178<p> A navigation bar is located at the top and bottom of every page.
179It indicates what type of page you are currently viewing, and allows
180you to go to related pages. The following table describes the labels
181on the navigation bar. Note that not some labels (such as
182[Parent]) are not displayed on all pages. </p>
183
184<table class="summary" border="1" cellspacing="0" cellpadding="3" width="100%">
185<tr class="summary">
186 <th>Label</th>
187 <th>Highlighted when...</th>
188 <th>Links to...</th>
189</tr>
190 <tr><td valign="top"><strong>[Parent]</strong></td>
191 <td valign="top"><em>(never highlighted)</em></td>
192 <td valign="top"> the parent of the current package </td></tr>
193 <tr><td valign="top"><strong>[Package]</strong></td>
194 <td valign="top">viewing a package</td>
195 <td valign="top">the package containing the current object
196 </td></tr>
197 <tr><td valign="top"><strong>[Module]</strong></td>
198 <td valign="top">viewing a module</td>
199 <td valign="top">the module containing the current object
200 </td></tr>
201 <tr><td valign="top"><strong>[Class]</strong></td>
202 <td valign="top">viewing a class </td>
203 <td valign="top">the class containing the current object</td></tr>
204 <tr><td valign="top"><strong>[Trees]</strong></td>
205 <td valign="top">viewing the trees page</td>
206 <td valign="top"> the trees page </td></tr>
207 <tr><td valign="top"><strong>[Index]</strong></td>
208 <td valign="top">viewing the index page</td>
209 <td valign="top"> the index page </td></tr>
210 <tr><td valign="top"><strong>[Help]</strong></td>
211 <td valign="top">viewing the help page</td>
212 <td valign="top"> the help page </td></tr>
213</table>
214
215<p> The "<strong>show private</strong>" and "<strong>hide private</strong>" buttons below
216the top navigation bar can be used to control whether documentation
217for private objects is displayed. Private objects are usually defined
218as objects whose (short) names begin with a single underscore, but do
219not end with an underscore. For example, "<code>_x</code>",
220"<code>__pprint</code>", and "<code>epydoc.epytext._tokenize</code>"
221are private objects; but "<code>re.sub</code>",
222"<code>__init__</code>", and "<code>type_</code>" are not. However,
223if a module defines the "<code>__all__</code>" variable, then its
224contents are used to decide which objects are private. </p>
225
226<p> A timestamp below the bottom navigation bar indicates when each
227page was last updated. </p>
228<!-- ==================== NAVIGATION BAR ==================== -->
229<table class="navbar" border="0" width="100%" cellpadding="0"
230 bgcolor="#a0c0ff" cellspacing="0">
231 <tr valign="middle">
232 <!-- Home link -->
233 <th>&nbsp;&nbsp;&nbsp;<a
234 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
235
236 <!-- Tree link -->
237 <th>&nbsp;&nbsp;&nbsp;<a
238 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
239
240 <!-- Index link -->
241 <th>&nbsp;&nbsp;&nbsp;<a
242 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
243
244 <!-- Help link -->
245 <th bgcolor="#70b0f0" class="navbar-select"
246 >&nbsp;&nbsp;&nbsp;Help&nbsp;&nbsp;&nbsp;</th>
247
248 <!-- Project homepage -->
249 <th class="navbar" align="right" width="100%">
250 <table border="0" cellpadding="0" cellspacing="0">
251 <tr><th class="navbar" align="center"
252 ><a class="navbar" target="_top" href="http://hrnjad.net/src/scriptutil">Module scriptutil</a></th>
253 </tr></table></th>
254 </tr>
255</table>
256<table border="0" cellpadding="0" cellspacing="0" width="100%%">
257 <tr>
258 <td align="left" class="footer">
259 Generated by Epydoc 3.0beta1 on Thu May 22 18:10:51 2008
260 </td>
261 <td align="right" class="footer">
262 <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
263 </td>
264 </tr>
265</table>
266
267<script type="text/javascript">
268 <!--
269 // Private objects are initially displayed (because if
270 // javascript is turned off then we want them to be
271 // visible); but by default, we want to hide them. So hide
272 // them unless we have a cookie that says to show them.
273 checkCookie()
274 // -->
275</script>
276
277</body>
278</html>
2790
=== added file 'doc/html/identifier-index.html'
--- doc/html/identifier-index.html 1970-01-01 00:00:00 +0000
+++ doc/html/identifier-index.html 2009-12-26 22:06:14 +0000
@@ -0,0 +1,217 @@
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title>Identifier Index</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12 alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
16 <tr valign="middle">
17 <!-- Home link -->
18 <th>&nbsp;&nbsp;&nbsp;<a
19 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21 <!-- Tree link -->
22 <th>&nbsp;&nbsp;&nbsp;<a
23 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25 <!-- Index link -->
26 <th bgcolor="#70b0f0" class="navbar-select"
27 >&nbsp;&nbsp;&nbsp;Indices&nbsp;&nbsp;&nbsp;</th>
28
29 <!-- Help link -->
30 <th>&nbsp;&nbsp;&nbsp;<a
31 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="https://launchpad.net/py-script">Project Homepage</a></th>
38 </tr></table></th>
39 </tr>
40</table>
41<table width="100%" cellpadding="0" cellspacing="0">
42 <tr valign="top">
43 <td width="100%">&nbsp;</td>
44 <td>
45 <table cellpadding="0" cellspacing="0">
46 <!-- hide/show private -->
47 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
48 onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
49 <tr><td align="right"><span class="options"
50 >[<a href="frames.html" target="_top">frames</a
51 >]&nbsp;|&nbsp;<a href="identifier-index.html"
52 target="_top">no&nbsp;frames</a>]</span></td></tr>
53 </table>
54 </td>
55 </tr>
56</table>
57<table border="0" width="100%">
58<tr valign="bottom"><td>
59<h1 class="epydoc">Identifier Index</h1>
60</td><td>
61[
62 A
63 B
64 C
65 D
66 E
67 <a href="#F">F</a>
68 <a href="#G">G</a>
69 H
70 I
71 J
72 K
73 L
74 M
75 N
76 O
77 <a href="#P">P</a>
78 Q
79 <a href="#R">R</a>
80 <a href="#S">S</a>
81 T
82 U
83 V
84 W
85 X
86 Y
87 Z
88 <a href="#_">_</a>
89]
90</td></table>
91<table border="0" width="100%">
92<tr valign="top"><td valign="top" width="1%"><h2 class="epydoc"><a name="F">F</a></h2></td>
93<td valign="top">
94<table class="link-index" width="100%" border="1">
95<tr>
96<td width="33%" class="link-index"><a href="scriptutil.find-module.html">find</a><br />
97<span class="index-where">(in&nbsp;<a href="scriptutil-module.html">scriptutil</a>)</span></td>
98<td width="33%" class="link-index"><a href="scriptutil.find-module.html#find">find()</a><br />
99<span class="index-where">(in&nbsp;<a href="scriptutil.find-module.html">scriptutil.find</a>)</span></td>
100<td width="33%" class="link-index">&nbsp;</td>
101</tr>
102<tr><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td></tr>
103</table>
104</td></tr>
105<tr valign="top"><td valign="top" width="1%"><h2 class="epydoc"><a name="G">G</a></h2></td>
106<td valign="top">
107<table class="link-index" width="100%" border="1">
108<tr>
109<td width="33%" class="link-index"><a href="scriptutil.find-module.html#grep">grep()</a><br />
110<span class="index-where">(in&nbsp;<a href="scriptutil.find-module.html">scriptutil.find</a>)</span></td>
111<td width="33%" class="link-index">&nbsp;</td>
112<td width="33%" class="link-index">&nbsp;</td>
113</tr>
114<tr><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td></tr>
115</table>
116</td></tr>
117<tr valign="top"><td valign="top" width="1%"><h2 class="epydoc"><a name="P">P</a></h2></td>
118<td valign="top">
119<table class="link-index" width="100%" border="1">
120<tr>
121<td width="33%" class="link-index"><a href="scriptutil.find-module.html#pprint">pprint()</a><br />
122<span class="index-where">(in&nbsp;<a href="scriptutil.find-module.html">scriptutil.find</a>)</span></td>
123<td width="33%" class="link-index">&nbsp;</td>
124<td width="33%" class="link-index">&nbsp;</td>
125</tr>
126<tr><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td></tr>
127</table>
128</td></tr>
129<tr valign="top"><td valign="top" width="1%"><h2 class="epydoc"><a name="R">R</a></h2></td>
130<td valign="top">
131<table class="link-index" width="100%" border="1">
132<tr>
133<td width="33%" class="link-index"><a href="scriptutil.find-module.html#replace">replace()</a><br />
134<span class="index-where">(in&nbsp;<a href="scriptutil.find-module.html">scriptutil.find</a>)</span></td>
135<td width="33%" class="link-index">&nbsp;</td>
136<td width="33%" class="link-index">&nbsp;</td>
137</tr>
138<tr><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td></tr>
139</table>
140</td></tr>
141<tr valign="top"><td valign="top" width="1%"><h2 class="epydoc"><a name="S">S</a></h2></td>
142<td valign="top">
143<table class="link-index" width="100%" border="1">
144<tr>
145<td width="33%" class="link-index"><a href="scriptutil.find.ScriptError-class.html">ScriptError</a><br />
146<span class="index-where">(in&nbsp;<a href="scriptutil.find-module.html">scriptutil.find</a>)</span></td>
147<td width="33%" class="link-index"><a href="scriptutil-module.html">scriptutil</a></td>
148<td width="33%" class="link-index">&nbsp;</td>
149</tr>
150<tr><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td></tr>
151</table>
152</td></tr>
153<tr valign="top"><td valign="top" width="1%"><h2 class="epydoc"><a name="_">_</a></h2></td>
154<td valign="top">
155<table class="link-index" width="100%" border="1">
156<tr>
157<td width="33%" class="link-index"><a href="scriptutil-module.html#__package__">__package__</a><br />
158<span class="index-where">(in&nbsp;<a href="scriptutil-module.html">scriptutil</a>)</span></td>
159<td width="33%" class="link-index"><a href="scriptutil.find-module.html#__package__">__package__</a><br />
160<span class="index-where">(in&nbsp;<a href="scriptutil.find-module.html">scriptutil.find</a>)</span></td>
161<td width="33%" class="link-index">&nbsp;</td>
162</tr>
163<tr><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td></tr>
164</table>
165</td></tr>
166</table>
167<br /><br /><!-- ==================== NAVIGATION BAR ==================== -->
168<table class="navbar" border="0" width="100%" cellpadding="0"
169 bgcolor="#a0c0ff" cellspacing="0">
170 <tr valign="middle">
171 <!-- Home link -->
172 <th>&nbsp;&nbsp;&nbsp;<a
173 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
174
175 <!-- Tree link -->
176 <th>&nbsp;&nbsp;&nbsp;<a
177 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
178
179 <!-- Index link -->
180 <th bgcolor="#70b0f0" class="navbar-select"
181 >&nbsp;&nbsp;&nbsp;Indices&nbsp;&nbsp;&nbsp;</th>
182
183 <!-- Help link -->
184 <th>&nbsp;&nbsp;&nbsp;<a
185 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
186
187 <!-- Project homepage -->
188 <th class="navbar" align="right" width="100%">
189 <table border="0" cellpadding="0" cellspacing="0">
190 <tr><th class="navbar" align="center"
191 ><a class="navbar" target="_top" href="https://launchpad.net/py-script">Project Homepage</a></th>
192 </tr></table></th>
193 </tr>
194</table>
195<table border="0" cellpadding="0" cellspacing="0" width="100%%">
196 <tr>
197 <td align="left" class="footer">
198 Generated by Epydoc 3.0.1 on Sat Dec 26 23:01:34 2009
199 </td>
200 <td align="right" class="footer">
201 <a target="mainFrame" href="http://epydoc.sourceforge.net"
202 >http://epydoc.sourceforge.net</a>
203 </td>
204 </tr>
205</table>
206
207<script type="text/javascript">
208 <!--
209 // Private objects are initially displayed (because if
210 // javascript is turned off then we want them to be
211 // visible); but by default, we want to hide them. So hide
212 // them unless we have a cookie that says to show them.
213 checkCookie();
214 // -->
215</script>
216</body>
217</html>
0218
=== removed file 'doc/html/identifier-index.html'
--- doc/html/identifier-index.html 2009-12-26 20:49:38 +0000
+++ doc/html/identifier-index.html 1970-01-01 00:00:00 +0000
@@ -1,181 +0,0 @@
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title>Identifier Index</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12 alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
16 <tr valign="middle">
17 <!-- Home link -->
18 <th>&nbsp;&nbsp;&nbsp;<a
19 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21 <!-- Tree link -->
22 <th>&nbsp;&nbsp;&nbsp;<a
23 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25 <!-- Index link -->
26 <th bgcolor="#70b0f0" class="navbar-select"
27 >&nbsp;&nbsp;&nbsp;Indices&nbsp;&nbsp;&nbsp;</th>
28
29 <!-- Help link -->
30 <th>&nbsp;&nbsp;&nbsp;<a
31 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="http://hrnjad.net/src/scriptutil">Module scriptutil</a></th>
38 </tr></table></th>
39 </tr>
40</table>
41<table width="100%" cellpadding="0" cellspacing="0">
42 <tr valign="top">
43 <td width="100%">&nbsp;</td>
44 <td>
45 <table cellpadding="0" cellspacing="0">
46 <!-- hide/show private -->
47 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
48 onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
49 <tr><td align="right"><span class="options"
50 >[<a href="frames.html" target="_top">frames</a
51 >]&nbsp;|&nbsp;<a href="identifier-index.html"
52 target="_top">no&nbsp;frames</a>]</span></td></tr>
53 </table>
54 </td>
55 </tr>
56</table>
57<table border="0" width="100%">
58<tr valign="bottom"><td>
59<h1 class="epydoc">Identifier Index</h1>
60</td><td>
61[
62 A
63 B
64 C
65 D
66 E
67 <a href="#F">F</a>
68 G
69 H
70 I
71 J
72 K
73 L
74 M
75 N
76 O
77 <a href="#P">P</a>
78 Q
79 R
80 <a href="#S">S</a>
81 T
82 U
83 V
84 W
85 X
86 Y
87 Z
88 _
89]
90</td></table>
91<table border="0" width="100%"><tr valign="top">
92<td valign="top" width="1%"><a name="F"><h2 class="epydoc">F</h2></a></td>
93<td valign="top">
94<table class="link-index" width="100%" border="1">
95<tr>
96<td width="33%" class="link-index"><a href="scriptutil-module.html#ffind">ffind()</a><br />
97<span class="index-where">(in&nbsp;<a href="scriptutil-module.html">scriptutil</a>)</font></td>
98<td width="33%" class="link-index"><a href="scriptutil-module.html#ffindgrep">ffindgrep()</a><br />
99<span class="index-where">(in&nbsp;<a href="scriptutil-module.html">scriptutil</a>)</font></td>
100<td width="33%" class="link-index"><a href="scriptutil-module.html#freplace">freplace()</a><br />
101<span class="index-where">(in&nbsp;<a href="scriptutil-module.html">scriptutil</a>)</font></td>
102</tr>
103<tr><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td></tr>
104</table>
105</td></tr>
106<td valign="top" width="1%"><a name="P"><h2 class="epydoc">P</h2></a></td>
107<td valign="top">
108<table class="link-index" width="100%" border="1">
109<tr>
110<td width="33%" class="link-index"><a href="scriptutil-module.html#printr">printr()</a><br />
111<span class="index-where">(in&nbsp;<a href="scriptutil-module.html">scriptutil</a>)</font></td>
112<td width="33%" class="link-index">&nbsp;</td>
113<td width="33%" class="link-index">&nbsp;</td>
114</tr>
115<tr><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td></tr>
116</table>
117</td></tr>
118<td valign="top" width="1%"><a name="S"><h2 class="epydoc">S</h2></a></td>
119<td valign="top">
120<table class="link-index" width="100%" border="1">
121<tr>
122<td width="33%" class="link-index"><a href="scriptutil.ScriptError-class.html">ScriptError</a><br />
123<span class="index-where">(in&nbsp;<a href="scriptutil-module.html">scriptutil</a>)</font></td>
124<td width="33%" class="link-index"><a href="scriptutil-module.html">scriptutil</a></td>
125<td width="33%" class="link-index">&nbsp;</td>
126</tr>
127<tr><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td><td class="link-index">&nbsp;</td></tr>
128</table>
129</td></tr>
130</table>
131</br /><br /><!-- ==================== NAVIGATION BAR ==================== -->
132<table class="navbar" border="0" width="100%" cellpadding="0"
133 bgcolor="#a0c0ff" cellspacing="0">
134 <tr valign="middle">
135 <!-- Home link -->
136 <th>&nbsp;&nbsp;&nbsp;<a
137 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
138
139 <!-- Tree link -->
140 <th>&nbsp;&nbsp;&nbsp;<a
141 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
142
143 <!-- Index link -->
144 <th bgcolor="#70b0f0" class="navbar-select"
145 >&nbsp;&nbsp;&nbsp;Indices&nbsp;&nbsp;&nbsp;</th>
146
147 <!-- Help link -->
148 <th>&nbsp;&nbsp;&nbsp;<a
149 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
150
151 <!-- Project homepage -->
152 <th class="navbar" align="right" width="100%">
153 <table border="0" cellpadding="0" cellspacing="0">
154 <tr><th class="navbar" align="center"
155 ><a class="navbar" target="_top" href="http://hrnjad.net/src/scriptutil">Module scriptutil</a></th>
156 </tr></table></th>
157 </tr>
158</table>
159<table border="0" cellpadding="0" cellspacing="0" width="100%%">
160 <tr>
161 <td align="left" class="footer">
162 Generated by Epydoc 3.0beta1 on Thu May 22 18:10:51 2008
163 </td>
164 <td align="right" class="footer">
165 <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
166 </td>
167 </tr>
168</table>
169
170<script type="text/javascript">
171 <!--
172 // Private objects are initially displayed (because if
173 // javascript is turned off then we want them to be
174 // visible); but by default, we want to hide them. So hide
175 // them unless we have a cookie that says to show them.
176 checkCookie()
177 // -->
178</script>
179
180</body>
181</html>
1820
=== added file 'doc/html/index.html'
--- doc/html/index.html 1970-01-01 00:00:00 +0000
+++ doc/html/index.html 2009-12-26 22:06:14 +0000
@@ -0,0 +1,17 @@
1<?xml version="1.0" encoding="iso-8859-1"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
3 "DTD/xhtml1-frameset.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title> API Documentation </title>
7</head>
8<frameset cols="20%,80%">
9 <frameset rows="30%,70%">
10 <frame src="toc.html" name="moduleListFrame"
11 id="moduleListFrame" />
12 <frame src="toc-everything.html" name="moduleFrame"
13 id="moduleFrame" />
14 </frameset>
15 <frame src="scriptutil-module.html" name="mainFrame" id="mainFrame" />
16</frameset>
17</html>
018
=== removed file 'doc/html/index.html'
--- doc/html/index.html 2009-12-26 20:49:38 +0000
+++ doc/html/index.html 1970-01-01 00:00:00 +0000
@@ -1,17 +0,0 @@
1<?xml version="1.0" encoding="iso-8859-1"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
3 "DTD/xhtml1-frameset.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title> Module scriptutil </title>
7</head>
8<frameset cols="20%,80%">
9 <frameset rows="30%,70%">
10 <frame src="toc.html" name="moduleListFrame"
11 id="moduleListFrame" />
12 <frame src="toc-everything.html" name="moduleFrame"
13 id="moduleFrame" />
14 </frameset>
15 <frame src="scriptutil-module.html" name="mainFrame" id="mainFrame" />
16</frameset>
17</html>
180
=== added file 'doc/html/module-tree.html'
--- doc/html/module-tree.html 1970-01-01 00:00:00 +0000
+++ doc/html/module-tree.html 2009-12-26 22:06:14 +0000
@@ -0,0 +1,119 @@
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title>Module Hierarchy</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12 alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
16 <tr valign="middle">
17 <!-- Home link -->
18 <th>&nbsp;&nbsp;&nbsp;<a
19 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21 <!-- Tree link -->
22 <th bgcolor="#70b0f0" class="navbar-select"
23 >&nbsp;&nbsp;&nbsp;Trees&nbsp;&nbsp;&nbsp;</th>
24
25 <!-- Index link -->
26 <th>&nbsp;&nbsp;&nbsp;<a
27 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29 <!-- Help link -->
30 <th>&nbsp;&nbsp;&nbsp;<a
31 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="https://launchpad.net/py-script">Project Homepage</a></th>
38 </tr></table></th>
39 </tr>
40</table>
41<table width="100%" cellpadding="0" cellspacing="0">
42 <tr valign="top">
43 <td width="100%">&nbsp;</td>
44 <td>
45 <table cellpadding="0" cellspacing="0">
46 <!-- hide/show private -->
47 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
48 onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
49 <tr><td align="right"><span class="options"
50 >[<a href="frames.html" target="_top">frames</a
51 >]&nbsp;|&nbsp;<a href="module-tree.html"
52 target="_top">no&nbsp;frames</a>]</span></td></tr>
53 </table>
54 </td>
55 </tr>
56</table>
57<center><b>
58 [ <a href="module-tree.html">Module Hierarchy</a>
59 | <a href="class-tree.html">Class Hierarchy</a> ]
60</b></center><br />
61<h1 class="epydoc">Module Hierarchy</h1>
62<ul class="nomargin-top">
63 <li> <strong class="uidlink"><a href="scriptutil-module.html">scriptutil</a></strong>
64 <ul>
65 <li> <strong class="uidlink"><a href="scriptutil.find-module.html">scriptutil.find</a></strong>: <em class="summary">Functions commonly used in shell scripting:</em> </li>
66 </ul>
67 </li>
68</ul>
69<!-- ==================== NAVIGATION BAR ==================== -->
70<table class="navbar" border="0" width="100%" cellpadding="0"
71 bgcolor="#a0c0ff" cellspacing="0">
72 <tr valign="middle">
73 <!-- Home link -->
74 <th>&nbsp;&nbsp;&nbsp;<a
75 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
76
77 <!-- Tree link -->
78 <th bgcolor="#70b0f0" class="navbar-select"
79 >&nbsp;&nbsp;&nbsp;Trees&nbsp;&nbsp;&nbsp;</th>
80
81 <!-- Index link -->
82 <th>&nbsp;&nbsp;&nbsp;<a
83 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
84
85 <!-- Help link -->
86 <th>&nbsp;&nbsp;&nbsp;<a
87 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
88
89 <!-- Project homepage -->
90 <th class="navbar" align="right" width="100%">
91 <table border="0" cellpadding="0" cellspacing="0">
92 <tr><th class="navbar" align="center"
93 ><a class="navbar" target="_top" href="https://launchpad.net/py-script">Project Homepage</a></th>
94 </tr></table></th>
95 </tr>
96</table>
97<table border="0" cellpadding="0" cellspacing="0" width="100%%">
98 <tr>
99 <td align="left" class="footer">
100 Generated by Epydoc 3.0.1 on Sat Dec 26 23:01:34 2009
101 </td>
102 <td align="right" class="footer">
103 <a target="mainFrame" href="http://epydoc.sourceforge.net"
104 >http://epydoc.sourceforge.net</a>
105 </td>
106 </tr>
107</table>
108
109<script type="text/javascript">
110 <!--
111 // Private objects are initially displayed (because if
112 // javascript is turned off then we want them to be
113 // visible); but by default, we want to hide them. So hide
114 // them unless we have a cookie that says to show them.
115 checkCookie();
116 // -->
117</script>
118</body>
119</html>
0120
=== removed file 'doc/html/module-tree.html'
--- doc/html/module-tree.html 2009-12-26 20:49:38 +0000
+++ doc/html/module-tree.html 1970-01-01 00:00:00 +0000
@@ -1,115 +0,0 @@
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title>Module Hierarchy</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12 alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
16 <tr valign="middle">
17 <!-- Home link -->
18 <th>&nbsp;&nbsp;&nbsp;<a
19 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21 <!-- Tree link -->
22 <th bgcolor="#70b0f0" class="navbar-select"
23 >&nbsp;&nbsp;&nbsp;Trees&nbsp;&nbsp;&nbsp;</th>
24
25 <!-- Index link -->
26 <th>&nbsp;&nbsp;&nbsp;<a
27 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29 <!-- Help link -->
30 <th>&nbsp;&nbsp;&nbsp;<a
31 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="http://hrnjad.net/src/scriptutil">Module scriptutil</a></th>
38 </tr></table></th>
39 </tr>
40</table>
41<table width="100%" cellpadding="0" cellspacing="0">
42 <tr valign="top">
43 <td width="100%">&nbsp;</td>
44 <td>
45 <table cellpadding="0" cellspacing="0">
46 <!-- hide/show private -->
47 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
48 onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
49 <tr><td align="right"><span class="options"
50 >[<a href="frames.html" target="_top">frames</a
51 >]&nbsp;|&nbsp;<a href="module-tree.html"
52 target="_top">no&nbsp;frames</a>]</span></td></tr>
53 </table>
54 </td>
55 </tr>
56</table>
57<center><b>
58 [ <a href="module-tree.html">Module Hierarchy</a>
59 | <a href="class-tree.html">Class Hierarchy</a> ]
60</b></center><br />
61<h1 class="epydoc">Module Hierarchy</h1>
62<ul class="nomargin-top">
63 <li> <strong class="uidlink"><a href="scriptutil-module.html">scriptutil</a></strong>: <em class="summary">Copyright (c) 2008, Muharem Hrnjadovic</em> </li>
64</ul>
65<!-- ==================== NAVIGATION BAR ==================== -->
66<table class="navbar" border="0" width="100%" cellpadding="0"
67 bgcolor="#a0c0ff" cellspacing="0">
68 <tr valign="middle">
69 <!-- Home link -->
70 <th>&nbsp;&nbsp;&nbsp;<a
71 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
72
73 <!-- Tree link -->
74 <th bgcolor="#70b0f0" class="navbar-select"
75 >&nbsp;&nbsp;&nbsp;Trees&nbsp;&nbsp;&nbsp;</th>
76
77 <!-- Index link -->
78 <th>&nbsp;&nbsp;&nbsp;<a
79 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
80
81 <!-- Help link -->
82 <th>&nbsp;&nbsp;&nbsp;<a
83 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
84
85 <!-- Project homepage -->
86 <th class="navbar" align="right" width="100%">
87 <table border="0" cellpadding="0" cellspacing="0">
88 <tr><th class="navbar" align="center"
89 ><a class="navbar" target="_top" href="http://hrnjad.net/src/scriptutil">Module scriptutil</a></th>
90 </tr></table></th>
91 </tr>
92</table>
93<table border="0" cellpadding="0" cellspacing="0" width="100%%">
94 <tr>
95 <td align="left" class="footer">
96 Generated by Epydoc 3.0beta1 on Thu May 22 18:10:51 2008
97 </td>
98 <td align="right" class="footer">
99 <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
100 </td>
101 </tr>
102</table>
103
104<script type="text/javascript">
105 <!--
106 // Private objects are initially displayed (because if
107 // javascript is turned off then we want them to be
108 // visible); but by default, we want to hide them. So hide
109 // them unless we have a cookie that says to show them.
110 checkCookie()
111 // -->
112</script>
113
114</body>
115</html>
1160
=== added file 'doc/html/redirect.html'
--- doc/html/redirect.html 1970-01-01 00:00:00 +0000
+++ doc/html/redirect.html 2009-12-26 22:06:14 +0000
@@ -0,0 +1,38 @@
1<html><head><title>Epydoc Redirect Page</title>
2<meta http-equiv="cache-control" content="no-cache" />
3<meta http-equiv="expires" content="0" />
4<meta http-equiv="pragma" content="no-cache" />
5 <script type="text/javascript" src="epydoc.js"></script>
6</head>
7<body>
8<script type="text/javascript">
9<!--
10var pages = ["scriptutil.find.ScriptError-c", "scriptutil.find-m", "scriptutil-m"];
11var dottedName = get_anchor();
12if (dottedName) {
13 var target = redirect_url(dottedName);
14 if (target) window.location.replace(target);
15}
16// -->
17</script>
18
19<h3>Epydoc Auto-redirect page</h3>
20
21<p>When javascript is enabled, this page will redirect URLs of
22the form <tt>redirect.html#<i>dotted.name</i></tt> to the
23documentation for the object with the given fully-qualified
24dotted name.</p>
25<p><a id="message"> &nbsp; </a></p>
26
27<script type="text/javascript">
28<!--
29if (dottedName) {
30 var msg = document.getElementById("message");
31 msg.innerHTML = "No documentation found for <tt>"+
32 dottedName+"</tt>";
33}
34// -->
35</script>
36
37</body>
38</html>
039
=== removed file 'doc/html/redirect.html'
--- doc/html/redirect.html 2009-12-26 20:49:38 +0000
+++ doc/html/redirect.html 1970-01-01 00:00:00 +0000
@@ -1,38 +0,0 @@
1<html><head><title>Epydoc Redirect Page</title>
2<meta http-equiv="cache-control" content="no-cache" />
3<meta http-equiv="expires" content="0" />
4<meta http-equiv="pragma" content="no-cache" />
5 <script type="text/javascript" src="epydoc.js"></script>
6</head>
7<body>
8<script type="text/javascript">
9<!--
10var pages = ["scriptutil.ScriptError-c", "scriptutil-m"];
11var dottedName = get_anchor();
12if (dottedName) {
13 var target = redirect_url(dottedName);
14 if (target) window.location.replace(target);
15}
16// -->
17</script>
18
19<h3>Epydoc Auto-redirect page</h3>
20
21<p>When javascript is enabled, this page will redirect URLs of
22the form <tt>redirect.html#<i>dotted.name</i></tt> to the
23documentation for the object with the given fully-qualified
24dotted name.</p>
25<p><a id="message"> &nbsp; </a></p>
26
27<script type="text/javascript">
28<!--
29if (dottedName) {
30 var msg = document.getElementById("message");
31 msg.innerHTML = "No documentation found for <tt>"+
32 dottedName+"</tt>";
33}
34// -->
35</script>
36
37</body>
38</html>
390
=== added file 'doc/html/scriptutil-module.html'
--- doc/html/scriptutil-module.html 1970-01-01 00:00:00 +0000
+++ doc/html/scriptutil-module.html 2009-12-26 22:06:14 +0000
@@ -0,0 +1,162 @@
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title>scriptutil</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12 alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
16 <tr valign="middle">
17 <!-- Home link -->
18 <th bgcolor="#70b0f0" class="navbar-select"
19 >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>
20
21 <!-- Tree link -->
22 <th>&nbsp;&nbsp;&nbsp;<a
23 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25 <!-- Index link -->
26 <th>&nbsp;&nbsp;&nbsp;<a
27 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29 <!-- Help link -->
30 <th>&nbsp;&nbsp;&nbsp;<a
31 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="https://launchpad.net/py-script">Project Homepage</a></th>
38 </tr></table></th>
39 </tr>
40</table>
41<table width="100%" cellpadding="0" cellspacing="0">
42 <tr valign="top">
43 <td width="100%">
44 <span class="breadcrumbs">
45 Package&nbsp;scriptutil
46 </span>
47 </td>
48 <td>
49 <table cellpadding="0" cellspacing="0">
50 <!-- hide/show private -->
51 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
52 onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
53 <tr><td align="right"><span class="options"
54 >[<a href="frames.html" target="_top">frames</a
55 >]&nbsp;|&nbsp;<a href="scriptutil-module.html"
56 target="_top">no&nbsp;frames</a>]</span></td></tr>
57 </table>
58 </td>
59 </tr>
60</table>
61<!-- ==================== PACKAGE DESCRIPTION ==================== -->
62<h1 class="epydoc">Package scriptutil</h1><p class="nomargin-top"><span class="codelink"><a href="scriptutil-pysrc.html">source&nbsp;code</a></span></p>
63<!-- ==================== SUBMODULES ==================== -->
64<a name="section-Submodules"></a>
65<table class="summary" border="1" cellpadding="3"
66 cellspacing="0" width="100%" bgcolor="white">
67<tr bgcolor="#70b0f0" class="table-header">
68 <td colspan="2" class="table-header">
69 <table border="0" cellpadding="0" cellspacing="0" width="100%">
70 <tr valign="top">
71 <td align="left"><span class="table-header">Submodules</span></td>
72 <td align="right" valign="top"
73 ><span class="options">[<a href="#section-Submodules"
74 class="privatelink" onclick="toggle_private();"
75 >hide private</a>]</span></td>
76 </tr>
77 </table>
78 </td>
79</tr>
80 <tr><td class="summary">
81 <ul class="nomargin">
82 <li> <strong class="uidlink"><a href="scriptutil.find-module.html">scriptutil.find</a></strong>: <em class="summary">Functions commonly used in shell scripting:</em> </li>
83 </ul></td></tr>
84</table>
85
86<br />
87<!-- ==================== VARIABLES ==================== -->
88<a name="section-Variables"></a>
89<table class="summary" border="1" cellpadding="3"
90 cellspacing="0" width="100%" bgcolor="white">
91<tr bgcolor="#70b0f0" class="table-header">
92 <td colspan="2" class="table-header">
93 <table border="0" cellpadding="0" cellspacing="0" width="100%">
94 <tr valign="top">
95 <td align="left"><span class="table-header">Variables</span></td>
96 <td align="right" valign="top"
97 ><span class="options">[<a href="#section-Variables"
98 class="privatelink" onclick="toggle_private();"
99 >hide private</a>]</span></td>
100 </tr>
101 </table>
102 </td>
103</tr>
104<tr>
105 <td width="15%" align="right" valign="top" class="summary">
106 <span class="summary-type">&nbsp;</span>
107 </td><td class="summary">
108 <a name="__package__"></a><span class="summary-name">__package__</span> = <code title="None">None</code>
109 </td>
110 </tr>
111</table>
112<!-- ==================== NAVIGATION BAR ==================== -->
113<table class="navbar" border="0" width="100%" cellpadding="0"
114 bgcolor="#a0c0ff" cellspacing="0">
115 <tr valign="middle">
116 <!-- Home link -->
117 <th bgcolor="#70b0f0" class="navbar-select"
118 >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>
119
120 <!-- Tree link -->
121 <th>&nbsp;&nbsp;&nbsp;<a
122 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
123
124 <!-- Index link -->
125 <th>&nbsp;&nbsp;&nbsp;<a
126 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
127
128 <!-- Help link -->
129 <th>&nbsp;&nbsp;&nbsp;<a
130 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
131
132 <!-- Project homepage -->
133 <th class="navbar" align="right" width="100%">
134 <table border="0" cellpadding="0" cellspacing="0">
135 <tr><th class="navbar" align="center"
136 ><a class="navbar" target="_top" href="https://launchpad.net/py-script">Project Homepage</a></th>
137 </tr></table></th>
138 </tr>
139</table>
140<table border="0" cellpadding="0" cellspacing="0" width="100%%">
141 <tr>
142 <td align="left" class="footer">
143 Generated by Epydoc 3.0.1 on Sat Dec 26 23:01:34 2009
144 </td>
145 <td align="right" class="footer">
146 <a target="mainFrame" href="http://epydoc.sourceforge.net"
147 >http://epydoc.sourceforge.net</a>
148 </td>
149 </tr>
150</table>
151
152<script type="text/javascript">
153 <!--
154 // Private objects are initially displayed (because if
155 // javascript is turned off then we want them to be
156 // visible); but by default, we want to hide them. So hide
157 // them unless we have a cookie that says to show them.
158 checkCookie();
159 // -->
160</script>
161</body>
162</html>
0163
=== removed file 'doc/html/scriptutil-module.html'
--- doc/html/scriptutil-module.html 2009-12-26 20:49:38 +0000
+++ doc/html/scriptutil-module.html 1970-01-01 00:00:00 +0000
@@ -1,509 +0,0 @@
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title>scriptutil</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12 alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
16 <tr valign="middle">
17 <!-- Home link -->
18 <th bgcolor="#70b0f0" class="navbar-select"
19 >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>
20
21 <!-- Tree link -->
22 <th>&nbsp;&nbsp;&nbsp;<a
23 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25 <!-- Index link -->
26 <th>&nbsp;&nbsp;&nbsp;<a
27 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29 <!-- Help link -->
30 <th>&nbsp;&nbsp;&nbsp;<a
31 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="http://hrnjad.net/src/scriptutil">Module scriptutil</a></th>
38 </tr></table></th>
39 </tr>
40</table>
41<table width="100%" cellpadding="0" cellspacing="0">
42 <tr valign="top">
43 <td width="100%">
44 <span class="breadcrumbs">
45 Script&nbsp;scriptutil
46 </span>
47 </td>
48 <td>
49 <table cellpadding="0" cellspacing="0">
50 <!-- hide/show private -->
51 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
52 onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
53 <tr><td align="right"><span class="options"
54 >[<a href="frames.html" target="_top">frames</a
55 >]&nbsp;|&nbsp;<a href="scriptutil-module.html"
56 target="_top">no&nbsp;frames</a>]</span></td></tr>
57 </table>
58 </td>
59 </tr>
60</table>
61<!-- ==================== MODULE DESCRIPTION ==================== -->
62<h1 class="epydoc">Module scriptutil</h1><span class="codelink"><a href="scriptutil-pysrc.html">source&nbsp;code</a></span><br /><br />
63<p>Copyright (c) 2008, Muharem Hrnjadovic</p>
64 <p>All rights reserved.</p>
65 Redistribution and use in source and binary forms, with or without
66 modification, are permitted provided that the following conditions are
67 met:
68 <ul>
69 <li>
70 Redistributions of source code must retain the above copyright
71 notice, this list of conditions and the following disclaimer.
72 </li>
73 <li>
74 Redistributions in binary form must reproduce the above copyright
75 notice, this list of conditions and the following disclaimer in the
76 documentation and/or other materials provided with the
77 distribution.
78 </li>
79 <li>
80 Neither the name of Muharem Hrnjadovic nor the names of other
81 contributors may be used to endorse or promote products derived from
82 this software without specific prior written permission.
83 </li>
84 </ul>
85 <p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
86 &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
87 NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
88 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
89 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
90 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
91 TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
92 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
93 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
94 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
95 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>
96
97 <p>---------------------------------------------------------------------------</p>
98 Module providing functions commonly used in shell scripting:
99 <ul>
100 <li>
101 ffind() : finds files in a directory tree
102 </li>
103 <li>
104 ffindgrep(): finds files in a directory tree and matches their
105 content to regular expressions
106 </li>
107 <li>
108 freplace() : in-place search/replace of files in a directory tree
109 with regular expressions
110 </li>
111 <li>
112 printr() : prints the results of the ffind()/ffindgrep()
113 functions
114 </li>
115 </ul>
116 Please see the <a
117 href="http://muharem.wordpress.com/2007/05/20/python-find-files-using-unix-shell-style-wildcards/"
118 target="_top">tutorial</a> as well as the documentation strings of the
119 particular functions for detailed information.<br /><br />
120
121<hr />
122<div class="fields"> <p><strong>Version:</strong>
123 1.1
124 </p>
125</div><!-- ==================== CLASSES ==================== -->
126<a name="section-Classes"></a>
127<table class="summary" border="1" cellpadding="3"
128 cellspacing="0" width="100%" bgcolor="white">
129<tr bgcolor="#70b0f0" class="table-header">
130 <td colspan="2" class="table-header">
131 <table border="0" cellpadding="0" cellspacing="0" width="100%">
132 <tr valign="top">
133 <td align="left"><span class="table-header">Classes</span></td>
134 <td align="right" valign="top"
135 ><span class="options">[<a href="#section-Classes"
136 class="privatelink" onclick="toggle_private();"
137 >hide private</a>]</span></td>
138 </tr>
139 </table>
140 </td>
141</tr>
142<tr>
143 <td width="15%" align="right" valign="top" class="summary">
144 <span class="summary-type">&nbsp;</span>
145 </td><td class="summary">
146 <a href="scriptutil.ScriptError-class.html" class="summary-name">ScriptError</a><br />
147 The exception raised in case of failures.
148 </td>
149 </tr>
150</table>
151<!-- ==================== FUNCTIONS ==================== -->
152<a name="section-Functions"></a>
153<table class="summary" border="1" cellpadding="3"
154 cellspacing="0" width="100%" bgcolor="white">
155<tr bgcolor="#70b0f0" class="table-header">
156 <td colspan="2" class="table-header">
157 <table border="0" cellpadding="0" cellspacing="0" width="100%">
158 <tr valign="top">
159 <td align="left"><span class="table-header">Functions</span></td>
160 <td align="right" valign="top"
161 ><span class="options">[<a href="#section-Functions"
162 class="privatelink" onclick="toggle_private();"
163 >hide private</a>]</span></td>
164 </tr>
165 </table>
166 </td>
167</tr>
168<tr>
169 <td width="15%" align="right" valign="top" class="summary">
170 <span class="summary-type">sequence</span>
171 </td><td class="summary">
172 <table width="100%" cellpadding="0" cellspacing="0" border="0">
173 <tr>
174 <td><span class="summary-sig"><a href="scriptutil-module.html#ffind" class="summary-sig-name">ffind</a>(<span class="summary-sig-arg">path</span>,
175 <span class="summary-sig-arg">shellglobs</span>=<span class="summary-sig-default">None</span>,
176 <span class="summary-sig-arg">namefs</span>=<span class="summary-sig-default">None</span>,
177 <span class="summary-sig-arg">relative</span>=<span class="summary-sig-default">True</span>)</span><br />
178 Find files in the directory tree starting at 'path' (filtered by
179 Unix shell-style wildcards ('shellglobs') and/or the functions in the
180 'namefs' sequence).</td>
181 <td align="right" valign="top">
182 <span class="codelink"><a href="scriptutil-pysrc.html#ffind">source&nbsp;code</a></span>
183
184 </td>
185 </tr>
186 </table>
187
188 </td>
189 </tr>
190<tr>
191 <td width="15%" align="right" valign="top" class="summary">
192 <span class="summary-type">dict</span>
193 </td><td class="summary">
194 <table width="100%" cellpadding="0" cellspacing="0" border="0">
195 <tr>
196 <td><span class="summary-sig"><a href="scriptutil-module.html#ffindgrep" class="summary-sig-name">ffindgrep</a>(<span class="summary-sig-arg">path</span>,
197 <span class="summary-sig-arg">regexl</span>,
198 <span class="summary-sig-arg">shellglobs</span>=<span class="summary-sig-default">None</span>,
199 <span class="summary-sig-arg">namefs</span>=<span class="summary-sig-default">None</span>,
200 <span class="summary-sig-arg">relative</span>=<span class="summary-sig-default">True</span>,
201 <span class="summary-sig-arg">linenums</span>=<span class="summary-sig-default">False</span>)</span><br />
202 Find files in the directory tree starting at 'path' (filtered by
203 Unix shell-style wildcards ('shellglobs') and/or the functions in the
204 'namefs' sequence) and search inside these.</td>
205 <td align="right" valign="top">
206 <span class="codelink"><a href="scriptutil-pysrc.html#ffindgrep">source&nbsp;code</a></span>
207
208 </td>
209 </tr>
210 </table>
211
212 </td>
213 </tr>
214<tr>
215 <td width="15%" align="right" valign="top" class="summary">
216 <span class="summary-type">number</span>
217 </td><td class="summary">
218 <table width="100%" cellpadding="0" cellspacing="0" border="0">
219 <tr>
220 <td><span class="summary-sig"><a href="scriptutil-module.html#freplace" class="summary-sig-name">freplace</a>(<span class="summary-sig-arg">path</span>,
221 <span class="summary-sig-arg">regexl</span>,
222 <span class="summary-sig-arg">shellglobs</span>=<span class="summary-sig-default">None</span>,
223 <span class="summary-sig-arg">namefs</span>=<span class="summary-sig-default">None</span>,
224 <span class="summary-sig-arg">bext</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">.bak</code><code class="variable-quote">'</code></span>)</span><br />
225 Find files in the directory tree starting at 'path' (filtered by
226 Unix shell-style wildcards ('shellglobs') and/or the functions in the
227 'namefs' sequence) and perform an in-place search/replace operation
228 on these.</td>
229 <td align="right" valign="top">
230 <span class="codelink"><a href="scriptutil-pysrc.html#freplace">source&nbsp;code</a></span>
231
232 </td>
233 </tr>
234 </table>
235
236 </td>
237 </tr>
238<tr>
239 <td width="15%" align="right" valign="top" class="summary">
240 <span class="summary-type">&nbsp;</span>
241 </td><td class="summary">
242 <table width="100%" cellpadding="0" cellspacing="0" border="0">
243 <tr>
244 <td><span class="summary-sig"><a href="scriptutil-module.html#printr" class="summary-sig-name">printr</a>(<span class="summary-sig-arg">results</span>)</span><br />
245 Print the results of the ffind()/ffindgrep() functions.</td>
246 <td align="right" valign="top">
247 <span class="codelink"><a href="scriptutil-pysrc.html#printr">source&nbsp;code</a></span>
248
249 </td>
250 </tr>
251 </table>
252
253 </td>
254 </tr>
255</table>
256<!-- ==================== FUNCTION DETAILS ==================== -->
257<a name="section-FunctionDetails"></a>
258<table class="details" border="1" cellpadding="3"
259 cellspacing="0" width="100%" bgcolor="white">
260<tr bgcolor="#70b0f0" class="table-header">
261 <td colspan="2" class="table-header">
262 <table border="0" cellpadding="0" cellspacing="0" width="100%">
263 <tr valign="top">
264 <td align="left"><span class="table-header">Function Details</span></td>
265 <td align="right" valign="top"
266 ><span class="options">[<a href="#section-FunctionDetails"
267 class="privatelink" onclick="toggle_private();"
268 >hide private</a>]</span></td>
269 </tr>
270 </table>
271 </td>
272</tr>
273</table>
274<a name="ffind"></a>
275<div>
276<table class="details" border="1" cellpadding="3"
277 cellspacing="0" width="100%" bgcolor="white">
278<tr><td>
279 <table width="100%" cellpadding="0" cellspacing="0" border="0">
280 <tr valign="top"><td>
281 <h3 class="epydoc"><span class="sig"><span class="sig-name">ffind</span>(<span class="sig-arg">path</span>,
282 <span class="sig-arg">shellglobs</span>=<span class="sig-default">None</span>,
283 <span class="sig-arg">namefs</span>=<span class="sig-default">None</span>,
284 <span class="sig-arg">relative</span>=<span class="sig-default">True</span>)</span>
285 </h3>
286 </td><td align="right" valign="top"
287 ><span class="codelink"><a href="scriptutil-pysrc.html#ffind">source&nbsp;code</a></span>&nbsp;
288 </td>
289 </table>
290
291 <p>Find files in the directory tree starting at 'path' (filtered by Unix
292 shell-style wildcards ('shellglobs') and/or the functions in the 'namefs'
293 sequence).</p>
294 <p>Please not that the shell wildcards work in a cumulative fashion i.e.
295 each of them is applied to the full set of file *names* found.</p>
296 Conversely, all the functions in 'namefs'
297 <ul>
298 <li>
299 only get to see the output of their respective predecessor
300 function in the sequence (with the obvious exception of the first
301 function)
302 </li>
303 <li>
304 are applied to the full file *path* (whereas the shell-style
305 wildcards are only applied to the file *names*)
306 </li>
307 </ul>
308 <dl class="fields">
309 <dt>Parameters:</dt>
310 <dd><ul class="nomargin-top">
311 <li><strong class="pname"><code>path</code></strong> (string) - starting path of the directory tree to be searched</li>
312 <li><strong class="pname"><code>shellglobs</code></strong> (sequence) - an optional sequence of Unix shell-style wildcards that are to
313 be applied to the file *names* found</li>
314 <li><strong class="pname"><code>namefs</code></strong> (sequence) - an optional sequence of functions to be applied to the file
315 *paths* found</li>
316 <li><strong class="pname"><code>relative</code></strong> (bool) - a boolean flag that determines whether absolute or relative
317 paths should be returned</li>
318 </ul></dd>
319 <dt>Returns: sequence</dt>
320 <dd>paths for files found</dd>
321 </dl>
322</td></tr></table>
323</div>
324<a name="ffindgrep"></a>
325<div>
326<table class="details" border="1" cellpadding="3"
327 cellspacing="0" width="100%" bgcolor="white">
328<tr><td>
329 <table width="100%" cellpadding="0" cellspacing="0" border="0">
330 <tr valign="top"><td>
331 <h3 class="epydoc"><span class="sig"><span class="sig-name">ffindgrep</span>(<span class="sig-arg">path</span>,
332 <span class="sig-arg">regexl</span>,
333 <span class="sig-arg">shellglobs</span>=<span class="sig-default">None</span>,
334 <span class="sig-arg">namefs</span>=<span class="sig-default">None</span>,
335 <span class="sig-arg">relative</span>=<span class="sig-default">True</span>,
336 <span class="sig-arg">linenums</span>=<span class="sig-default">False</span>)</span>
337 </h3>
338 </td><td align="right" valign="top"
339 ><span class="codelink"><a href="scriptutil-pysrc.html#ffindgrep">source&nbsp;code</a></span>&nbsp;
340 </td>
341 </table>
342
343 <p>Find files in the directory tree starting at 'path' (filtered by Unix
344 shell-style wildcards ('shellglobs') and/or the functions in the 'namefs'
345 sequence) and search inside these.</p>
346 Additionaly, the file content will be filtered by the regular
347 expressions in the 'regexl' sequence. Each entry in the latter is a
348 <ul>
349 <li>
350 either a string (with the regex definition)
351 </li>
352 <li>
353 or a tuple with arguments accepted by re.compile() (the re.M and
354 re.S flags will have no effect though)
355 </li>
356 </ul>
357 For all the files that pass the file name/content tests the function
358 returns a dictionary where the
359 <ul>
360 <li>
361 key is the file name and the
362 </li>
363 <li>
364 value is a string with lines filtered by 'regexl'
365 </li>
366 </ul>
367 <dl class="fields">
368 <dt>Parameters:</dt>
369 <dd><ul class="nomargin-top">
370 <li><strong class="pname"><code>path</code></strong> (string) - starting path of the directory tree to be searched</li>
371 <li><strong class="pname"><code>shellglobs</code></strong> (sequence) - an optional sequence of Unix shell-style wildcards that are to
372 be applied to the file *names* found</li>
373 <li><strong class="pname"><code>namefs</code></strong> (sequence) - an optional sequence of functions to be applied to the file
374 *paths* found</li>
375 <li><strong class="pname"><code>relative</code></strong> (bool) - a boolean flag that determines whether absolute or relative
376 paths should be returned</li>
377 <li><strong class="pname"><code>linenums</code></strong> (bool) - turns on line numbers for found files (like grep -n)</li>
378 </ul></dd>
379 <dt>Returns: dict</dt>
380 <dd>file name (key) and lines filtered by 'regexl' (value)</dd>
381 </dl>
382</td></tr></table>
383</div>
384<a name="freplace"></a>
385<div>
386<table class="details" border="1" cellpadding="3"
387 cellspacing="0" width="100%" bgcolor="white">
388<tr><td>
389 <table width="100%" cellpadding="0" cellspacing="0" border="0">
390 <tr valign="top"><td>
391 <h3 class="epydoc"><span class="sig"><span class="sig-name">freplace</span>(<span class="sig-arg">path</span>,
392 <span class="sig-arg">regexl</span>,
393 <span class="sig-arg">shellglobs</span>=<span class="sig-default">None</span>,
394 <span class="sig-arg">namefs</span>=<span class="sig-default">None</span>,
395 <span class="sig-arg">bext</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">.bak</code><code class="variable-quote">'</code></span>)</span>
396 </h3>
397 </td><td align="right" valign="top"
398 ><span class="codelink"><a href="scriptutil-pysrc.html#freplace">source&nbsp;code</a></span>&nbsp;
399 </td>
400 </table>
401
402 <p>Find files in the directory tree starting at 'path' (filtered by Unix
403 shell-style wildcards ('shellglobs') and/or the functions in the 'namefs'
404 sequence) and perform an in-place search/replace operation on these.</p>
405 <p>Additionally, an in-place search/replace operation is performed on the
406 content of all the files (whose names passed the tests) using the regular
407 expressions in 'regexl'.</p>
408 Please note: 'regexl' is a sequence of 3-tuples, each having the
409 following elements:
410 <ul>
411 <li>
412 search string (Python regex syntax)
413 </li>
414 <li>
415 replace string (Python regex syntax)
416 </li>
417 <li>
418 regex flags or 'None' (re.compile syntax)
419 </li>
420 </ul>
421 Copies of the modified files are saved in backup files using the
422 extension specified in 'bext'.
423 <dl class="fields">
424 <dt>Parameters:</dt>
425 <dd><ul class="nomargin-top">
426 <li><strong class="pname"><code>path</code></strong> (string) - starting path of the directory tree to be searched</li>
427 <li><strong class="pname"><code>shellglobs</code></strong> (sequence) - an optional sequence of Unix shell-style wildcards that are to
428 be applied to the file *names* found</li>
429 <li><strong class="pname"><code>namefs</code></strong> (sequence) - an optional sequence of functions to be applied to the file
430 *paths* found</li>
431 </ul></dd>
432 <dt>Returns: number</dt>
433 <dd>total number of files modified</dd>
434 </dl>
435</td></tr></table>
436</div>
437<a name="printr"></a>
438<div>
439<table class="details" border="1" cellpadding="3"
440 cellspacing="0" width="100%" bgcolor="white">
441<tr><td>
442 <table width="100%" cellpadding="0" cellspacing="0" border="0">
443 <tr valign="top"><td>
444 <h3 class="epydoc"><span class="sig"><span class="sig-name">printr</span>(<span class="sig-arg">results</span>)</span>
445 </h3>
446 </td><td align="right" valign="top"
447 ><span class="codelink"><a href="scriptutil-pysrc.html#printr">source&nbsp;code</a></span>&nbsp;
448 </td>
449 </table>
450
451 <p>Print the results of the ffind()/ffindgrep() functions.</p>
452 The output format is similar to the one used by the UNIX find
453 utility.
454 <dl class="fields">
455 </dl>
456</td></tr></table>
457</div>
458<br />
459<!-- ==================== NAVIGATION BAR ==================== -->
460<table class="navbar" border="0" width="100%" cellpadding="0"
461 bgcolor="#a0c0ff" cellspacing="0">
462 <tr valign="middle">
463 <!-- Home link -->
464 <th bgcolor="#70b0f0" class="navbar-select"
465 >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>
466
467 <!-- Tree link -->
468 <th>&nbsp;&nbsp;&nbsp;<a
469 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
470
471 <!-- Index link -->
472 <th>&nbsp;&nbsp;&nbsp;<a
473 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
474
475 <!-- Help link -->
476 <th>&nbsp;&nbsp;&nbsp;<a
477 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
478
479 <!-- Project homepage -->
480 <th class="navbar" align="right" width="100%">
481 <table border="0" cellpadding="0" cellspacing="0">
482 <tr><th class="navbar" align="center"
483 ><a class="navbar" target="_top" href="http://hrnjad.net/src/scriptutil">Module scriptutil</a></th>
484 </tr></table></th>
485 </tr>
486</table>
487<table border="0" cellpadding="0" cellspacing="0" width="100%%">
488 <tr>
489 <td align="left" class="footer">
490 Generated by Epydoc 3.0beta1 on Thu May 22 18:10:51 2008
491 </td>
492 <td align="right" class="footer">
493 <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
494 </td>
495 </tr>
496</table>
497
498<script type="text/javascript">
499 <!--
500 // Private objects are initially displayed (because if
501 // javascript is turned off then we want them to be
502 // visible); but by default, we want to hide them. So hide
503 // them unless we have a cookie that says to show them.
504 checkCookie()
505 // -->
506</script>
507
508</body>
509</html>
5100
=== added file 'doc/html/scriptutil-pysrc.html'
--- doc/html/scriptutil-pysrc.html 1970-01-01 00:00:00 +0000
+++ doc/html/scriptutil-pysrc.html 2009-12-26 22:06:14 +0000
@@ -0,0 +1,121 @@
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title>scriptutil</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12 alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
16 <tr valign="middle">
17 <!-- Home link -->
18 <th bgcolor="#70b0f0" class="navbar-select"
19 >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>
20
21 <!-- Tree link -->
22 <th>&nbsp;&nbsp;&nbsp;<a
23 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25 <!-- Index link -->
26 <th>&nbsp;&nbsp;&nbsp;<a
27 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29 <!-- Help link -->
30 <th>&nbsp;&nbsp;&nbsp;<a
31 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="https://launchpad.net/py-script">Project Homepage</a></th>
38 </tr></table></th>
39 </tr>
40</table>
41<table width="100%" cellpadding="0" cellspacing="0">
42 <tr valign="top">
43 <td width="100%">
44 <span class="breadcrumbs">
45 Package&nbsp;scriptutil
46 </span>
47 </td>
48 <td>
49 <table cellpadding="0" cellspacing="0">
50 <!-- hide/show private -->
51 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
52 onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
53 <tr><td align="right"><span class="options"
54 >[<a href="frames.html" target="_top">frames</a
55 >]&nbsp;|&nbsp;<a href="scriptutil-pysrc.html"
56 target="_top">no&nbsp;frames</a>]</span></td></tr>
57 </table>
58 </td>
59 </tr>
60</table>
61<h1 class="epydoc">Source Code for <a href="scriptutil-module.html">Package scriptutil</a></h1>
62<pre class="py-src">
63<a name="L1"></a><tt class="py-lineno">1</tt> <tt class="py-line"> </tt>
64<a name="L2"></a><tt class="py-lineno">2</tt> <tt class="py-line"> </tt><script type="text/javascript">
65<!--
66expandto(location.href);
67// -->
68</script>
69</pre>
70<br />
71<!-- ==================== NAVIGATION BAR ==================== -->
72<table class="navbar" border="0" width="100%" cellpadding="0"
73 bgcolor="#a0c0ff" cellspacing="0">
74 <tr valign="middle">
75 <!-- Home link -->
76 <th bgcolor="#70b0f0" class="navbar-select"
77 >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>
78
79 <!-- Tree link -->
80 <th>&nbsp;&nbsp;&nbsp;<a
81 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
82
83 <!-- Index link -->
84 <th>&nbsp;&nbsp;&nbsp;<a
85 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
86
87 <!-- Help link -->
88 <th>&nbsp;&nbsp;&nbsp;<a
89 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
90
91 <!-- Project homepage -->
92 <th class="navbar" align="right" width="100%">
93 <table border="0" cellpadding="0" cellspacing="0">
94 <tr><th class="navbar" align="center"
95 ><a class="navbar" target="_top" href="https://launchpad.net/py-script">Project Homepage</a></th>
96 </tr></table></th>
97 </tr>
98</table>
99<table border="0" cellpadding="0" cellspacing="0" width="100%%">
100 <tr>
101 <td align="left" class="footer">
102 Generated by Epydoc 3.0.1 on Sat Dec 26 23:01:34 2009
103 </td>
104 <td align="right" class="footer">
105 <a target="mainFrame" href="http://epydoc.sourceforge.net"
106 >http://epydoc.sourceforge.net</a>
107 </td>
108 </tr>
109</table>
110
111<script type="text/javascript">
112 <!--
113 // Private objects are initially displayed (because if
114 // javascript is turned off then we want them to be
115 // visible); but by default, we want to hide them. So hide
116 // them unless we have a cookie that says to show them.
117 checkCookie();
118 // -->
119</script>
120</body>
121</html>
0122
=== removed file 'doc/html/scriptutil-pysrc.html'
--- doc/html/scriptutil-pysrc.html 2009-12-26 20:49:38 +0000
+++ doc/html/scriptutil-pysrc.html 1970-01-01 00:00:00 +0000
@@ -1,388 +0,0 @@
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title>scriptutil</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12 alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
16 <tr valign="middle">
17 <!-- Home link -->
18 <th bgcolor="#70b0f0" class="navbar-select"
19 >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>
20
21 <!-- Tree link -->
22 <th>&nbsp;&nbsp;&nbsp;<a
23 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25 <!-- Index link -->
26 <th>&nbsp;&nbsp;&nbsp;<a
27 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29 <!-- Help link -->
30 <th>&nbsp;&nbsp;&nbsp;<a
31 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="http://hrnjad.net/src/scriptutil">Module scriptutil</a></th>
38 </tr></table></th>
39 </tr>
40</table>
41<table width="100%" cellpadding="0" cellspacing="0">
42 <tr valign="top">
43 <td width="100%">
44 <span class="breadcrumbs">
45 Script&nbsp;scriptutil
46 </span>
47 </td>
48 <td>
49 <table cellpadding="0" cellspacing="0">
50 <!-- hide/show private -->
51 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
52 onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
53 <tr><td align="right"><span class="options"
54 >[<a href="frames.html" target="_top">frames</a
55 >]&nbsp;|&nbsp;<a href="scriptutil-pysrc.html"
56 target="_top">no&nbsp;frames</a>]</span></td></tr>
57 </table>
58 </td>
59 </tr>
60</table>
61<h1 class="epydoc">Source Code for <a href="scriptutil-module.html">Script scriptutil</a></h1>
62<pre class="py-src">
63<a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"><tt class="py-comment">#!/usr/bin/env python</tt> </tt>
64<a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># encoding: utf-8</tt> </tt>
65<a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"><tt class="py-comment"></tt> </tt>
66<a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
67<a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"><tt class="py-docstring">Copyright (c) 2008, Muharem Hrnjadovic</tt> </tt>
68<a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
69<a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"><tt class="py-docstring">All rights reserved.</tt> </tt>
70<a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
71<a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"><tt class="py-docstring">Redistribution and use in source and binary forms, with or without </tt> </tt>
72<a name="L10"></a><tt class="py-lineno"> 10</tt> <tt class="py-line"><tt class="py-docstring">modification, are permitted provided that the following conditions</tt> </tt>
73<a name="L11"></a><tt class="py-lineno"> 11</tt> <tt class="py-line"><tt class="py-docstring">are met:</tt> </tt>
74<a name="L12"></a><tt class="py-lineno"> 12</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
75<a name="L13"></a><tt class="py-lineno"> 13</tt> <tt class="py-line"><tt class="py-docstring"> - Redistributions of source code must retain the above copyright notice,</tt> </tt>
76<a name="L14"></a><tt class="py-lineno"> 14</tt> <tt class="py-line"><tt class="py-docstring"> this list of conditions and the following disclaimer.</tt> </tt>
77<a name="L15"></a><tt class="py-lineno"> 15</tt> <tt class="py-line"><tt class="py-docstring"> - Redistributions in binary form must reproduce the above copyright</tt> </tt>
78<a name="L16"></a><tt class="py-lineno"> 16</tt> <tt class="py-line"><tt class="py-docstring"> notice, this list of conditions and the following disclaimer in the</tt> </tt>
79<a name="L17"></a><tt class="py-lineno"> 17</tt> <tt class="py-line"><tt class="py-docstring"> documentation and/or other materials provided with the distribution.</tt> </tt>
80<a name="L18"></a><tt class="py-lineno"> 18</tt> <tt class="py-line"><tt class="py-docstring"> - Neither the name of Muharem Hrnjadovic nor the names of other</tt> </tt>
81<a name="L19"></a><tt class="py-lineno"> 19</tt> <tt class="py-line"><tt class="py-docstring"> contributors may be used to endorse or promote products derived from</tt> </tt>
82<a name="L20"></a><tt class="py-lineno"> 20</tt> <tt class="py-line"><tt class="py-docstring"> this software without specific prior written permission.</tt> </tt>
83<a name="L21"></a><tt class="py-lineno"> 21</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
84<a name="L22"></a><tt class="py-lineno"> 22</tt> <tt class="py-line"><tt class="py-docstring">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS</tt> </tt>
85<a name="L23"></a><tt class="py-lineno"> 23</tt> <tt class="py-line"><tt class="py-docstring">"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT</tt> </tt>
86<a name="L24"></a><tt class="py-lineno"> 24</tt> <tt class="py-line"><tt class="py-docstring">LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR</tt> </tt>
87<a name="L25"></a><tt class="py-lineno"> 25</tt> <tt class="py-line"><tt class="py-docstring">A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR</tt> </tt>
88<a name="L26"></a><tt class="py-lineno"> 26</tt> <tt class="py-line"><tt class="py-docstring">CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,</tt> </tt>
89<a name="L27"></a><tt class="py-lineno"> 27</tt> <tt class="py-line"><tt class="py-docstring">EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,</tt> </tt>
90<a name="L28"></a><tt class="py-lineno"> 28</tt> <tt class="py-line"><tt class="py-docstring">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR</tt> </tt>
91<a name="L29"></a><tt class="py-lineno"> 29</tt> <tt class="py-line"><tt class="py-docstring">PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF</tt> </tt>
92<a name="L30"></a><tt class="py-lineno"> 30</tt> <tt class="py-line"><tt class="py-docstring">LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING</tt> </tt>
93<a name="L31"></a><tt class="py-lineno"> 31</tt> <tt class="py-line"><tt class="py-docstring">NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</tt> </tt>
94<a name="L32"></a><tt class="py-lineno"> 32</tt> <tt class="py-line"><tt class="py-docstring">SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</tt> </tt>
95<a name="L33"></a><tt class="py-lineno"> 33</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
96<a name="L34"></a><tt class="py-lineno"> 34</tt> <tt class="py-line"><tt class="py-docstring">---------------------------------------------------------------------------</tt> </tt>
97<a name="L35"></a><tt class="py-lineno"> 35</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
98<a name="L36"></a><tt class="py-lineno"> 36</tt> <tt class="py-line"><tt class="py-docstring">Module providing functions commonly used in shell scripting:</tt> </tt>
99<a name="L37"></a><tt class="py-lineno"> 37</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
100<a name="L38"></a><tt class="py-lineno"> 38</tt> <tt class="py-line"><tt class="py-docstring"> - ffind() : finds files in a directory tree</tt> </tt>
101<a name="L39"></a><tt class="py-lineno"> 39</tt> <tt class="py-line"><tt class="py-docstring"> - ffindgrep(): finds files in a directory tree and matches their</tt> </tt>
102<a name="L40"></a><tt class="py-lineno"> 40</tt> <tt class="py-line"><tt class="py-docstring"> content to regular expressions</tt> </tt>
103<a name="L41"></a><tt class="py-lineno"> 41</tt> <tt class="py-line"><tt class="py-docstring"> - freplace() : in-place search/replace of files in a directory tree</tt> </tt>
104<a name="L42"></a><tt class="py-lineno"> 42</tt> <tt class="py-line"><tt class="py-docstring"> with regular expressions</tt> </tt>
105<a name="L43"></a><tt class="py-lineno"> 43</tt> <tt class="py-line"><tt class="py-docstring"> - printr() : prints the results of the ffind()/ffindgrep() functions</tt> </tt>
106<a name="L44"></a><tt class="py-lineno"> 44</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
107<a name="L45"></a><tt class="py-lineno"> 45</tt> <tt class="py-line"><tt class="py-docstring">Please see the U{tutorial &lt;http://muharem.wordpress.com/2007/05/20/python-find-files-using-unix-shell-style-wildcards/&gt;} as well as the documentation strings of the particular functions for detailed information.</tt> </tt>
108<a name="L46"></a><tt class="py-lineno"> 46</tt> <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
109<a name="L47"></a><tt class="py-lineno"> 47</tt> <tt class="py-line"> </tt>
110<a name="L48"></a><tt class="py-lineno"> 48</tt> <tt class="py-line"><tt class="py-name">__version__</tt> <tt class="py-op">=</tt> <tt class="py-string">"1.1"</tt> </tt>
111<a name="L49"></a><tt class="py-lineno"> 49</tt> <tt class="py-line"> </tt>
112<a name="L50"></a><tt class="py-lineno"> 50</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">fnmatch</tt><tt class="py-op">,</tt> <tt class="py-name">itertools</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">,</tt> <tt class="py-name">sys</tt><tt class="py-op">,</tt> <tt class="py-name">re</tt><tt class="py-op">,</tt> <tt class="py-name">types</tt> </tt>
113<a name="L51"></a><tt class="py-lineno"> 51</tt> <tt class="py-line"> </tt>
114<a name="ScriptError"></a><div id="ScriptError-def"><a name="L52"></a><tt class="py-lineno"> 52</tt> <a class="py-toggle" href="#" id="ScriptError-toggle" onclick="return toggle('ScriptError');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="scriptutil.ScriptError-class.html">ScriptError</a><tt class="py-op">(</tt><tt class="py-base-class">Exception</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
115</div><div id="ScriptError-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="ScriptError-expanded"><a name="L53"></a><tt class="py-lineno"> 53</tt> <tt class="py-line"> <tt class="py-docstring">"""The exception raised in case of failures."""</tt> </tt>
116</div><a name="L54"></a><tt class="py-lineno"> 54</tt> <tt class="py-line"> </tt>
117<a name="ffind"></a><div id="ffind-def"><a name="L55"></a><tt class="py-lineno"> 55</tt> <a class="py-toggle" href="#" id="ffind-toggle" onclick="return toggle('ffind');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="scriptutil-module.html#ffind">ffind</a><tt class="py-op">(</tt><tt class="py-param">path</tt><tt class="py-op">,</tt> <tt class="py-param">shellglobs</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">namefs</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">relative</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
118</div><div id="ffind-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="ffind-expanded"><a name="L56"></a><tt class="py-lineno"> 56</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
119<a name="L57"></a><tt class="py-lineno"> 57</tt> <tt class="py-line"><tt class="py-docstring"> Find files in the directory tree starting at 'path' (filtered by</tt> </tt>
120<a name="L58"></a><tt class="py-lineno"> 58</tt> <tt class="py-line"><tt class="py-docstring"> Unix shell-style wildcards ('shellglobs') and/or the functions in</tt> </tt>
121<a name="L59"></a><tt class="py-lineno"> 59</tt> <tt class="py-line"><tt class="py-docstring"> the 'namefs' sequence).</tt> </tt>
122<a name="L60"></a><tt class="py-lineno"> 60</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
123<a name="L61"></a><tt class="py-lineno"> 61</tt> <tt class="py-line"><tt class="py-docstring"> Please not that the shell wildcards work in a cumulative fashion</tt> </tt>
124<a name="L62"></a><tt class="py-lineno"> 62</tt> <tt class="py-line"><tt class="py-docstring"> i.e. each of them is applied to the full set of file *names* found.</tt> </tt>
125<a name="L63"></a><tt class="py-lineno"> 63</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
126<a name="L64"></a><tt class="py-lineno"> 64</tt> <tt class="py-line"><tt class="py-docstring"> Conversely, all the functions in 'namefs'</tt> </tt>
127<a name="L65"></a><tt class="py-lineno"> 65</tt> <tt class="py-line"><tt class="py-docstring"> - only get to see the output of their respective predecessor</tt> </tt>
128<a name="L66"></a><tt class="py-lineno"> 66</tt> <tt class="py-line"><tt class="py-docstring"> function in the sequence (with the obvious exception of the</tt> </tt>
129<a name="L67"></a><tt class="py-lineno"> 67</tt> <tt class="py-line"><tt class="py-docstring"> first function)</tt> </tt>
130<a name="L68"></a><tt class="py-lineno"> 68</tt> <tt class="py-line"><tt class="py-docstring"> - are applied to the full file *path* (whereas the shell-style</tt> </tt>
131<a name="L69"></a><tt class="py-lineno"> 69</tt> <tt class="py-line"><tt class="py-docstring"> wildcards are only applied to the file *names*)</tt> </tt>
132<a name="L70"></a><tt class="py-lineno"> 70</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
133<a name="L71"></a><tt class="py-lineno"> 71</tt> <tt class="py-line"><tt class="py-docstring"> @type path: string</tt> </tt>
134<a name="L72"></a><tt class="py-lineno"> 72</tt> <tt class="py-line"><tt class="py-docstring"> @param path: starting path of the directory tree to be searched</tt> </tt>
135<a name="L73"></a><tt class="py-lineno"> 73</tt> <tt class="py-line"><tt class="py-docstring"> @type shellglobs: sequence</tt> </tt>
136<a name="L74"></a><tt class="py-lineno"> 74</tt> <tt class="py-line"><tt class="py-docstring"> @param shellglobs: an optional sequence of Unix shell-style wildcards</tt> </tt>
137<a name="L75"></a><tt class="py-lineno"> 75</tt> <tt class="py-line"><tt class="py-docstring"> that are to be applied to the file *names* found</tt> </tt>
138<a name="L76"></a><tt class="py-lineno"> 76</tt> <tt class="py-line"><tt class="py-docstring"> @type namefs: sequence</tt> </tt>
139<a name="L77"></a><tt class="py-lineno"> 77</tt> <tt class="py-line"><tt class="py-docstring"> @param namefs: an optional sequence of functions to be applied to the</tt> </tt>
140<a name="L78"></a><tt class="py-lineno"> 78</tt> <tt class="py-line"><tt class="py-docstring"> file *paths* found</tt> </tt>
141<a name="L79"></a><tt class="py-lineno"> 79</tt> <tt class="py-line"><tt class="py-docstring"> @type relative: bool</tt> </tt>
142<a name="L80"></a><tt class="py-lineno"> 80</tt> <tt class="py-line"><tt class="py-docstring"> @param relative: a boolean flag that determines whether absolute or</tt> </tt>
143<a name="L81"></a><tt class="py-lineno"> 81</tt> <tt class="py-line"><tt class="py-docstring"> relative paths should be returned</tt> </tt>
144<a name="L82"></a><tt class="py-lineno"> 82</tt> <tt class="py-line"><tt class="py-docstring"> @rtype: sequence</tt> </tt>
145<a name="L83"></a><tt class="py-lineno"> 83</tt> <tt class="py-line"><tt class="py-docstring"> @return: paths for files found</tt> </tt>
146<a name="L84"></a><tt class="py-lineno"> 84</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
147<a name="L85"></a><tt class="py-lineno"> 85</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">access</tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">R_OK</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
148<a name="L86"></a><tt class="py-lineno"> 86</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt id="link-0" class="py-name" targets="Class scriptutil.ScriptError=scriptutil.ScriptError-class.html"><a title="scriptutil.ScriptError" class="py-name" href="#" onclick="return doclink('link-0', 'ScriptError', 'link-0');">ScriptError</a></tt><tt class="py-op">(</tt><tt class="py-string">"cannot access path: '%s'"</tt> <tt class="py-op">%</tt> <tt class="py-name">path</tt><tt class="py-op">)</tt> </tt>
149<a name="L87"></a><tt class="py-lineno"> 87</tt> <tt class="py-line"> </tt>
150<a name="L88"></a><tt class="py-lineno"> 88</tt> <tt class="py-line"> <tt class="py-name">fileList</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># result list</tt> </tt>
151<a name="L89"></a><tt class="py-lineno"> 89</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
152<a name="L90"></a><tt class="py-lineno"> 90</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">dir</tt><tt class="py-op">,</tt> <tt class="py-name">subdirs</tt><tt class="py-op">,</tt> <tt class="py-name">files</tt> <tt class="py-keyword">in</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">walk</tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
153<a name="L91"></a><tt class="py-lineno"> 91</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">shellglobs</tt><tt class="py-op">:</tt> </tt>
154<a name="L92"></a><tt class="py-lineno"> 92</tt> <tt class="py-line"> <tt class="py-name">matched</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
155<a name="L93"></a><tt class="py-lineno"> 93</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">pattern</tt> <tt class="py-keyword">in</tt> <tt class="py-name">shellglobs</tt><tt class="py-op">:</tt> </tt>
156<a name="L94"></a><tt class="py-lineno"> 94</tt> <tt class="py-line"> <tt class="py-name">filterf</tt> <tt class="py-op">=</tt> <tt class="py-keyword">lambda</tt> <tt class="py-name">s</tt><tt class="py-op">:</tt> <tt class="py-name">fnmatch</tt><tt class="py-op">.</tt><tt class="py-name">fnmatchcase</tt><tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">,</tt> <tt class="py-name">pattern</tt><tt class="py-op">)</tt> </tt>
157<a name="L95"></a><tt class="py-lineno"> 95</tt> <tt class="py-line"> <tt class="py-name">matched</tt><tt class="py-op">.</tt><tt class="py-name">extend</tt><tt class="py-op">(</tt><tt class="py-name">filter</tt><tt class="py-op">(</tt><tt class="py-name">filterf</tt><tt class="py-op">,</tt> <tt class="py-name">files</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
158<a name="L96"></a><tt class="py-lineno"> 96</tt> <tt class="py-line"> <tt class="py-name">fileList</tt><tt class="py-op">.</tt><tt class="py-name">extend</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-string">'%s%s%s'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">dir</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">sep</tt><tt class="py-op">,</tt> <tt class="py-name">f</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">f</tt> <tt class="py-keyword">in</tt> <tt class="py-name">matched</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
159<a name="L97"></a><tt class="py-lineno"> 97</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
160<a name="L98"></a><tt class="py-lineno"> 98</tt> <tt class="py-line"> <tt class="py-name">fileList</tt><tt class="py-op">.</tt><tt class="py-name">extend</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-string">'%s%s%s'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">dir</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">sep</tt><tt class="py-op">,</tt> <tt class="py-name">f</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">f</tt> <tt class="py-keyword">in</tt> <tt class="py-name">files</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
161<a name="L99"></a><tt class="py-lineno"> 99</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">relative</tt><tt class="py-op">:</tt> <tt class="py-name">fileList</tt> <tt class="py-op">=</tt> <tt class="py-name">map</tt><tt class="py-op">(</tt><tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">abspath</tt><tt class="py-op">,</tt> <tt class="py-name">fileList</tt><tt class="py-op">)</tt> </tt>
162<a name="L100"></a><tt class="py-lineno">100</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">namefs</tt><tt class="py-op">:</tt> </tt>
163<a name="L101"></a><tt class="py-lineno">101</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">ff</tt> <tt class="py-keyword">in</tt> <tt class="py-name">namefs</tt><tt class="py-op">:</tt> <tt class="py-name">fileList</tt> <tt class="py-op">=</tt> <tt class="py-name">filter</tt><tt class="py-op">(</tt><tt class="py-name">ff</tt><tt class="py-op">,</tt> <tt class="py-name">fileList</tt><tt class="py-op">)</tt> </tt>
164<a name="L102"></a><tt class="py-lineno">102</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">Exception</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">:</tt> <tt class="py-keyword">raise</tt> <tt id="link-1" class="py-name"><a title="scriptutil.ScriptError" class="py-name" href="#" onclick="return doclink('link-1', 'ScriptError', 'link-0');">ScriptError</a></tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">e</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
165<a name="L103"></a><tt class="py-lineno">103</tt> <tt class="py-line"> <tt class="py-keyword">return</tt><tt class="py-op">(</tt><tt class="py-name">fileList</tt><tt class="py-op">)</tt> </tt>
166</div><a name="L104"></a><tt class="py-lineno">104</tt> <tt class="py-line"> </tt>
167<a name="ffindgrep"></a><div id="ffindgrep-def"><a name="L105"></a><tt class="py-lineno">105</tt> <a class="py-toggle" href="#" id="ffindgrep-toggle" onclick="return toggle('ffindgrep');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="scriptutil-module.html#ffindgrep">ffindgrep</a><tt class="py-op">(</tt><tt class="py-param">path</tt><tt class="py-op">,</tt> <tt class="py-param">regexl</tt><tt class="py-op">,</tt> <tt class="py-param">shellglobs</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">namefs</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> </tt>
168<a name="L106"></a><tt class="py-lineno">106</tt> <tt class="py-line"> <tt class="py-param">relative</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt> <tt class="py-param">linenums</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
169</div><div id="ffindgrep-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="ffindgrep-expanded"><a name="L107"></a><tt class="py-lineno">107</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
170<a name="L108"></a><tt class="py-lineno">108</tt> <tt class="py-line"><tt class="py-docstring"> Find files in the directory tree starting at 'path' (filtered by</tt> </tt>
171<a name="L109"></a><tt class="py-lineno">109</tt> <tt class="py-line"><tt class="py-docstring"> Unix shell-style wildcards ('shellglobs') and/or the functions in</tt> </tt>
172<a name="L110"></a><tt class="py-lineno">110</tt> <tt class="py-line"><tt class="py-docstring"> the 'namefs' sequence) and search inside these.</tt> </tt>
173<a name="L111"></a><tt class="py-lineno">111</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
174<a name="L112"></a><tt class="py-lineno">112</tt> <tt class="py-line"><tt class="py-docstring"> Additionaly, the file content will be filtered by the regular</tt> </tt>
175<a name="L113"></a><tt class="py-lineno">113</tt> <tt class="py-line"><tt class="py-docstring"> expressions in the 'regexl' sequence. Each entry in the latter</tt> </tt>
176<a name="L114"></a><tt class="py-lineno">114</tt> <tt class="py-line"><tt class="py-docstring"> is a</tt> </tt>
177<a name="L115"></a><tt class="py-lineno">115</tt> <tt class="py-line"><tt class="py-docstring"> </tt> </tt>
178<a name="L116"></a><tt class="py-lineno">116</tt> <tt class="py-line"><tt class="py-docstring"> - either a string (with the regex definition)</tt> </tt>
179<a name="L117"></a><tt class="py-lineno">117</tt> <tt class="py-line"><tt class="py-docstring"> - or a tuple with arguments accepted by re.compile() (the</tt> </tt>
180<a name="L118"></a><tt class="py-lineno">118</tt> <tt class="py-line"><tt class="py-docstring"> re.M and re.S flags will have no effect though)</tt> </tt>
181<a name="L119"></a><tt class="py-lineno">119</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
182<a name="L120"></a><tt class="py-lineno">120</tt> <tt class="py-line"><tt class="py-docstring"> For all the files that pass the file name/content tests the function</tt> </tt>
183<a name="L121"></a><tt class="py-lineno">121</tt> <tt class="py-line"><tt class="py-docstring"> returns a dictionary where the</tt> </tt>
184<a name="L122"></a><tt class="py-lineno">122</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
185<a name="L123"></a><tt class="py-lineno">123</tt> <tt class="py-line"><tt class="py-docstring"> - key is the file name and the</tt> </tt>
186<a name="L124"></a><tt class="py-lineno">124</tt> <tt class="py-line"><tt class="py-docstring"> - value is a string with lines filtered by 'regexl'</tt> </tt>
187<a name="L125"></a><tt class="py-lineno">125</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
188<a name="L126"></a><tt class="py-lineno">126</tt> <tt class="py-line"><tt class="py-docstring"> @type path: string</tt> </tt>
189<a name="L127"></a><tt class="py-lineno">127</tt> <tt class="py-line"><tt class="py-docstring"> @param path: starting path of the directory tree to be searched</tt> </tt>
190<a name="L128"></a><tt class="py-lineno">128</tt> <tt class="py-line"><tt class="py-docstring"> @type shellglobs: sequence</tt> </tt>
191<a name="L129"></a><tt class="py-lineno">129</tt> <tt class="py-line"><tt class="py-docstring"> @param shellglobs: an optional sequence of Unix shell-style wildcards</tt> </tt>
192<a name="L130"></a><tt class="py-lineno">130</tt> <tt class="py-line"><tt class="py-docstring"> that are to be applied to the file *names* found</tt> </tt>
193<a name="L131"></a><tt class="py-lineno">131</tt> <tt class="py-line"><tt class="py-docstring"> @type namefs: sequence</tt> </tt>
194<a name="L132"></a><tt class="py-lineno">132</tt> <tt class="py-line"><tt class="py-docstring"> @param namefs: an optional sequence of functions to be applied to the</tt> </tt>
195<a name="L133"></a><tt class="py-lineno">133</tt> <tt class="py-line"><tt class="py-docstring"> file *paths* found</tt> </tt>
196<a name="L134"></a><tt class="py-lineno">134</tt> <tt class="py-line"><tt class="py-docstring"> @type relative: bool</tt> </tt>
197<a name="L135"></a><tt class="py-lineno">135</tt> <tt class="py-line"><tt class="py-docstring"> @param relative: a boolean flag that determines whether absolute or</tt> </tt>
198<a name="L136"></a><tt class="py-lineno">136</tt> <tt class="py-line"><tt class="py-docstring"> relative paths should be returned</tt> </tt>
199<a name="L137"></a><tt class="py-lineno">137</tt> <tt class="py-line"><tt class="py-docstring"> @type linenums: bool</tt> </tt>
200<a name="L138"></a><tt class="py-lineno">138</tt> <tt class="py-line"><tt class="py-docstring"> @param linenums: turns on line numbers for found files (like grep -n)</tt> </tt>
201<a name="L139"></a><tt class="py-lineno">139</tt> <tt class="py-line"><tt class="py-docstring"> @rtype: dict</tt> </tt>
202<a name="L140"></a><tt class="py-lineno">140</tt> <tt class="py-line"><tt class="py-docstring"> @return: file name (key) and lines filtered by 'regexl' (value)</tt> </tt>
203<a name="L141"></a><tt class="py-lineno">141</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
204<a name="L142"></a><tt class="py-lineno">142</tt> <tt class="py-line"> <tt class="py-name">fileList</tt> <tt class="py-op">=</tt> <tt id="link-2" class="py-name" targets="Function scriptutil.ffind()=scriptutil-module.html#ffind"><a title="scriptutil.ffind" class="py-name" href="#" onclick="return doclink('link-2', 'ffind', 'link-2');">ffind</a></tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">,</tt> <tt class="py-name">shellglobs</tt><tt class="py-op">=</tt><tt class="py-name">shellglobs</tt><tt class="py-op">,</tt> </tt>
205<a name="L143"></a><tt class="py-lineno">143</tt> <tt class="py-line"> <tt class="py-name">namefs</tt><tt class="py-op">=</tt><tt class="py-name">namefs</tt><tt class="py-op">,</tt> <tt class="py-name">relative</tt><tt class="py-op">=</tt><tt class="py-name">relative</tt><tt class="py-op">)</tt> </tt>
206<a name="L144"></a><tt class="py-lineno">144</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">fileList</tt><tt class="py-op">:</tt> <tt class="py-keyword">return</tt> <tt class="py-name">dict</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
207<a name="L145"></a><tt class="py-lineno">145</tt> <tt class="py-line"> </tt>
208<a name="L146"></a><tt class="py-lineno">146</tt> <tt class="py-line"> <tt class="py-name">result</tt> <tt class="py-op">=</tt> <tt class="py-name">dict</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
209<a name="L147"></a><tt class="py-lineno">147</tt> <tt class="py-line"> </tt>
210<a name="L148"></a><tt class="py-lineno">148</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
211<a name="L149"></a><tt class="py-lineno">149</tt> <tt class="py-line"> <tt class="py-comment"># first compile the regular expressions</tt> </tt>
212<a name="L150"></a><tt class="py-lineno">150</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-name">ffuncs</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
213<a name="L151"></a><tt class="py-lineno">151</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">redata</tt> <tt class="py-keyword">in</tt> <tt class="py-name">regexl</tt><tt class="py-op">:</tt> </tt>
214<a name="L152"></a><tt class="py-lineno">152</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">redata</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">types</tt><tt class="py-op">.</tt><tt class="py-name">StringType</tt><tt class="py-op">:</tt> </tt>
215<a name="L153"></a><tt class="py-lineno">153</tt> <tt class="py-line"> <tt class="py-name">ffuncs</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">compile</tt><tt class="py-op">(</tt><tt class="py-name">redata</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">search</tt><tt class="py-op">)</tt> </tt>
216<a name="L154"></a><tt class="py-lineno">154</tt> <tt class="py-line"> <tt class="py-keyword">elif</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">redata</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">types</tt><tt class="py-op">.</tt><tt class="py-name">TupleType</tt><tt class="py-op">:</tt> </tt>
217<a name="L155"></a><tt class="py-lineno">155</tt> <tt class="py-line"> <tt class="py-name">ffuncs</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">compile</tt><tt class="py-op">(</tt><tt class="py-op">*</tt><tt class="py-name">redata</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">search</tt><tt class="py-op">)</tt> </tt>
218<a name="L156"></a><tt class="py-lineno">156</tt> <tt class="py-line"> <tt class="py-comment"># now grep in the files found</tt> </tt>
219<a name="L157"></a><tt class="py-lineno">157</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">for</tt> <tt class="py-name">file</tt> <tt class="py-keyword">in</tt> <tt class="py-name">fileList</tt><tt class="py-op">:</tt> </tt>
220<a name="L158"></a><tt class="py-lineno">158</tt> <tt class="py-line"> <tt class="py-comment"># read file content</tt> </tt>
221<a name="L159"></a><tt class="py-lineno">159</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-name">fhandle</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">file</tt><tt class="py-op">,</tt> <tt class="py-string">'r'</tt><tt class="py-op">)</tt> </tt>
222<a name="L160"></a><tt class="py-lineno">160</tt> <tt class="py-line"> <tt class="py-name">fcontent</tt> <tt class="py-op">=</tt> <tt class="py-name">fhandle</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
223<a name="L161"></a><tt class="py-lineno">161</tt> <tt class="py-line"> <tt class="py-name">fhandle</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
224<a name="L162"></a><tt class="py-lineno">162</tt> <tt class="py-line"> <tt class="py-comment"># split file content in lines</tt> </tt>
225<a name="L163"></a><tt class="py-lineno">163</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">if</tt> <tt class="py-name">linenums</tt><tt class="py-op">:</tt> <tt class="py-name">lines</tt> <tt class="py-op">=</tt> <tt class="py-name">zip</tt><tt class="py-op">(</tt><tt class="py-name">itertools</tt><tt class="py-op">.</tt><tt class="py-name">count</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">fcontent</tt><tt class="py-op">.</tt><tt class="py-name">splitlines</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
226<a name="L164"></a><tt class="py-lineno">164</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> <tt class="py-name">lines</tt> <tt class="py-op">=</tt> <tt class="py-name">fcontent</tt><tt class="py-op">.</tt><tt class="py-name">splitlines</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
227<a name="L165"></a><tt class="py-lineno">165</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">ff</tt> <tt class="py-keyword">in</tt> <tt class="py-name">ffuncs</tt><tt class="py-op">:</tt> </tt>
228<a name="L166"></a><tt class="py-lineno">166</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">linenums</tt><tt class="py-op">:</tt> <tt class="py-name">lines</tt> <tt class="py-op">=</tt> <tt class="py-name">filter</tt><tt class="py-op">(</tt><tt class="py-keyword">lambda</tt> <tt class="py-name">t</tt><tt class="py-op">:</tt> <tt class="py-name">ff</tt><tt class="py-op">(</tt><tt class="py-name">t</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">lines</tt><tt class="py-op">)</tt> </tt>
229<a name="L167"></a><tt class="py-lineno">167</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> <tt class="py-name">lines</tt> <tt class="py-op">=</tt> <tt class="py-name">filter</tt><tt class="py-op">(</tt><tt class="py-name">ff</tt><tt class="py-op">,</tt> <tt class="py-name">lines</tt><tt class="py-op">)</tt> </tt>
230<a name="L168"></a><tt class="py-lineno">168</tt> <tt class="py-line"> <tt class="py-comment"># there's no point in applying the remaining regular</tt> </tt>
231<a name="L169"></a><tt class="py-lineno">169</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># expressions if we don't have any matching lines any more</tt> </tt>
232<a name="L170"></a><tt class="py-lineno">170</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">lines</tt><tt class="py-op">:</tt> <tt class="py-keyword">break</tt> </tt>
233<a name="L171"></a><tt class="py-lineno">171</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
234<a name="L172"></a><tt class="py-lineno">172</tt> <tt class="py-line"> <tt class="py-comment"># the loop terminated normally; add this file to the</tt> </tt>
235<a name="L173"></a><tt class="py-lineno">173</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># result set if there are any lines that matched</tt> </tt>
236<a name="L174"></a><tt class="py-lineno">174</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">if</tt> <tt class="py-name">lines</tt><tt class="py-op">:</tt> </tt>
237<a name="L175"></a><tt class="py-lineno">175</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">linenums</tt><tt class="py-op">:</tt> </tt>
238<a name="L176"></a><tt class="py-lineno">176</tt> <tt class="py-line"> <tt class="py-name">result</tt><tt class="py-op">[</tt><tt class="py-name">file</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-string">'\n'</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-string">"%d:%s"</tt> <tt class="py-op">%</tt> <tt class="py-name">t</tt> <tt class="py-keyword">for</tt> <tt class="py-name">t</tt> <tt class="py-keyword">in</tt> <tt class="py-name">lines</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
239<a name="L177"></a><tt class="py-lineno">177</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
240<a name="L178"></a><tt class="py-lineno">178</tt> <tt class="py-line"> <tt class="py-name">result</tt><tt class="py-op">[</tt><tt class="py-name">file</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-string">'\n'</tt><tt class="py-op">.</tt><tt class="py-name">join</tt><tt class="py-op">(</tt><tt class="py-name">map</tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">,</tt> <tt class="py-name">lines</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
241<a name="L179"></a><tt class="py-lineno">179</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">Exception</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">:</tt> <tt class="py-keyword">raise</tt> <tt id="link-3" class="py-name"><a title="scriptutil.ScriptError" class="py-name" href="#" onclick="return doclink('link-3', 'ScriptError', 'link-0');">ScriptError</a></tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">e</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
242<a name="L180"></a><tt class="py-lineno">180</tt> <tt class="py-line"> <tt class="py-keyword">return</tt><tt class="py-op">(</tt><tt class="py-name">result</tt><tt class="py-op">)</tt> </tt>
243</div><a name="L181"></a><tt class="py-lineno">181</tt> <tt class="py-line"> </tt>
244<a name="freplace"></a><div id="freplace-def"><a name="L182"></a><tt class="py-lineno">182</tt> <a class="py-toggle" href="#" id="freplace-toggle" onclick="return toggle('freplace');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="scriptutil-module.html#freplace">freplace</a><tt class="py-op">(</tt><tt class="py-param">path</tt><tt class="py-op">,</tt> <tt class="py-param">regexl</tt><tt class="py-op">,</tt> <tt class="py-param">shellglobs</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">namefs</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">bext</tt><tt class="py-op">=</tt><tt class="py-string">'.bak'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
245</div><div id="freplace-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="freplace-expanded"><a name="L183"></a><tt class="py-lineno">183</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
246<a name="L184"></a><tt class="py-lineno">184</tt> <tt class="py-line"><tt class="py-docstring"> Find files in the directory tree starting at 'path' (filtered by</tt> </tt>
247<a name="L185"></a><tt class="py-lineno">185</tt> <tt class="py-line"><tt class="py-docstring"> Unix shell-style wildcards ('shellglobs') and/or the functions in</tt> </tt>
248<a name="L186"></a><tt class="py-lineno">186</tt> <tt class="py-line"><tt class="py-docstring"> the 'namefs' sequence) and perform an in-place search/replace</tt> </tt>
249<a name="L187"></a><tt class="py-lineno">187</tt> <tt class="py-line"><tt class="py-docstring"> operation on these.</tt> </tt>
250<a name="L188"></a><tt class="py-lineno">188</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
251<a name="L189"></a><tt class="py-lineno">189</tt> <tt class="py-line"><tt class="py-docstring"> Additionally, an in-place search/replace operation is performed</tt> </tt>
252<a name="L190"></a><tt class="py-lineno">190</tt> <tt class="py-line"><tt class="py-docstring"> on the content of all the files (whose names passed the tests)</tt> </tt>
253<a name="L191"></a><tt class="py-lineno">191</tt> <tt class="py-line"><tt class="py-docstring"> using the regular expressions in 'regexl'.</tt> </tt>
254<a name="L192"></a><tt class="py-lineno">192</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
255<a name="L193"></a><tt class="py-lineno">193</tt> <tt class="py-line"><tt class="py-docstring"> Please note: 'regexl' is a sequence of 3-tuples, each having the</tt> </tt>
256<a name="L194"></a><tt class="py-lineno">194</tt> <tt class="py-line"><tt class="py-docstring"> following elements:</tt> </tt>
257<a name="L195"></a><tt class="py-lineno">195</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
258<a name="L196"></a><tt class="py-lineno">196</tt> <tt class="py-line"><tt class="py-docstring"> - search string (Python regex syntax)</tt> </tt>
259<a name="L197"></a><tt class="py-lineno">197</tt> <tt class="py-line"><tt class="py-docstring"> - replace string (Python regex syntax)</tt> </tt>
260<a name="L198"></a><tt class="py-lineno">198</tt> <tt class="py-line"><tt class="py-docstring"> - regex flags or 'None' (re.compile syntax)</tt> </tt>
261<a name="L199"></a><tt class="py-lineno">199</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
262<a name="L200"></a><tt class="py-lineno">200</tt> <tt class="py-line"><tt class="py-docstring"> Copies of the modified files are saved in backup files using the</tt> </tt>
263<a name="L201"></a><tt class="py-lineno">201</tt> <tt class="py-line"><tt class="py-docstring"> extension specified in 'bext'.</tt> </tt>
264<a name="L202"></a><tt class="py-lineno">202</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
265<a name="L203"></a><tt class="py-lineno">203</tt> <tt class="py-line"><tt class="py-docstring"> @type path: string</tt> </tt>
266<a name="L204"></a><tt class="py-lineno">204</tt> <tt class="py-line"><tt class="py-docstring"> @param path: starting path of the directory tree to be searched</tt> </tt>
267<a name="L205"></a><tt class="py-lineno">205</tt> <tt class="py-line"><tt class="py-docstring"> @type shellglobs: sequence</tt> </tt>
268<a name="L206"></a><tt class="py-lineno">206</tt> <tt class="py-line"><tt class="py-docstring"> @param shellglobs: an optional sequence of Unix shell-style wildcards</tt> </tt>
269<a name="L207"></a><tt class="py-lineno">207</tt> <tt class="py-line"><tt class="py-docstring"> that are to be applied to the file *names* found</tt> </tt>
270<a name="L208"></a><tt class="py-lineno">208</tt> <tt class="py-line"><tt class="py-docstring"> @type namefs: sequence</tt> </tt>
271<a name="L209"></a><tt class="py-lineno">209</tt> <tt class="py-line"><tt class="py-docstring"> @param namefs: an optional sequence of functions to be applied to the</tt> </tt>
272<a name="L210"></a><tt class="py-lineno">210</tt> <tt class="py-line"><tt class="py-docstring"> file *paths* found</tt> </tt>
273<a name="L211"></a><tt class="py-lineno">211</tt> <tt class="py-line"><tt class="py-docstring"> @rtype: number</tt> </tt>
274<a name="L212"></a><tt class="py-lineno">212</tt> <tt class="py-line"><tt class="py-docstring"> @return: total number of files modified</tt> </tt>
275<a name="L213"></a><tt class="py-lineno">213</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
276<a name="L214"></a><tt class="py-lineno">214</tt> <tt class="py-line"> <tt class="py-name">fileList</tt> <tt class="py-op">=</tt> <tt id="link-4" class="py-name"><a title="scriptutil.ffind" class="py-name" href="#" onclick="return doclink('link-4', 'ffind', 'link-2');">ffind</a></tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">,</tt> <tt class="py-name">shellglobs</tt><tt class="py-op">=</tt><tt class="py-name">shellglobs</tt><tt class="py-op">,</tt> <tt class="py-name">namefs</tt><tt class="py-op">=</tt><tt class="py-name">namefs</tt><tt class="py-op">)</tt> </tt>
277<a name="L215"></a><tt class="py-lineno">215</tt> <tt class="py-line"> </tt>
278<a name="L216"></a><tt class="py-lineno">216</tt> <tt class="py-line"> <tt class="py-comment"># return if no files found</tt> </tt>
279<a name="L217"></a><tt class="py-lineno">217</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">fileList</tt><tt class="py-op">:</tt> <tt class="py-keyword">return</tt> <tt class="py-number">0</tt> </tt>
280<a name="L218"></a><tt class="py-lineno">218</tt> <tt class="py-line"> </tt>
281<a name="L219"></a><tt class="py-lineno">219</tt> <tt class="py-line"> <tt class="py-name">filesChanged</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
282<a name="L220"></a><tt class="py-lineno">220</tt> <tt class="py-line"> </tt>
283<a name="L221"></a><tt class="py-lineno">221</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
284<a name="L222"></a><tt class="py-lineno">222</tt> <tt class="py-line"> <tt class="py-name">cffl</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
285<a name="L223"></a><tt class="py-lineno">223</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">searchs</tt><tt class="py-op">,</tt> <tt class="py-name">replaces</tt><tt class="py-op">,</tt> <tt class="py-name">reflags</tt> <tt class="py-keyword">in</tt> <tt class="py-name">regexl</tt><tt class="py-op">:</tt> </tt>
286<a name="L224"></a><tt class="py-lineno">224</tt> <tt class="py-line"> <tt class="py-comment"># prepare the required regex objects, check whether we need</tt> </tt>
287<a name="L225"></a><tt class="py-lineno">225</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-comment"># to pass any regex compilation flags</tt> </tt>
288<a name="L226"></a><tt class="py-lineno">226</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">if</tt> <tt class="py-name">reflags</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> <tt class="py-name">regex</tt> <tt class="py-op">=</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">compile</tt><tt class="py-op">(</tt><tt class="py-name">searchs</tt><tt class="py-op">,</tt> <tt class="py-name">reflags</tt><tt class="py-op">)</tt> </tt>
289<a name="L227"></a><tt class="py-lineno">227</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> <tt class="py-name">regex</tt> <tt class="py-op">=</tt> <tt class="py-name">re</tt><tt class="py-op">.</tt><tt class="py-name">compile</tt><tt class="py-op">(</tt><tt class="py-name">searchs</tt><tt class="py-op">)</tt> </tt>
290<a name="L228"></a><tt class="py-lineno">228</tt> <tt class="py-line"> <tt class="py-name">cffl</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">regex</tt><tt class="py-op">.</tt><tt class="py-name">subn</tt><tt class="py-op">,</tt> <tt class="py-name">replaces</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
291<a name="L229"></a><tt class="py-lineno">229</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">file</tt> <tt class="py-keyword">in</tt> <tt class="py-name">fileList</tt><tt class="py-op">:</tt> </tt>
292<a name="L230"></a><tt class="py-lineno">230</tt> <tt class="py-line"> <tt class="py-comment"># read file content</tt> </tt>
293<a name="L231"></a><tt class="py-lineno">231</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-name">fhandle</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">file</tt><tt class="py-op">,</tt> <tt class="py-string">'r'</tt><tt class="py-op">)</tt> </tt>
294<a name="L232"></a><tt class="py-lineno">232</tt> <tt class="py-line"> <tt class="py-name">text</tt> <tt class="py-op">=</tt> <tt class="py-name">fhandle</tt><tt class="py-op">.</tt><tt class="py-name">read</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
295<a name="L233"></a><tt class="py-lineno">233</tt> <tt class="py-line"> <tt class="py-name">fhandle</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
296<a name="L234"></a><tt class="py-lineno">234</tt> <tt class="py-line"> <tt class="py-name">substitutions</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
297<a name="L235"></a><tt class="py-lineno">235</tt> <tt class="py-line"> <tt class="py-comment"># unpack the subn() function and the replace string</tt> </tt>
298<a name="L236"></a><tt class="py-lineno">236</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">for</tt> <tt class="py-name">subnfunc</tt><tt class="py-op">,</tt> <tt class="py-name">replaces</tt> <tt class="py-keyword">in</tt> <tt class="py-name">cffl</tt><tt class="py-op">:</tt> </tt>
299<a name="L237"></a><tt class="py-lineno">237</tt> <tt class="py-line"> <tt class="py-name">text</tt><tt class="py-op">,</tt> <tt class="py-name">numOfChanges</tt> <tt class="py-op">=</tt> <tt class="py-name">subnfunc</tt><tt class="py-op">(</tt><tt class="py-name">replaces</tt><tt class="py-op">,</tt> <tt class="py-name">text</tt><tt class="py-op">)</tt> </tt>
300<a name="L238"></a><tt class="py-lineno">238</tt> <tt class="py-line"> <tt class="py-name">substitutions</tt> <tt class="py-op">+=</tt> <tt class="py-name">numOfChanges</tt> </tt>
301<a name="L239"></a><tt class="py-lineno">239</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">substitutions</tt><tt class="py-op">:</tt> </tt>
302<a name="L240"></a><tt class="py-lineno">240</tt> <tt class="py-line"> <tt class="py-comment"># first move away the original file</tt> </tt>
303<a name="L241"></a><tt class="py-lineno">241</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-name">bakFileName</tt> <tt class="py-op">=</tt> <tt class="py-string">'%s%s'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">file</tt><tt class="py-op">,</tt> <tt class="py-name">bext</tt><tt class="py-op">)</tt> </tt>
304<a name="L242"></a><tt class="py-lineno">242</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">exists</tt><tt class="py-op">(</tt><tt class="py-name">bakFileName</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">unlink</tt><tt class="py-op">(</tt><tt class="py-name">bakFileName</tt><tt class="py-op">)</tt> </tt>
305<a name="L243"></a><tt class="py-lineno">243</tt> <tt class="py-line"> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">rename</tt><tt class="py-op">(</tt><tt class="py-name">file</tt><tt class="py-op">,</tt> <tt class="py-name">bakFileName</tt><tt class="py-op">)</tt> </tt>
306<a name="L244"></a><tt class="py-lineno">244</tt> <tt class="py-line"> <tt class="py-comment"># now write the new file content</tt> </tt>
307<a name="L245"></a><tt class="py-lineno">245</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-name">fhandle</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">file</tt><tt class="py-op">,</tt> <tt class="py-string">'w'</tt><tt class="py-op">)</tt> </tt>
308<a name="L246"></a><tt class="py-lineno">246</tt> <tt class="py-line"> <tt class="py-name">fhandle</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-name">text</tt><tt class="py-op">)</tt> </tt>
309<a name="L247"></a><tt class="py-lineno">247</tt> <tt class="py-line"> <tt class="py-name">fhandle</tt><tt class="py-op">.</tt><tt class="py-name">close</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
310<a name="L248"></a><tt class="py-lineno">248</tt> <tt class="py-line"> <tt class="py-name">filesChanged</tt> <tt class="py-op">+=</tt> <tt class="py-number">1</tt> </tt>
311<a name="L249"></a><tt class="py-lineno">249</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">Exception</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">:</tt> <tt class="py-keyword">raise</tt> <tt id="link-5" class="py-name"><a title="scriptutil.ScriptError" class="py-name" href="#" onclick="return doclink('link-5', 'ScriptError', 'link-0');">ScriptError</a></tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">e</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
312<a name="L250"></a><tt class="py-lineno">250</tt> <tt class="py-line"> </tt>
313<a name="L251"></a><tt class="py-lineno">251</tt> <tt class="py-line"> <tt class="py-comment"># Returns the number of files that had some of their content changed</tt> </tt>
314<a name="L252"></a><tt class="py-lineno">252</tt> <tt class="py-line"><tt class="py-comment"></tt> <tt class="py-keyword">return</tt><tt class="py-op">(</tt><tt class="py-name">filesChanged</tt><tt class="py-op">)</tt> </tt>
315</div><a name="L253"></a><tt class="py-lineno">253</tt> <tt class="py-line"> </tt>
316<a name="printr"></a><div id="printr-def"><a name="L254"></a><tt class="py-lineno">254</tt> <a class="py-toggle" href="#" id="printr-toggle" onclick="return toggle('printr');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="scriptutil-module.html#printr">printr</a><tt class="py-op">(</tt><tt class="py-param">results</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
317</div><div id="printr-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="printr-expanded"><a name="L255"></a><tt class="py-lineno">255</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
318<a name="L256"></a><tt class="py-lineno">256</tt> <tt class="py-line"><tt class="py-docstring"> Print the results of the ffind()/ffindgrep() functions.</tt> </tt>
319<a name="L257"></a><tt class="py-lineno">257</tt> <tt class="py-line"><tt class="py-docstring"> </tt> </tt>
320<a name="L258"></a><tt class="py-lineno">258</tt> <tt class="py-line"><tt class="py-docstring"> The output format is similar to the one used by the UNIX find utility.</tt> </tt>
321<a name="L259"></a><tt class="py-lineno">259</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
322<a name="L260"></a><tt class="py-lineno">260</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">results</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">types</tt><tt class="py-op">.</tt><tt class="py-name">DictType</tt><tt class="py-op">:</tt> </tt>
323<a name="L261"></a><tt class="py-lineno">261</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">f</tt> <tt class="py-keyword">in</tt> <tt class="py-name">sorted</tt><tt class="py-op">(</tt><tt class="py-name">results</tt><tt class="py-op">.</tt><tt class="py-name">keys</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
324<a name="L262"></a><tt class="py-lineno">262</tt> <tt class="py-line"> <tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">stdout</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-string">"%s\n%s\n"</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">results</tt><tt class="py-op">[</tt><tt class="py-name">f</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
325<a name="L263"></a><tt class="py-lineno">263</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
326<a name="L264"></a><tt class="py-lineno">264</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">f</tt> <tt class="py-keyword">in</tt> <tt class="py-name">sorted</tt><tt class="py-op">(</tt><tt class="py-name">results</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
327<a name="L265"></a><tt class="py-lineno">265</tt> <tt class="py-line"> <tt class="py-name">sys</tt><tt class="py-op">.</tt><tt class="py-name">stdout</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-string">"%s\n"</tt> <tt class="py-op">%</tt> <tt class="py-name">f</tt><tt class="py-op">)</tt> </tt>
328</div><a name="L266"></a><tt class="py-lineno">266</tt> <tt class="py-line"> </tt>
329<a name="L267"></a><tt class="py-lineno">267</tt> <tt class="py-line"><tt class="py-keyword">if</tt> <tt class="py-name">__name__</tt> <tt class="py-op">==</tt> <tt class="py-string">'__main__'</tt><tt class="py-op">:</tt> </tt>
330<a name="L268"></a><tt class="py-lineno">268</tt> <tt class="py-line"> <tt class="py-keyword">pass</tt> </tt>
331<a name="L269"></a><tt class="py-lineno">269</tt> <tt class="py-line"> </tt><script type="text/javascript">
332<!--
333expandto(location.href);
334// -->
335</script>
336</pre>
337<br />
338<!-- ==================== NAVIGATION BAR ==================== -->
339<table class="navbar" border="0" width="100%" cellpadding="0"
340 bgcolor="#a0c0ff" cellspacing="0">
341 <tr valign="middle">
342 <!-- Home link -->
343 <th bgcolor="#70b0f0" class="navbar-select"
344 >&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;</th>
345
346 <!-- Tree link -->
347 <th>&nbsp;&nbsp;&nbsp;<a
348 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
349
350 <!-- Index link -->
351 <th>&nbsp;&nbsp;&nbsp;<a
352 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
353
354 <!-- Help link -->
355 <th>&nbsp;&nbsp;&nbsp;<a
356 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
357
358 <!-- Project homepage -->
359 <th class="navbar" align="right" width="100%">
360 <table border="0" cellpadding="0" cellspacing="0">
361 <tr><th class="navbar" align="center"
362 ><a class="navbar" target="_top" href="http://hrnjad.net/src/scriptutil">Module scriptutil</a></th>
363 </tr></table></th>
364 </tr>
365</table>
366<table border="0" cellpadding="0" cellspacing="0" width="100%%">
367 <tr>
368 <td align="left" class="footer">
369 Generated by Epydoc 3.0beta1 on Thu May 22 18:10:51 2008
370 </td>
371 <td align="right" class="footer">
372 <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
373 </td>
374 </tr>
375</table>
376
377<script type="text/javascript">
378 <!--
379 // Private objects are initially displayed (because if
380 // javascript is turned off then we want them to be
381 // visible); but by default, we want to hide them. So hide
382 // them unless we have a cookie that says to show them.
383 checkCookie()
384 // -->
385</script>
386
387</body>
388</html>
3890
=== removed file 'doc/html/scriptutil.ScriptError-class.html'
--- doc/html/scriptutil.ScriptError-class.html 2009-12-26 20:49:38 +0000
+++ doc/html/scriptutil.ScriptError-class.html 1970-01-01 00:00:00 +0000
@@ -1,197 +0,0 @@
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title>scriptutil.ScriptError</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12 alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
16 <tr valign="middle">
17 <!-- Home link -->
18 <th>&nbsp;&nbsp;&nbsp;<a
19 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21 <!-- Tree link -->
22 <th>&nbsp;&nbsp;&nbsp;<a
23 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25 <!-- Index link -->
26 <th>&nbsp;&nbsp;&nbsp;<a
27 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29 <!-- Help link -->
30 <th>&nbsp;&nbsp;&nbsp;<a
31 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="http://hrnjad.net/src/scriptutil">Module scriptutil</a></th>
38 </tr></table></th>
39 </tr>
40</table>
41<table width="100%" cellpadding="0" cellspacing="0">
42 <tr valign="top">
43 <td width="100%">
44 <span class="breadcrumbs">
45 <a href="scriptutil-module.html">Script&nbsp;scriptutil</a> ::
46 Class&nbsp;ScriptError
47 </span>
48 </td>
49 <td>
50 <table cellpadding="0" cellspacing="0">
51 <!-- hide/show private -->
52 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
53 onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
54 <tr><td align="right"><span class="options"
55 >[<a href="frames.html" target="_top">frames</a
56 >]&nbsp;|&nbsp;<a href="scriptutil.ScriptError-class.html"
57 target="_top">no&nbsp;frames</a>]</span></td></tr>
58 </table>
59 </td>
60 </tr>
61</table>
62<!-- ==================== CLASS DESCRIPTION ==================== -->
63<h1 class="epydoc">Class ScriptError</h1><span class="codelink"><a href="scriptutil-pysrc.html#ScriptError">source&nbsp;code</a></span><br /><br />
64<pre class="base-tree">
65 object --+
66 |
67exceptions.BaseException --+
68 |
69 exceptions.Exception --+
70 |
71 <strong class="uidshort">ScriptError</strong>
72</pre>
73
74<hr />
75The exception raised in case of failures.<br /><br />
76
77<!-- ==================== INSTANCE METHODS ==================== -->
78<a name="section-InstanceMethods"></a>
79<table class="summary" border="1" cellpadding="3"
80 cellspacing="0" width="100%" bgcolor="white">
81<tr bgcolor="#70b0f0" class="table-header">
82 <td colspan="2" class="table-header">
83 <table border="0" cellpadding="0" cellspacing="0" width="100%">
84 <tr valign="top">
85 <td align="left"><span class="table-header">Instance Methods</span></td>
86 <td align="right" valign="top"
87 ><span class="options">[<a href="#section-InstanceMethods"
88 class="privatelink" onclick="toggle_private();"
89 >hide private</a>]</span></td>
90 </tr>
91 </table>
92 </td>
93</tr>
94 <tr>
95 <td colspan="2" class="summary">
96 <p class="indent-wrapped-lines"><b>Inherited from <code>exceptions.Exception</code></b>:
97 <code>__init__</code>,
98 <code>__new__</code>
99 </p>
100 <p class="indent-wrapped-lines"><b>Inherited from <code>exceptions.BaseException</code></b>:
101 <code>__delattr__</code>,
102 <code>__getattribute__</code>,
103 <code>__getitem__</code>,
104 <code>__getslice__</code>,
105 <code>__reduce__</code>,
106 <code>__repr__</code>,
107 <code>__setattr__</code>,
108 <code>__setstate__</code>,
109 <code>__str__</code>
110 </p>
111 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
112 <code>__hash__</code>,
113 <code>__reduce_ex__</code>
114 </p>
115 </td>
116 </tr>
117</table>
118<!-- ==================== PROPERTIES ==================== -->
119<a name="section-Properties"></a>
120<table class="summary" border="1" cellpadding="3"
121 cellspacing="0" width="100%" bgcolor="white">
122<tr bgcolor="#70b0f0" class="table-header">
123 <td colspan="2" class="table-header">
124 <table border="0" cellpadding="0" cellspacing="0" width="100%">
125 <tr valign="top">
126 <td align="left"><span class="table-header">Properties</span></td>
127 <td align="right" valign="top"
128 ><span class="options">[<a href="#section-Properties"
129 class="privatelink" onclick="toggle_private();"
130 >hide private</a>]</span></td>
131 </tr>
132 </table>
133 </td>
134</tr>
135 <tr>
136 <td colspan="2" class="summary">
137 <p class="indent-wrapped-lines"><b>Inherited from <code>exceptions.BaseException</code></b>:
138 <code>args</code>,
139 <code>message</code>
140 </p>
141 <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
142 <code>__class__</code>
143 </p>
144 </td>
145 </tr>
146</table>
147<!-- ==================== NAVIGATION BAR ==================== -->
148<table class="navbar" border="0" width="100%" cellpadding="0"
149 bgcolor="#a0c0ff" cellspacing="0">
150 <tr valign="middle">
151 <!-- Home link -->
152 <th>&nbsp;&nbsp;&nbsp;<a
153 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
154
155 <!-- Tree link -->
156 <th>&nbsp;&nbsp;&nbsp;<a
157 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
158
159 <!-- Index link -->
160 <th>&nbsp;&nbsp;&nbsp;<a
161 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
162
163 <!-- Help link -->
164 <th>&nbsp;&nbsp;&nbsp;<a
165 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
166
167 <!-- Project homepage -->
168 <th class="navbar" align="right" width="100%">
169 <table border="0" cellpadding="0" cellspacing="0">
170 <tr><th class="navbar" align="center"
171 ><a class="navbar" target="_top" href="http://hrnjad.net/src/scriptutil">Module scriptutil</a></th>
172 </tr></table></th>
173 </tr>
174</table>
175<table border="0" cellpadding="0" cellspacing="0" width="100%%">
176 <tr>
177 <td align="left" class="footer">
178 Generated by Epydoc 3.0beta1 on Thu May 22 18:10:51 2008
179 </td>
180 <td align="right" class="footer">
181 <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a>
182 </td>
183 </tr>
184</table>
185
186<script type="text/javascript">
187 <!--
188 // Private objects are initially displayed (because if
189 // javascript is turned off then we want them to be
190 // visible); but by default, we want to hide them. So hide
191 // them unless we have a cookie that says to show them.
192 checkCookie()
193 // -->
194</script>
195
196</body>
197</html>
1980
=== added file 'doc/html/scriptutil.find-module.html'
--- doc/html/scriptutil.find-module.html 1970-01-01 00:00:00 +0000
+++ doc/html/scriptutil.find-module.html 2009-12-26 22:06:14 +0000
@@ -0,0 +1,494 @@
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title>scriptutil.find</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12 alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
16 <tr valign="middle">
17 <!-- Home link -->
18 <th>&nbsp;&nbsp;&nbsp;<a
19 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21 <!-- Tree link -->
22 <th>&nbsp;&nbsp;&nbsp;<a
23 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25 <!-- Index link -->
26 <th>&nbsp;&nbsp;&nbsp;<a
27 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29 <!-- Help link -->
30 <th>&nbsp;&nbsp;&nbsp;<a
31 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="https://launchpad.net/py-script">Project Homepage</a></th>
38 </tr></table></th>
39 </tr>
40</table>
41<table width="100%" cellpadding="0" cellspacing="0">
42 <tr valign="top">
43 <td width="100%">
44 <span class="breadcrumbs">
45 <a href="scriptutil-module.html">Package&nbsp;scriptutil</a> ::
46 Script&nbsp;find
47 </span>
48 </td>
49 <td>
50 <table cellpadding="0" cellspacing="0">
51 <!-- hide/show private -->
52 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
53 onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
54 <tr><td align="right"><span class="options"
55 >[<a href="frames.html" target="_top">frames</a
56 >]&nbsp;|&nbsp;<a href="scriptutil.find-module.html"
57 target="_top">no&nbsp;frames</a>]</span></td></tr>
58 </table>
59 </td>
60 </tr>
61</table>
62<!-- ==================== MODULE DESCRIPTION ==================== -->
63<h1 class="epydoc">Module find</h1><p class="nomargin-top"><span class="codelink"><a href="scriptutil.find-pysrc.html">source&nbsp;code</a></span></p>
64<p>Functions commonly used in shell scripting:</p>
65 <ul>
66 <li>
67 find() : finds files in a directory tree
68 </li>
69 <li>
70 grep(): finds files in a directory tree and matches their content to
71 regular expressions
72 </li>
73 <li>
74 replace() : in-place search/replace of files in a directory tree with
75 regular expressions
76 </li>
77 <li>
78 pprint() : prints the results of the find()/grep() functions
79 </li>
80 </ul>
81 <p>Please see the <a
82 href="http://muharem.wordpress.com/2007/05/20/python-find-files-using-unix-shell-style-wildcards/"
83 target="_top">tutorial</a> as well as the documentation strings of the
84 particular functions for detailed information.</p>
85
86<!-- ==================== CLASSES ==================== -->
87<a name="section-Classes"></a>
88<table class="summary" border="1" cellpadding="3"
89 cellspacing="0" width="100%" bgcolor="white">
90<tr bgcolor="#70b0f0" class="table-header">
91 <td colspan="2" class="table-header">
92 <table border="0" cellpadding="0" cellspacing="0" width="100%">
93 <tr valign="top">
94 <td align="left"><span class="table-header">Classes</span></td>
95 <td align="right" valign="top"
96 ><span class="options">[<a href="#section-Classes"
97 class="privatelink" onclick="toggle_private();"
98 >hide private</a>]</span></td>
99 </tr>
100 </table>
101 </td>
102</tr>
103<tr>
104 <td width="15%" align="right" valign="top" class="summary">
105 <span class="summary-type">&nbsp;</span>
106 </td><td class="summary">
107 <a href="scriptutil.find.ScriptError-class.html" class="summary-name">ScriptError</a><br />
108 The exception raised in case of failures.
109 </td>
110 </tr>
111</table>
112<!-- ==================== FUNCTIONS ==================== -->
113<a name="section-Functions"></a>
114<table class="summary" border="1" cellpadding="3"
115 cellspacing="0" width="100%" bgcolor="white">
116<tr bgcolor="#70b0f0" class="table-header">
117 <td colspan="2" class="table-header">
118 <table border="0" cellpadding="0" cellspacing="0" width="100%">
119 <tr valign="top">
120 <td align="left"><span class="table-header">Functions</span></td>
121 <td align="right" valign="top"
122 ><span class="options">[<a href="#section-Functions"
123 class="privatelink" onclick="toggle_private();"
124 >hide private</a>]</span></td>
125 </tr>
126 </table>
127 </td>
128</tr>
129<tr>
130 <td width="15%" align="right" valign="top" class="summary">
131 <span class="summary-type">sequence</span>
132 </td><td class="summary">
133 <table width="100%" cellpadding="0" cellspacing="0" border="0">
134 <tr>
135 <td><span class="summary-sig"><a href="scriptutil.find-module.html#find" class="summary-sig-name">find</a>(<span class="summary-sig-arg">path</span>,
136 <span class="summary-sig-arg">shellglobs</span>=<span class="summary-sig-default">None</span>,
137 <span class="summary-sig-arg">namefs</span>=<span class="summary-sig-default">None</span>,
138 <span class="summary-sig-arg">relative</span>=<span class="summary-sig-default">True</span>)</span><br />
139 Find files in the directory tree starting at 'path' (filtered by Unix
140 shell-style wildcards ('shellglobs') and/or the functions in the
141 'namefs' sequence).</td>
142 <td align="right" valign="top">
143 <span class="codelink"><a href="scriptutil.find-pysrc.html#find">source&nbsp;code</a></span>
144
145 </td>
146 </tr>
147 </table>
148
149 </td>
150 </tr>
151<tr>
152 <td width="15%" align="right" valign="top" class="summary">
153 <span class="summary-type">dict</span>
154 </td><td class="summary">
155 <table width="100%" cellpadding="0" cellspacing="0" border="0">
156 <tr>
157 <td><span class="summary-sig"><a href="scriptutil.find-module.html#grep" class="summary-sig-name">grep</a>(<span class="summary-sig-arg">path</span>,
158 <span class="summary-sig-arg">regexl</span>,
159 <span class="summary-sig-arg">shellglobs</span>=<span class="summary-sig-default">None</span>,
160 <span class="summary-sig-arg">namefs</span>=<span class="summary-sig-default">None</span>,
161 <span class="summary-sig-arg">relative</span>=<span class="summary-sig-default">True</span>,
162 <span class="summary-sig-arg">linenums</span>=<span class="summary-sig-default">False</span>)</span><br />
163 Find files in the directory tree starting at 'path' (filtered by Unix
164 shell-style wildcards ('shellglobs') and/or the functions in the
165 'namefs' sequence) and search inside these.</td>
166 <td align="right" valign="top">
167 <span class="codelink"><a href="scriptutil.find-pysrc.html#grep">source&nbsp;code</a></span>
168
169 </td>
170 </tr>
171 </table>
172
173 </td>
174 </tr>
175<tr>
176 <td width="15%" align="right" valign="top" class="summary">
177 <span class="summary-type">number</span>
178 </td><td class="summary">
179 <table width="100%" cellpadding="0" cellspacing="0" border="0">
180 <tr>
181 <td><span class="summary-sig"><a href="scriptutil.find-module.html#replace" class="summary-sig-name">replace</a>(<span class="summary-sig-arg">path</span>,
182 <span class="summary-sig-arg">regexl</span>,
183 <span class="summary-sig-arg">shellglobs</span>=<span class="summary-sig-default">None</span>,
184 <span class="summary-sig-arg">namefs</span>=<span class="summary-sig-default">None</span>,
185 <span class="summary-sig-arg">bext</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">.bak</code><code class="variable-quote">'</code></span>)</span><br />
186 Find files in the directory tree starting at 'path' (filtered by Unix
187 shell-style wildcards ('shellglobs') and/or the functions in the
188 'namefs' sequence) and perform an in-place search/replace operation
189 on these.</td>
190 <td align="right" valign="top">
191 <span class="codelink"><a href="scriptutil.find-pysrc.html#replace">source&nbsp;code</a></span>
192
193 </td>
194 </tr>
195 </table>
196
197 </td>
198 </tr>
199<tr>
200 <td width="15%" align="right" valign="top" class="summary">
201 <span class="summary-type">&nbsp;</span>
202 </td><td class="summary">
203 <table width="100%" cellpadding="0" cellspacing="0" border="0">
204 <tr>
205 <td><span class="summary-sig"><a href="scriptutil.find-module.html#pprint" class="summary-sig-name">pprint</a>(<span class="summary-sig-arg">results</span>)</span><br />
206 Print the results of the find()/grep() functions.</td>
207 <td align="right" valign="top">
208 <span class="codelink"><a href="scriptutil.find-pysrc.html#pprint">source&nbsp;code</a></span>
209
210 </td>
211 </tr>
212 </table>
213
214 </td>
215 </tr>
216</table>
217<!-- ==================== VARIABLES ==================== -->
218<a name="section-Variables"></a>
219<table class="summary" border="1" cellpadding="3"
220 cellspacing="0" width="100%" bgcolor="white">
221<tr bgcolor="#70b0f0" class="table-header">
222 <td colspan="2" class="table-header">
223 <table border="0" cellpadding="0" cellspacing="0" width="100%">
224 <tr valign="top">
225 <td align="left"><span class="table-header">Variables</span></td>
226 <td align="right" valign="top"
227 ><span class="options">[<a href="#section-Variables"
228 class="privatelink" onclick="toggle_private();"
229 >hide private</a>]</span></td>
230 </tr>
231 </table>
232 </td>
233</tr>
234<tr>
235 <td width="15%" align="right" valign="top" class="summary">
236 <span class="summary-type">&nbsp;</span>
237 </td><td class="summary">
238 <a name="__package__"></a><span class="summary-name">__package__</span> = <code title="'scriptutil'"><code class="variable-quote">'</code><code class="variable-string">scriptutil</code><code class="variable-quote">'</code></code>
239 </td>
240 </tr>
241</table>
242<!-- ==================== FUNCTION DETAILS ==================== -->
243<a name="section-FunctionDetails"></a>
244<table class="details" border="1" cellpadding="3"
245 cellspacing="0" width="100%" bgcolor="white">
246<tr bgcolor="#70b0f0" class="table-header">
247 <td colspan="2" class="table-header">
248 <table border="0" cellpadding="0" cellspacing="0" width="100%">
249 <tr valign="top">
250 <td align="left"><span class="table-header">Function Details</span></td>
251 <td align="right" valign="top"
252 ><span class="options">[<a href="#section-FunctionDetails"
253 class="privatelink" onclick="toggle_private();"
254 >hide private</a>]</span></td>
255 </tr>
256 </table>
257 </td>
258</tr>
259</table>
260<a name="find"></a>
261<div>
262<table class="details" border="1" cellpadding="3"
263 cellspacing="0" width="100%" bgcolor="white">
264<tr><td>
265 <table width="100%" cellpadding="0" cellspacing="0" border="0">
266 <tr valign="top"><td>
267 <h3 class="epydoc"><span class="sig"><span class="sig-name">find</span>(<span class="sig-arg">path</span>,
268 <span class="sig-arg">shellglobs</span>=<span class="sig-default">None</span>,
269 <span class="sig-arg">namefs</span>=<span class="sig-default">None</span>,
270 <span class="sig-arg">relative</span>=<span class="sig-default">True</span>)</span>
271 </h3>
272 </td><td align="right" valign="top"
273 ><span class="codelink"><a href="scriptutil.find-pysrc.html#find">source&nbsp;code</a></span>&nbsp;
274 </td>
275 </tr></table>
276
277 <p>Find files in the directory tree starting at 'path' (filtered by Unix
278 shell-style wildcards ('shellglobs') and/or the functions in the 'namefs'
279 sequence).</p>
280 <p>Please not that the shell wildcards work in a cumulative fashion i.e.
281 each of them is applied to the full set of file *names* found.</p>
282 <p>Conversely, all the functions in 'namefs'</p>
283 <ul>
284 <li>
285 only get to see the output of their respective predecessor function
286 in the sequence (with the obvious exception of the first function)
287 </li>
288 <li>
289 are applied to the full file *path* (whereas the shell-style
290 wildcards are only applied to the file *names*)
291 </li>
292 </ul>
293 <dl class="fields">
294 <dt>Parameters:</dt>
295 <dd><ul class="nomargin-top">
296 <li><strong class="pname"><code>path</code></strong> (string) - starting path of the directory tree to be searched</li>
297 <li><strong class="pname"><code>shellglobs</code></strong> (sequence) - an optional sequence of Unix shell-style wildcards that are to be
298 applied to the file *names* found</li>
299 <li><strong class="pname"><code>namefs</code></strong> (sequence) - an optional sequence of functions to be applied to the file
300 *paths* found</li>
301 <li><strong class="pname"><code>relative</code></strong> (bool) - a boolean flag that determines whether absolute or relative paths
302 should be returned</li>
303 </ul></dd>
304 <dt>Returns: sequence</dt>
305 <dd>paths for files found</dd>
306 </dl>
307</td></tr></table>
308</div>
309<a name="grep"></a>
310<div>
311<table class="details" border="1" cellpadding="3"
312 cellspacing="0" width="100%" bgcolor="white">
313<tr><td>
314 <table width="100%" cellpadding="0" cellspacing="0" border="0">
315 <tr valign="top"><td>
316 <h3 class="epydoc"><span class="sig"><span class="sig-name">grep</span>(<span class="sig-arg">path</span>,
317 <span class="sig-arg">regexl</span>,
318 <span class="sig-arg">shellglobs</span>=<span class="sig-default">None</span>,
319 <span class="sig-arg">namefs</span>=<span class="sig-default">None</span>,
320 <span class="sig-arg">relative</span>=<span class="sig-default">True</span>,
321 <span class="sig-arg">linenums</span>=<span class="sig-default">False</span>)</span>
322 </h3>
323 </td><td align="right" valign="top"
324 ><span class="codelink"><a href="scriptutil.find-pysrc.html#grep">source&nbsp;code</a></span>&nbsp;
325 </td>
326 </tr></table>
327
328 <p>Find files in the directory tree starting at 'path' (filtered by Unix
329 shell-style wildcards ('shellglobs') and/or the functions in the 'namefs'
330 sequence) and search inside these.</p>
331 <p>Additionaly, the file content will be filtered by the regular
332 expressions in the 'regexl' sequence. Each entry in the latter is a</p>
333 <ul>
334 <li>
335 either a string (with the regex definition)
336 </li>
337 <li>
338 or a tuple with arguments accepted by re.compile() (the re.M and re.S
339 flags will have no effect though)
340 </li>
341 </ul>
342 <p>For all the files that pass the file name/content tests the function
343 returns a dictionary where the</p>
344 <ul>
345 <li>
346 key is the file name and the
347 </li>
348 <li>
349 value is a string with lines filtered by 'regexl'
350 </li>
351 </ul>
352 <dl class="fields">
353 <dt>Parameters:</dt>
354 <dd><ul class="nomargin-top">
355 <li><strong class="pname"><code>path</code></strong> (string) - starting path of the directory tree to be searched</li>
356 <li><strong class="pname"><code>shellglobs</code></strong> (sequence) - an optional sequence of Unix shell-style wildcards that are to be
357 applied to the file *names* found</li>
358 <li><strong class="pname"><code>namefs</code></strong> (sequence) - an optional sequence of functions to be applied to the file
359 *paths* found</li>
360 <li><strong class="pname"><code>relative</code></strong> (bool) - a boolean flag that determines whether absolute or relative paths
361 should be returned</li>
362 <li><strong class="pname"><code>linenums</code></strong> (bool) - turns on line numbers for found files (like grep -n)</li>
363 </ul></dd>
364 <dt>Returns: dict</dt>
365 <dd>file name (key) and lines filtered by 'regexl' (value)</dd>
366 </dl>
367</td></tr></table>
368</div>
369<a name="replace"></a>
370<div>
371<table class="details" border="1" cellpadding="3"
372 cellspacing="0" width="100%" bgcolor="white">
373<tr><td>
374 <table width="100%" cellpadding="0" cellspacing="0" border="0">
375 <tr valign="top"><td>
376 <h3 class="epydoc"><span class="sig"><span class="sig-name">replace</span>(<span class="sig-arg">path</span>,
377 <span class="sig-arg">regexl</span>,
378 <span class="sig-arg">shellglobs</span>=<span class="sig-default">None</span>,
379 <span class="sig-arg">namefs</span>=<span class="sig-default">None</span>,
380 <span class="sig-arg">bext</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">.bak</code><code class="variable-quote">'</code></span>)</span>
381 </h3>
382 </td><td align="right" valign="top"
383 ><span class="codelink"><a href="scriptutil.find-pysrc.html#replace">source&nbsp;code</a></span>&nbsp;
384 </td>
385 </tr></table>
386
387 <p>Find files in the directory tree starting at 'path' (filtered by Unix
388 shell-style wildcards ('shellglobs') and/or the functions in the 'namefs'
389 sequence) and perform an in-place search/replace operation on these.</p>
390 <p>Additionally, an in-place search/replace operation is performed on the
391 content of all the files (whose names passed the tests) using the regular
392 expressions in 'regexl'.</p>
393 <p>Please note: 'regexl' is a sequence of 3-tuples, each having the
394 following elements:</p>
395 <ul>
396 <li>
397 search string (Python regex syntax)
398 </li>
399 <li>
400 replace string (Python regex syntax)
401 </li>
402 <li>
403 regex flags or 'None' (re.compile syntax)
404 </li>
405 </ul>
406 <p>Copies of the modified files are saved in backup files using the
407 extension specified in 'bext'.</p>
408 <dl class="fields">
409 <dt>Parameters:</dt>
410 <dd><ul class="nomargin-top">
411 <li><strong class="pname"><code>path</code></strong> (string) - starting path of the directory tree to be searched</li>
412 <li><strong class="pname"><code>shellglobs</code></strong> (sequence) - an optional sequence of Unix shell-style wildcards that are to be
413 applied to the file *names* found</li>
414 <li><strong class="pname"><code>namefs</code></strong> (sequence) - an optional sequence of functions to be applied to the file
415 *paths* found</li>
416 </ul></dd>
417 <dt>Returns: number</dt>
418 <dd>total number of files modified</dd>
419 </dl>
420</td></tr></table>
421</div>
422<a name="pprint"></a>
423<div>
424<table class="details" border="1" cellpadding="3"
425 cellspacing="0" width="100%" bgcolor="white">
426<tr><td>
427 <table width="100%" cellpadding="0" cellspacing="0" border="0">
428 <tr valign="top"><td>
429 <h3 class="epydoc"><span class="sig"><span class="sig-name">pprint</span>(<span class="sig-arg">results</span>)</span>
430 </h3>
431 </td><td align="right" valign="top"
432 ><span class="codelink"><a href="scriptutil.find-pysrc.html#pprint">source&nbsp;code</a></span>&nbsp;
433 </td>
434 </tr></table>
435
436 <p>Print the results of the find()/grep() functions.</p>
437 <p>The output format is similar to the one used by the UNIX find
438 utility.</p>
439 <dl class="fields">
440 </dl>
441</td></tr></table>
442</div>
443<br />
444<!-- ==================== NAVIGATION BAR ==================== -->
445<table class="navbar" border="0" width="100%" cellpadding="0"
446 bgcolor="#a0c0ff" cellspacing="0">
447 <tr valign="middle">
448 <!-- Home link -->
449 <th>&nbsp;&nbsp;&nbsp;<a
450 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
451
452 <!-- Tree link -->
453 <th>&nbsp;&nbsp;&nbsp;<a
454 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
455
456 <!-- Index link -->
457 <th>&nbsp;&nbsp;&nbsp;<a
458 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
459
460 <!-- Help link -->
461 <th>&nbsp;&nbsp;&nbsp;<a
462 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
463
464 <!-- Project homepage -->
465 <th class="navbar" align="right" width="100%">
466 <table border="0" cellpadding="0" cellspacing="0">
467 <tr><th class="navbar" align="center"
468 ><a class="navbar" target="_top" href="https://launchpad.net/py-script">Project Homepage</a></th>
469 </tr></table></th>
470 </tr>
471</table>
472<table border="0" cellpadding="0" cellspacing="0" width="100%%">
473 <tr>
474 <td align="left" class="footer">
475 Generated by Epydoc 3.0.1 on Sat Dec 26 23:01:34 2009
476 </td>
477 <td align="right" class="footer">
478 <a target="mainFrame" href="http://epydoc.sourceforge.net"
479 >http://epydoc.sourceforge.net</a>
480 </td>
481 </tr>
482</table>
483
484<script type="text/javascript">
485 <!--
486 // Private objects are initially displayed (because if
487 // javascript is turned off then we want them to be
488 // visible); but by default, we want to hide them. So hide
489 // them unless we have a cookie that says to show them.
490 checkCookie();
491 // -->
492</script>
493</body>
494</html>
0495
=== added file 'doc/html/scriptutil.find-pysrc.html'
--- doc/html/scriptutil.find-pysrc.html 1970-01-01 00:00:00 +0000
+++ doc/html/scriptutil.find-pysrc.html 2009-12-26 22:06:14 +0000
@@ -0,0 +1,390 @@
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6 <title>scriptutil.find</title>
7 <link rel="stylesheet" href="epydoc.css" type="text/css" />
8 <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12 alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15 bgcolor="#a0c0ff" cellspacing="0">
16 <tr valign="middle">
17 <!-- Home link -->
18 <th>&nbsp;&nbsp;&nbsp;<a
19 href="scriptutil-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21 <!-- Tree link -->
22 <th>&nbsp;&nbsp;&nbsp;<a
23 href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25 <!-- Index link -->
26 <th>&nbsp;&nbsp;&nbsp;<a
27 href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29 <!-- Help link -->
30 <th>&nbsp;&nbsp;&nbsp;<a
31 href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33 <!-- Project homepage -->
34 <th class="navbar" align="right" width="100%">
35 <table border="0" cellpadding="0" cellspacing="0">
36 <tr><th class="navbar" align="center"
37 ><a class="navbar" target="_top" href="https://launchpad.net/py-script">Project Homepage</a></th>
38 </tr></table></th>
39 </tr>
40</table>
41<table width="100%" cellpadding="0" cellspacing="0">
42 <tr valign="top">
43 <td width="100%">
44 <span class="breadcrumbs">
45 <a href="scriptutil-module.html">Package&nbsp;scriptutil</a> ::
46 Script&nbsp;find
47 </span>
48 </td>
49 <td>
50 <table cellpadding="0" cellspacing="0">
51 <!-- hide/show private -->
52 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
53 onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
54 <tr><td align="right"><span class="options"
55 >[<a href="frames.html" target="_top">frames</a
56 >]&nbsp;|&nbsp;<a href="scriptutil.find-pysrc.html"
57 target="_top">no&nbsp;frames</a>]</span></td></tr>
58 </table>
59 </td>
60 </tr>
61</table>
62<h1 class="epydoc">Source Code for <a href="scriptutil.find-module.html">Script scriptutil.find</a></h1>
63<pre class="py-src">
64<a name="L1"></a><tt class="py-lineno"> 1</tt> <tt class="py-line"><tt class="py-comment">#!/usr/bin/env python</tt> </tt>
65<a name="L2"></a><tt class="py-lineno"> 2</tt> <tt class="py-line"><tt class="py-comment"># encoding: utf-8</tt> </tt>
66<a name="L3"></a><tt class="py-lineno"> 3</tt> <tt class="py-line"> </tt>
67<a name="L4"></a><tt class="py-lineno"> 4</tt> <tt class="py-line"> </tt>
68<a name="L5"></a><tt class="py-lineno"> 5</tt> <tt class="py-line"><tt class="py-comment"># This file is part of py-script (https://launchpad.net/py-script)</tt> </tt>
69<a name="L6"></a><tt class="py-lineno"> 6</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
70<a name="L7"></a><tt class="py-lineno"> 7</tt> <tt class="py-line"><tt class="py-comment"># Copyright (C) 2009 Muharem Hrnjadovic &lt;muharem@linux.com&gt;</tt> </tt>
71<a name="L8"></a><tt class="py-lineno"> 8</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
72<a name="L9"></a><tt class="py-lineno"> 9</tt> <tt class="py-line"><tt class="py-comment"># This program is free software; you can redistribute it and/or modify</tt> </tt>
73<a name="L10"></a><tt class="py-lineno"> 10</tt> <tt class="py-line"><tt class="py-comment"># it under the terms of the GNU General Public License as published by</tt> </tt>
74<a name="L11"></a><tt class="py-lineno"> 11</tt> <tt class="py-line"><tt class="py-comment"># the Free Software Foundation; either version 2 of the License, or</tt> </tt>
75<a name="L12"></a><tt class="py-lineno"> 12</tt> <tt class="py-line"><tt class="py-comment"># (at your option) any later version.</tt> </tt>
76<a name="L13"></a><tt class="py-lineno"> 13</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
77<a name="L14"></a><tt class="py-lineno"> 14</tt> <tt class="py-line"><tt class="py-comment"># This program is distributed in the hope that it will be useful,</tt> </tt>
78<a name="L15"></a><tt class="py-lineno"> 15</tt> <tt class="py-line"><tt class="py-comment"># but WITHOUT ANY WARRANTY; without even the implied warranty of</tt> </tt>
79<a name="L16"></a><tt class="py-lineno"> 16</tt> <tt class="py-line"><tt class="py-comment"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</tt> </tt>
80<a name="L17"></a><tt class="py-lineno"> 17</tt> <tt class="py-line"><tt class="py-comment"># GNU General Public License for more details.</tt> </tt>
81<a name="L18"></a><tt class="py-lineno"> 18</tt> <tt class="py-line"><tt class="py-comment">#</tt> </tt>
82<a name="L19"></a><tt class="py-lineno"> 19</tt> <tt class="py-line"><tt class="py-comment"># You should have received a copy of the GNU General Public License along</tt> </tt>
83<a name="L20"></a><tt class="py-lineno"> 20</tt> <tt class="py-line"><tt class="py-comment"># with this program; if not, write to the Free Software Foundation, Inc.,</tt> </tt>
84<a name="L21"></a><tt class="py-lineno"> 21</tt> <tt class="py-line"><tt class="py-comment"># 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.</tt> </tt>
85<a name="L22"></a><tt class="py-lineno"> 22</tt> <tt class="py-line"> </tt>
86<a name="L23"></a><tt class="py-lineno"> 23</tt> <tt class="py-line"> </tt>
87<a name="L24"></a><tt class="py-lineno"> 24</tt> <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
88<a name="L25"></a><tt class="py-lineno"> 25</tt> <tt class="py-line"><tt class="py-docstring">Functions commonly used in shell scripting:</tt> </tt>
89<a name="L26"></a><tt class="py-lineno"> 26</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
90<a name="L27"></a><tt class="py-lineno"> 27</tt> <tt class="py-line"><tt class="py-docstring"> - find() : finds files in a directory tree</tt> </tt>
91<a name="L28"></a><tt class="py-lineno"> 28</tt> <tt class="py-line"><tt class="py-docstring"> - grep(): finds files in a directory tree and matches their</tt> </tt>
92<a name="L29"></a><tt class="py-lineno"> 29</tt> <tt class="py-line"><tt class="py-docstring"> content to regular expressions</tt> </tt>
93<a name="L30"></a><tt class="py-lineno"> 30</tt> <tt class="py-line"><tt class="py-docstring"> - replace() : in-place search/replace of files in a directory tree</tt> </tt>
94<a name="L31"></a><tt class="py-lineno"> 31</tt> <tt class="py-line"><tt class="py-docstring"> with regular expressions</tt> </tt>
95<a name="L32"></a><tt class="py-lineno"> 32</tt> <tt class="py-line"><tt class="py-docstring"> - pprint() : prints the results of the find()/grep() functions</tt> </tt>
96<a name="L33"></a><tt class="py-lineno"> 33</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
97<a name="L34"></a><tt class="py-lineno"> 34</tt> <tt class="py-line"><tt class="py-docstring">Please see the U{tutorial &lt;http://muharem.wordpress.com/2007/05/20/python-find-files-using-unix-shell-style-wildcards/&gt;} as well as the documentation strings of the particular functions for detailed information.</tt> </tt>
98<a name="L35"></a><tt class="py-lineno"> 35</tt> <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
99<a name="L36"></a><tt class="py-lineno"> 36</tt> <tt class="py-line"> </tt>
100<a name="L37"></a><tt class="py-lineno"> 37</tt> <tt class="py-line"> </tt>
101<a name="L38"></a><tt class="py-lineno"> 38</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">fnmatch</tt> </tt>
102<a name="L39"></a><tt class="py-lineno"> 39</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">itertools</tt> </tt>
103<a name="L40"></a><tt class="py-lineno"> 40</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">os</tt> </tt>
104<a name="L41"></a><tt class="py-lineno"> 41</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">sys</tt> </tt>
105<a name="L42"></a><tt class="py-lineno"> 42</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">re</tt> </tt>
106<a name="L43"></a><tt class="py-lineno"> 43</tt> <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">types</tt> </tt>
107<a name="L44"></a><tt class="py-lineno"> 44</tt> <tt class="py-line"> </tt>
108<a name="L45"></a><tt class="py-lineno"> 45</tt> <tt class="py-line"> </tt>
109<a name="ScriptError"></a><div id="ScriptError-def"><a name="L46"></a><tt class="py-lineno"> 46</tt> <a class="py-toggle" href="#" id="ScriptError-toggle" onclick="return toggle('ScriptError');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="scriptutil.find.ScriptError-class.html">ScriptError</a><tt class="py-op">(</tt><tt class="py-base-class">Exception</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
110</div><div id="ScriptError-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="ScriptError-expanded"><a name="L47"></a><tt class="py-lineno"> 47</tt> <tt class="py-line"> <tt class="py-docstring">"""The exception raised in case of failures."""</tt> </tt>
111</div><a name="L48"></a><tt class="py-lineno"> 48</tt> <tt class="py-line"> </tt>
112<a name="L49"></a><tt class="py-lineno"> 49</tt> <tt class="py-line"> </tt>
113<a name="find"></a><div id="find-def"><a name="L50"></a><tt class="py-lineno"> 50</tt> <a class="py-toggle" href="#" id="find-toggle" onclick="return toggle('find');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="scriptutil.find-module.html#find">find</a><tt class="py-op">(</tt><tt class="py-param">path</tt><tt class="py-op">,</tt> <tt class="py-param">shellglobs</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">namefs</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">relative</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
114</div><div id="find-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="find-expanded"><a name="L51"></a><tt class="py-lineno"> 51</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
115<a name="L52"></a><tt class="py-lineno"> 52</tt> <tt class="py-line"><tt class="py-docstring"> Find files in the directory tree starting at 'path' (filtered by</tt> </tt>
116<a name="L53"></a><tt class="py-lineno"> 53</tt> <tt class="py-line"><tt class="py-docstring"> Unix shell-style wildcards ('shellglobs') and/or the functions in</tt> </tt>
117<a name="L54"></a><tt class="py-lineno"> 54</tt> <tt class="py-line"><tt class="py-docstring"> the 'namefs' sequence).</tt> </tt>
118<a name="L55"></a><tt class="py-lineno"> 55</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
119<a name="L56"></a><tt class="py-lineno"> 56</tt> <tt class="py-line"><tt class="py-docstring"> Please not that the shell wildcards work in a cumulative fashion</tt> </tt>
120<a name="L57"></a><tt class="py-lineno"> 57</tt> <tt class="py-line"><tt class="py-docstring"> i.e. each of them is applied to the full set of file *names* found.</tt> </tt>
121<a name="L58"></a><tt class="py-lineno"> 58</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
122<a name="L59"></a><tt class="py-lineno"> 59</tt> <tt class="py-line"><tt class="py-docstring"> Conversely, all the functions in 'namefs'</tt> </tt>
123<a name="L60"></a><tt class="py-lineno"> 60</tt> <tt class="py-line"><tt class="py-docstring"> - only get to see the output of their respective predecessor</tt> </tt>
124<a name="L61"></a><tt class="py-lineno"> 61</tt> <tt class="py-line"><tt class="py-docstring"> function in the sequence (with the obvious exception of the</tt> </tt>
125<a name="L62"></a><tt class="py-lineno"> 62</tt> <tt class="py-line"><tt class="py-docstring"> first function)</tt> </tt>
126<a name="L63"></a><tt class="py-lineno"> 63</tt> <tt class="py-line"><tt class="py-docstring"> - are applied to the full file *path* (whereas the shell-style</tt> </tt>
127<a name="L64"></a><tt class="py-lineno"> 64</tt> <tt class="py-line"><tt class="py-docstring"> wildcards are only applied to the file *names*)</tt> </tt>
128<a name="L65"></a><tt class="py-lineno"> 65</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
129<a name="L66"></a><tt class="py-lineno"> 66</tt> <tt class="py-line"><tt class="py-docstring"> @type path: string</tt> </tt>
130<a name="L67"></a><tt class="py-lineno"> 67</tt> <tt class="py-line"><tt class="py-docstring"> @param path: starting path of the directory tree to be searched</tt> </tt>
131<a name="L68"></a><tt class="py-lineno"> 68</tt> <tt class="py-line"><tt class="py-docstring"> @type shellglobs: sequence</tt> </tt>
132<a name="L69"></a><tt class="py-lineno"> 69</tt> <tt class="py-line"><tt class="py-docstring"> @param shellglobs: an optional sequence of Unix shell-style wildcards</tt> </tt>
133<a name="L70"></a><tt class="py-lineno"> 70</tt> <tt class="py-line"><tt class="py-docstring"> that are to be applied to the file *names* found</tt> </tt>
134<a name="L71"></a><tt class="py-lineno"> 71</tt> <tt class="py-line"><tt class="py-docstring"> @type namefs: sequence</tt> </tt>
135<a name="L72"></a><tt class="py-lineno"> 72</tt> <tt class="py-line"><tt class="py-docstring"> @param namefs: an optional sequence of functions to be applied to the</tt> </tt>
136<a name="L73"></a><tt class="py-lineno"> 73</tt> <tt class="py-line"><tt class="py-docstring"> file *paths* found</tt> </tt>
137<a name="L74"></a><tt class="py-lineno"> 74</tt> <tt class="py-line"><tt class="py-docstring"> @type relative: bool</tt> </tt>
138<a name="L75"></a><tt class="py-lineno"> 75</tt> <tt class="py-line"><tt class="py-docstring"> @param relative: a boolean flag that determines whether absolute or</tt> </tt>
139<a name="L76"></a><tt class="py-lineno"> 76</tt> <tt class="py-line"><tt class="py-docstring"> relative paths should be returned</tt> </tt>
140<a name="L77"></a><tt class="py-lineno"> 77</tt> <tt class="py-line"><tt class="py-docstring"> @rtype: sequence</tt> </tt>
141<a name="L78"></a><tt class="py-lineno"> 78</tt> <tt class="py-line"><tt class="py-docstring"> @return: paths for files found</tt> </tt>
142<a name="L79"></a><tt class="py-lineno"> 79</tt> <tt class="py-line"><tt class="py-docstring"> """</tt> </tt>
143<a name="L80"></a><tt class="py-lineno"> 80</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">access</tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">R_OK</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
144<a name="L81"></a><tt class="py-lineno"> 81</tt> <tt class="py-line"> <tt class="py-keyword">raise</tt> <tt id="link-0" class="py-name" targets="Class scriptutil.find.ScriptError=scriptutil.find.ScriptError-class.html"><a title="scriptutil.find.ScriptError" class="py-name" href="#" onclick="return doclink('link-0', 'ScriptError', 'link-0');">ScriptError</a></tt><tt class="py-op">(</tt><tt class="py-string">"cannot access path: '%s'"</tt> <tt class="py-op">%</tt> <tt class="py-name">path</tt><tt class="py-op">)</tt> </tt>
145<a name="L82"></a><tt class="py-lineno"> 82</tt> <tt class="py-line"> </tt>
146<a name="L83"></a><tt class="py-lineno"> 83</tt> <tt class="py-line"> <tt class="py-name">fileList</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> <tt class="py-comment"># result list</tt> </tt>
147<a name="L84"></a><tt class="py-lineno"> 84</tt> <tt class="py-line"> <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
148<a name="L85"></a><tt class="py-lineno"> 85</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">dir</tt><tt class="py-op">,</tt> <tt class="py-name">subdirs</tt><tt class="py-op">,</tt> <tt class="py-name">files</tt> <tt class="py-keyword">in</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">walk</tt><tt class="py-op">(</tt><tt class="py-name">path</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
149<a name="L86"></a><tt class="py-lineno"> 86</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">shellglobs</tt><tt class="py-op">:</tt> </tt>
150<a name="L87"></a><tt class="py-lineno"> 87</tt> <tt class="py-line"> <tt class="py-name">matched</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
151<a name="L88"></a><tt class="py-lineno"> 88</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">pattern</tt> <tt class="py-keyword">in</tt> <tt class="py-name">shellglobs</tt><tt class="py-op">:</tt> </tt>
152<a name="L89"></a><tt class="py-lineno"> 89</tt> <tt class="py-line"> <tt class="py-name">filterf</tt> <tt class="py-op">=</tt> <tt class="py-keyword">lambda</tt> <tt class="py-name">s</tt><tt class="py-op">:</tt> <tt class="py-name">fnmatch</tt><tt class="py-op">.</tt><tt class="py-name">fnmatchcase</tt><tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">,</tt> <tt class="py-name">pattern</tt><tt class="py-op">)</tt> </tt>
153<a name="L90"></a><tt class="py-lineno"> 90</tt> <tt class="py-line"> <tt class="py-name">matched</tt><tt class="py-op">.</tt><tt class="py-name">extend</tt><tt class="py-op">(</tt><tt class="py-name">filter</tt><tt class="py-op">(</tt><tt class="py-name">filterf</tt><tt class="py-op">,</tt> <tt class="py-name">files</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
154<a name="L91"></a><tt class="py-lineno"> 91</tt> <tt class="py-line"> <tt class="py-name">fileList</tt><tt class="py-op">.</tt><tt class="py-name">extend</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-string">'%s%s%s'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">dir</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">sep</tt><tt class="py-op">,</tt> <tt class="py-name">f</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">f</tt> <tt class="py-keyword">in</tt> <tt class="py-name">matched</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
155<a name="L92"></a><tt class="py-lineno"> 92</tt> <tt class="py-line"> <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
156<a name="L93"></a><tt class="py-lineno"> 93</tt> <tt class="py-line"> <tt class="py-name">fileList</tt><tt class="py-op">.</tt><tt class="py-name">extend</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-string">'%s%s%s'</tt> <tt class="py-op">%</tt> <tt class="py-op">(</tt><tt class="py-name">dir</tt><tt class="py-op">,</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">sep</tt><tt class="py-op">,</tt> <tt class="py-name">f</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">f</tt> <tt class="py-keyword">in</tt> <tt class="py-name">files</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
157<a name="L94"></a><tt class="py-lineno"> 94</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-keyword">not</tt> <tt class="py-name">relative</tt><tt class="py-op">:</tt> <tt class="py-name">fileList</tt> <tt class="py-op">=</tt> <tt class="py-name">map</tt><tt class="py-op">(</tt><tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">abspath</tt><tt class="py-op">,</tt> <tt class="py-name">fileList</tt><tt class="py-op">)</tt> </tt>
158<a name="L95"></a><tt class="py-lineno"> 95</tt> <tt class="py-line"> <tt class="py-keyword">if</tt> <tt class="py-name">namefs</tt><tt class="py-op">:</tt> </tt>
159<a name="L96"></a><tt class="py-lineno"> 96</tt> <tt class="py-line"> <tt class="py-keyword">for</tt> <tt class="py-name">ff</tt> <tt class="py-keyword">in</tt> <tt class="py-name">namefs</tt><tt class="py-op">:</tt> <tt class="py-name">fileList</tt> <tt class="py-op">=</tt> <tt class="py-name">filter</tt><tt class="py-op">(</tt><tt class="py-name">ff</tt><tt class="py-op">,</tt> <tt class="py-name">fileList</tt><tt class="py-op">)</tt> </tt>
160<a name="L97"></a><tt class="py-lineno"> 97</tt> <tt class="py-line"> <tt class="py-keyword">except</tt> <tt class="py-name">Exception</tt><tt class="py-op">,</tt> <tt class="py-name">e</tt><tt class="py-op">:</tt> <tt class="py-keyword">raise</tt> <tt id="link-1" class="py-name"><a title="scriptutil.find.ScriptError" class="py-name" href="#" onclick="return doclink('link-1', 'ScriptError', 'link-0');">ScriptError</a></tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">e</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
161<a name="L98"></a><tt class="py-lineno"> 98</tt> <tt class="py-line"> <tt class="py-keyword">return</tt><tt class="py-op">(</tt><tt class="py-name">fileList</tt><tt class="py-op">)</tt> </tt>
162</div><a name="L99"></a><tt class="py-lineno"> 99</tt> <tt class="py-line"> </tt>
163<a name="L100"></a><tt class="py-lineno">100</tt> <tt class="py-line"> </tt>
164<a name="grep"></a><div id="grep-def"><a name="L101"></a><tt class="py-lineno">101</tt> <a class="py-toggle" href="#" id="grep-toggle" onclick="return toggle('grep');">-</a><tt class="py-line"><tt class="py-keyword">def</tt> <a class="py-def-name" href="scriptutil.find-module.html#grep">grep</a><tt class="py-op">(</tt><tt class="py-param">path</tt><tt class="py-op">,</tt> <tt class="py-param">regexl</tt><tt class="py-op">,</tt> <tt class="py-param">shellglobs</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">namefs</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> </tt>
165<a name="L102"></a><tt class="py-lineno">102</tt> <tt class="py-line"> <tt class="py-param">relative</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt> <tt class="py-param">linenums</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
166</div><div id="grep-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="grep-expanded"><a name="L103"></a><tt class="py-lineno">103</tt> <tt class="py-line"> <tt class="py-docstring">"""</tt> </tt>
167<a name="L104"></a><tt class="py-lineno">104</tt> <tt class="py-line"><tt class="py-docstring"> Find files in the directory tree starting at 'path' (filtered by</tt> </tt>
168<a name="L105"></a><tt class="py-lineno">105</tt> <tt class="py-line"><tt class="py-docstring"> Unix shell-style wildcards ('shellglobs') and/or the functions in</tt> </tt>
169<a name="L106"></a><tt class="py-lineno">106</tt> <tt class="py-line"><tt class="py-docstring"> the 'namefs' sequence) and search inside these.</tt> </tt>
170<a name="L107"></a><tt class="py-lineno">107</tt> <tt class="py-line"><tt class="py-docstring"></tt> </tt>
171<a name="L108"></a><tt class="py-lineno">108</tt> <tt class="py-line"><tt class="py-docstring"> Additionaly, the file content will be filtered by the regular</tt> </tt>
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: