Show More
@@ -59,17 +59,17 b' def full_path(startPath,files):' | |||
|
59 | 59 | """Make full paths for all the listed files, based on startPath. |
|
60 | 60 | |
|
61 | 61 | Only the base part of startPath is kept, since this routine is typically |
|
62 |
used with a script's __file__ variable as startPath. |
|
|
62 | used with a script's ``__file__`` variable as startPath. The base of startPath | |
|
63 | 63 | is then prepended to all the listed files, forming the output list. |
|
64 | 64 | |
|
65 | 65 | Parameters |
|
66 | 66 | ---------- |
|
67 |
|
|
|
68 |
|
|
|
67 | startPath : string | |
|
68 | Initial path to use as the base for the results. This path is split | |
|
69 | 69 | using os.path.split() and only its first component is kept. |
|
70 | 70 | |
|
71 |
|
|
|
72 |
|
|
|
71 | files : string or list | |
|
72 | One or more files. | |
|
73 | 73 | |
|
74 | 74 | Examples |
|
75 | 75 | -------- |
@@ -80,9 +80,10 b' def full_path(startPath,files):' | |||
|
80 | 80 | >>> full_path('/foo',['a.txt','b.txt']) |
|
81 | 81 | ['/a.txt', '/b.txt'] |
|
82 | 82 | |
|
83 | If a single file is given, the output is still a list: | |
|
84 | >>> full_path('/foo','a.txt') | |
|
85 | ['/a.txt'] | |
|
83 | If a single file is given, the output is still a list:: | |
|
84 | ||
|
85 | >>> full_path('/foo','a.txt') | |
|
86 | ['/a.txt'] | |
|
86 | 87 | """ |
|
87 | 88 | |
|
88 | 89 | files = list_strings(files) |
@@ -105,7 +106,8 b' def parse_test_output(txt):' | |||
|
105 | 106 | |
|
106 | 107 | Returns |
|
107 | 108 | ------- |
|
108 | nerr, nfail: number of errors and failures. | |
|
109 | nerr, nfail | |
|
110 | number of errors and failures. | |
|
109 | 111 | """ |
|
110 | 112 | |
|
111 | 113 | err_m = re.search(r'^FAILED \(errors=(\d+)\)', txt, re.MULTILINE) |
@@ -48,8 +48,9 b' color_templates = (' | |||
|
48 | 48 | def make_color_table(in_class): |
|
49 | 49 | """Build a set of color attributes in a class. |
|
50 | 50 | |
|
51 |
Helper function for building the |
|
|
52 | ||
|
51 | Helper function for building the :class:`TermColors` and | |
|
52 | :class`InputTermColors`. | |
|
53 | """ | |
|
53 | 54 | for name,value in color_templates: |
|
54 | 55 | setattr(in_class,name,in_class._base % value) |
|
55 | 56 |
@@ -110,10 +110,10 b' class SList(list):' | |||
|
110 | 110 | |
|
111 | 111 | These are normal lists, but with the special attributes: |
|
112 | 112 | |
|
113 |
|
|
|
114 |
|
|
|
115 |
|
|
|
116 |
|
|
|
113 | * .l (or .list) : value as list (the list itself). | |
|
114 | * .n (or .nlstr): value as a string, joined on newlines. | |
|
115 | * .s (or .spstr): value as a string, joined on spaces. | |
|
116 | * .p (or .paths): list of path objects | |
|
117 | 117 | |
|
118 | 118 | Any values which require transformations are computed only once and |
|
119 | 119 | cached.""" |
@@ -191,13 +191,14 b' class SList(list):' | |||
|
191 | 191 | Allows quick awk-like usage of string lists. |
|
192 | 192 | |
|
193 | 193 | Example data (in var a, created by 'a = !ls -l'):: |
|
194 | ||
|
194 | 195 | -rwxrwxrwx 1 ville None 18 Dec 14 2006 ChangeLog |
|
195 | 196 | drwxrwxrwx+ 6 ville None 0 Oct 24 18:05 IPython |
|
196 | 197 | |
|
197 | a.fields(0) is ['-rwxrwxrwx', 'drwxrwxrwx+'] | |
|
198 | a.fields(1,0) is ['1 -rwxrwxrwx', '6 drwxrwxrwx+'] | |
|
199 | (note the joining by space). | |
|
200 | a.fields(-1) is ['ChangeLog', 'IPython'] | |
|
198 | * ``a.fields(0)`` is ``['-rwxrwxrwx', 'drwxrwxrwx+']`` | |
|
199 | * ``a.fields(1,0)`` is ``['1 -rwxrwxrwx', '6 drwxrwxrwx+']`` | |
|
200 | (note the joining by space). | |
|
201 | * ``a.fields(-1)`` is ``['ChangeLog', 'IPython']`` | |
|
201 | 202 | |
|
202 | 203 | IndexErrors are ignored. |
|
203 | 204 |
General Comments 0
You need to be logged in to leave comments.
Login now