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