|
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>pathaddition.relative</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 |
|
18 <!-- Tree link --> |
|
19 <th> <a |
|
20 href="module-tree.html">Trees</a> </th> |
|
21 |
|
22 <!-- Index link --> |
|
23 <th> <a |
|
24 href="identifier-index.html">Indices</a> </th> |
|
25 |
|
26 <!-- Help link --> |
|
27 <th> <a |
|
28 href="help.html">Help</a> </th> |
|
29 |
|
30 <th class="navbar" width="100%"></th> |
|
31 </tr> |
|
32 </table> |
|
33 <table width="100%" cellpadding="0" cellspacing="0"> |
|
34 <tr valign="top"> |
|
35 <td width="100%"> |
|
36 <span class="breadcrumbs"> |
|
37 <a href="pathaddition-module.html">Package pathaddition</a> :: |
|
38 Module relative |
|
39 </span> |
|
40 </td> |
|
41 <td> |
|
42 <table cellpadding="0" cellspacing="0"> |
|
43 <!-- hide/show private --> |
|
44 <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" |
|
45 onclick="toggle_private();">hide private</a>]</span></td></tr> |
|
46 <tr><td align="right"><span class="options" |
|
47 >[<a href="frames.html" target="_top">frames</a |
|
48 >] | <a href="pathaddition.relative-module.html" |
|
49 target="_top">no frames</a>]</span></td></tr> |
|
50 </table> |
|
51 </td> |
|
52 </tr> |
|
53 </table> |
|
54 <!-- ==================== MODULE DESCRIPTION ==================== --> |
|
55 <h1 class="epydoc">Module relative</h1><span class="codelink"><a href="pathaddition.relative-pysrc.html">source code</a></span><br /><br /> |
|
56 Additional path functionnality. |
|
57 abs2rel |
|
58 rel2abs<br /><br /> |
|
59 |
|
60 <!-- ==================== FUNCTIONS ==================== --> |
|
61 <a name="section-Functions"></a> |
|
62 <table class="summary" border="1" cellpadding="3" |
|
63 cellspacing="0" width="100%" bgcolor="white"> |
|
64 <tr bgcolor="#70b0f0" class="table-header"> |
|
65 <td colspan="2" class="table-header"> |
|
66 <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
|
67 <tr valign="top"> |
|
68 <td align="left"><span class="table-header">Functions</span></td> |
|
69 <td align="right" valign="top" |
|
70 ><span class="options">[<a href="#section-Functions" |
|
71 class="privatelink" onclick="toggle_private();" |
|
72 >hide private</a>]</span></td> |
|
73 </tr> |
|
74 </table> |
|
75 </td> |
|
76 </tr> |
|
77 <tr> |
|
78 <td width="15%" align="right" valign="top" class="summary"> |
|
79 <span class="summary-type"> </span> |
|
80 </td><td class="summary"> |
|
81 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
82 <tr> |
|
83 <td><span class="summary-sig"><a name="isabs"></a><span class="summary-sig-name">isabs</span>(<span class="summary-sig-arg">string</span>)</span><br /> |
|
84 @return true if string is an absolute path or protocoladdress |
|
85 for addresses beginning in <a class="rst-reference external" href="http://" target="_top">http://</a> or <a class="rst-reference external" href="ftp://" target="_top">ftp://</a> or <a class="rst-reference external" href="ldap://" target="_top">ldap://</a> - |
|
86 they are considered "absolute" paths.</td> |
|
87 <td align="right" valign="top"> |
|
88 <span class="codelink"><a href="pathaddition.relative-pysrc.html#isabs">source code</a></span> |
|
89 |
|
90 </td> |
|
91 </tr> |
|
92 </table> |
|
93 |
|
94 </td> |
|
95 </tr> |
|
96 <tr> |
|
97 <td width="15%" align="right" valign="top" class="summary"> |
|
98 <span class="summary-type"> </span> |
|
99 </td><td class="summary"> |
|
100 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
101 <tr> |
|
102 <td><span class="summary-sig"><a href="pathaddition.relative-module.html#rel2abs" class="summary-sig-name">rel2abs</a>(<span class="summary-sig-arg">path</span>, |
|
103 <span class="summary-sig-arg">base</span>=<span class="summary-sig-default">None</span>)</span><br /> |
|
104 converts a relative path to an absolute path.</td> |
|
105 <td align="right" valign="top"> |
|
106 <span class="codelink"><a href="pathaddition.relative-pysrc.html#rel2abs">source code</a></span> |
|
107 |
|
108 </td> |
|
109 </tr> |
|
110 </table> |
|
111 |
|
112 </td> |
|
113 </tr> |
|
114 <tr> |
|
115 <td width="15%" align="right" valign="top" class="summary"> |
|
116 <span class="summary-type"> </span> |
|
117 </td><td class="summary"> |
|
118 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
119 <tr> |
|
120 <td><span class="summary-sig"><a name="pathsplit"></a><span class="summary-sig-name">pathsplit</span>(<span class="summary-sig-arg">p</span>, |
|
121 <span class="summary-sig-arg">rest</span>=<span class="summary-sig-default">None</span>)</span><br /> |
|
122 Split path to pieces</td> |
|
123 <td align="right" valign="top"> |
|
124 <span class="codelink"><a href="pathaddition.relative-pysrc.html#pathsplit">source code</a></span> |
|
125 |
|
126 </td> |
|
127 </tr> |
|
128 </table> |
|
129 |
|
130 </td> |
|
131 </tr> |
|
132 <tr> |
|
133 <td width="15%" align="right" valign="top" class="summary"> |
|
134 <span class="summary-type"> </span> |
|
135 </td><td class="summary"> |
|
136 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
137 <tr> |
|
138 <td><span class="summary-sig"><a name="commonpath"></a><span class="summary-sig-name">commonpath</span>(<span class="summary-sig-arg">l1</span>, |
|
139 <span class="summary-sig-arg">l2</span>, |
|
140 <span class="summary-sig-arg">common</span>=<span class="summary-sig-default">None</span>)</span><br /> |
|
141 return the common path</td> |
|
142 <td align="right" valign="top"> |
|
143 <span class="codelink"><a href="pathaddition.relative-pysrc.html#commonpath">source 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"> </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 name="relpath"></a><span class="summary-sig-name">relpath</span>(<span class="summary-sig-arg">p1</span>, |
|
158 <span class="summary-sig-arg">p2</span>)</span></td> |
|
159 <td align="right" valign="top"> |
|
160 <span class="codelink"><a href="pathaddition.relative-pysrc.html#relpath">source code</a></span> |
|
161 |
|
162 </td> |
|
163 </tr> |
|
164 </table> |
|
165 |
|
166 </td> |
|
167 </tr> |
|
168 <tr> |
|
169 <td width="15%" align="right" valign="top" class="summary"> |
|
170 <span class="summary-type"> </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="pathaddition.relative-module.html#abs2rel" class="summary-sig-name">abs2rel</a>(<span class="summary-sig-arg">path</span>, |
|
175 <span class="summary-sig-arg">base</span>=<span class="summary-sig-default">None</span>)</span><br /> |
|
176 @return a relative path from base to path.</td> |
|
177 <td align="right" valign="top"> |
|
178 <span class="codelink"><a href="pathaddition.relative-pysrc.html#abs2rel">source code</a></span> |
|
179 |
|
180 </td> |
|
181 </tr> |
|
182 </table> |
|
183 |
|
184 </td> |
|
185 </tr> |
|
186 <tr> |
|
187 <td width="15%" align="right" valign="top" class="summary"> |
|
188 <span class="summary-type"> </span> |
|
189 </td><td class="summary"> |
|
190 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
191 <tr> |
|
192 <td><span class="summary-sig"><a name="commonprefix"></a><span class="summary-sig-name">commonprefix</span>(<span class="summary-sig-arg">paths</span>)</span><br /> |
|
193 Returns the common prefix base on the path components.</td> |
|
194 <td align="right" valign="top"> |
|
195 <span class="codelink"><a href="pathaddition.relative-pysrc.html#commonprefix">source code</a></span> |
|
196 |
|
197 </td> |
|
198 </tr> |
|
199 </table> |
|
200 |
|
201 </td> |
|
202 </tr> |
|
203 </table> |
|
204 <!-- ==================== VARIABLES ==================== --> |
|
205 <a name="section-Variables"></a> |
|
206 <table class="summary" border="1" cellpadding="3" |
|
207 cellspacing="0" width="100%" bgcolor="white"> |
|
208 <tr bgcolor="#70b0f0" class="table-header"> |
|
209 <td colspan="2" class="table-header"> |
|
210 <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
|
211 <tr valign="top"> |
|
212 <td align="left"><span class="table-header">Variables</span></td> |
|
213 <td align="right" valign="top" |
|
214 ><span class="options">[<a href="#section-Variables" |
|
215 class="privatelink" onclick="toggle_private();" |
|
216 >hide private</a>]</span></td> |
|
217 </tr> |
|
218 </table> |
|
219 </td> |
|
220 </tr> |
|
221 <tr> |
|
222 <td width="15%" align="right" valign="top" class="summary"> |
|
223 <span class="summary-type"> </span> |
|
224 </td><td class="summary"> |
|
225 <a name="protocolPattern"></a><span class="summary-name">protocolPattern</span> = <code title="re.compile(r'^\w+://')">re.compile(r'^\w+://')</code> |
|
226 </td> |
|
227 </tr> |
|
228 </table> |
|
229 <!-- ==================== FUNCTION DETAILS ==================== --> |
|
230 <a name="section-FunctionDetails"></a> |
|
231 <table class="details" border="1" cellpadding="3" |
|
232 cellspacing="0" width="100%" bgcolor="white"> |
|
233 <tr bgcolor="#70b0f0" class="table-header"> |
|
234 <td colspan="2" class="table-header"> |
|
235 <table border="0" cellpadding="0" cellspacing="0" width="100%"> |
|
236 <tr valign="top"> |
|
237 <td align="left"><span class="table-header">Function Details</span></td> |
|
238 <td align="right" valign="top" |
|
239 ><span class="options">[<a href="#section-FunctionDetails" |
|
240 class="privatelink" onclick="toggle_private();" |
|
241 >hide private</a>]</span></td> |
|
242 </tr> |
|
243 </table> |
|
244 </td> |
|
245 </tr> |
|
246 </table> |
|
247 <a name="rel2abs"></a> |
|
248 <div> |
|
249 <table class="details" border="1" cellpadding="3" |
|
250 cellspacing="0" width="100%" bgcolor="white"> |
|
251 <tr><td> |
|
252 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
253 <tr valign="top"><td> |
|
254 <h3 class="epydoc"><span class="sig"><span class="sig-name">rel2abs</span>(<span class="sig-arg">path</span>, |
|
255 <span class="sig-arg">base</span>=<span class="sig-default">None</span>)</span> |
|
256 </h3> |
|
257 </td><td align="right" valign="top" |
|
258 ><span class="codelink"><a href="pathaddition.relative-pysrc.html#rel2abs">source code</a></span> |
|
259 </td> |
|
260 </table> |
|
261 |
|
262 <p>converts a relative path to an absolute path.</p> |
|
263 <p>@param path the path to convert - if already absolute, is returned |
|
264 without conversion. |
|
265 @param base - optional. Defaults to the current directory. |
|
266 The base is intelligently concatenated to the given relative path. |
|
267 @return the relative path of path from base</p> |
|
268 <dl class="fields"> |
|
269 </dl> |
|
270 </td></tr></table> |
|
271 </div> |
|
272 <a name="abs2rel"></a> |
|
273 <div> |
|
274 <table class="details" border="1" cellpadding="3" |
|
275 cellspacing="0" width="100%" bgcolor="white"> |
|
276 <tr><td> |
|
277 <table width="100%" cellpadding="0" cellspacing="0" border="0"> |
|
278 <tr valign="top"><td> |
|
279 <h3 class="epydoc"><span class="sig"><span class="sig-name">abs2rel</span>(<span class="sig-arg">path</span>, |
|
280 <span class="sig-arg">base</span>=<span class="sig-default">None</span>)</span> |
|
281 </h3> |
|
282 </td><td align="right" valign="top" |
|
283 ><span class="codelink"><a href="pathaddition.relative-pysrc.html#abs2rel">source code</a></span> |
|
284 </td> |
|
285 </table> |
|
286 |
|
287 <p>@return a relative path from base to path.</p> |
|
288 <p>base can be absolute, or relative to curdir, or defaults |
|
289 to curdir.</p> |
|
290 <dl class="fields"> |
|
291 </dl> |
|
292 </td></tr></table> |
|
293 </div> |
|
294 <br /> |
|
295 <!-- ==================== NAVIGATION BAR ==================== --> |
|
296 <table class="navbar" border="0" width="100%" cellpadding="0" |
|
297 bgcolor="#a0c0ff" cellspacing="0"> |
|
298 <tr valign="middle"> |
|
299 |
|
300 <!-- Tree link --> |
|
301 <th> <a |
|
302 href="module-tree.html">Trees</a> </th> |
|
303 |
|
304 <!-- Index link --> |
|
305 <th> <a |
|
306 href="identifier-index.html">Indices</a> </th> |
|
307 |
|
308 <!-- Help link --> |
|
309 <th> <a |
|
310 href="help.html">Help</a> </th> |
|
311 |
|
312 <th class="navbar" width="100%"></th> |
|
313 </tr> |
|
314 </table> |
|
315 <table border="0" cellpadding="0" cellspacing="0" width="100%%"> |
|
316 <tr> |
|
317 <td align="left" class="footer"> |
|
318 Generated by Epydoc 3.0beta1 on Wed Sep 09 13:44:16 2009 |
|
319 </td> |
|
320 <td align="right" class="footer"> |
|
321 <a href="http://epydoc.sourceforge.net">http://epydoc.sourceforge.net</a> |
|
322 </td> |
|
323 </tr> |
|
324 </table> |
|
325 |
|
326 <script type="text/javascript"> |
|
327 <!-- |
|
328 // Private objects are initially displayed (because if |
|
329 // javascript is turned off then we want them to be |
|
330 // visible); but by default, we want to hide them. So hide |
|
331 // them unless we have a cookie that says to show them. |
|
332 checkCookie() |
|
333 // --> |
|
334 </script> |
|
335 |
|
336 </body> |
|
337 </html> |