##// END OF EJS Templates
reformat docstring in IPython utils
Matthias Bussonnier -
Show More
@@ -52,10 +52,8 b' def process_handler(cmd, callback, stderr=subprocess.PIPE):'
52 52 A command to be executed by the system, using :class:`subprocess.Popen`.
53 53 If a string is passed, it will be run in the system shell. If a list is
54 54 passed, it will be used directly as arguments.
55
56 55 callback : callable
57 56 A one-argument function that will be called with the Popen object.
58
59 57 stderr : file descriptor number, optional
60 58 By default this is set to ``subprocess.PIPE``, but you can also pass the
61 59 value ``subprocess.STDOUT`` to force the subprocess' stderr to go into
1 NO CONTENT: modified file
1 NO CONTENT: modified file
1 NO CONTENT: modified file
1 NO CONTENT: modified file
1 NO CONTENT: modified file
@@ -28,12 +28,10 b' def extract_vars(*names,**kw):'
28 28 *names : str
29 29 One or more variable names which will be extracted from the caller's
30 30 frame.
31
32 depth : integer, optional
31 **kw : integer, optional
33 32 How many frames in the stack to walk when looking for your variables.
34 33 The default is 0, which will use the frame where the call was made.
35 34
36
37 35 Examples
38 36 --------
39 37 ::
@@ -22,7 +22,6 b' def complete_object(obj, prev_completions):'
22 22 The object to complete.
23 23 prev_completions : list
24 24 List of attributes discovered so far.
25
26 25 This should return the list of attributes in obj. If you only wish to
27 26 add to the attributes already discovered normally, return
28 27 own_attrs + prev_completions.
1 NO CONTENT: modified file
@@ -114,10 +114,8 b' class Tee(object):'
114 114 ----------
115 115 file_or_name : filename or open filehandle (writable)
116 116 File that will be duplicated
117
118 117 mode : optional, valid mode for open().
119 118 If a filename was give, open with this mode.
120
121 119 channel : str, one of ['stdout', 'stderr']
122 120 """
123 121 if channel not in ['stdout', 'stderr']:
@@ -196,7 +194,6 b" def temp_pyfile(src, ext='.py'):"
196 194 ----------
197 195 src : string or list of strings (no need for ending newlines if list)
198 196 Source code to be written to the file.
199
200 197 ext : optional, string
201 198 Extension for the generated file.
202 199
@@ -43,14 +43,13 b' class Struct(dict):'
43 43
44 44 Parameters
45 45 ----------
46 args : dict, Struct
46 *args : dict, Struct
47 47 Initialize with one dict or Struct
48 kw : dict
48 **kw : dict
49 49 Initialize with key, value pairs.
50 50
51 51 Examples
52 52 --------
53
54 53 >>> s = Struct(a=10,b=30)
55 54 >>> s.a
56 55 10
@@ -68,7 +67,6 b' class Struct(dict):'
68 67
69 68 Examples
70 69 --------
71
72 70 >>> s = Struct()
73 71 >>> s['a'] = 10
74 72 >>> s.allow_new_attr(False)
@@ -95,7 +93,6 b' class Struct(dict):'
95 93
96 94 Examples
97 95 --------
98
99 96 >>> s = Struct()
100 97 >>> s.a = 10
101 98 >>> s.a
@@ -130,7 +127,6 b' class Struct(dict):'
130 127
131 128 Examples
132 129 --------
133
134 130 >>> s = Struct(a=10)
135 131 >>> s.a
136 132 10
@@ -155,7 +151,6 b' class Struct(dict):'
155 151
156 152 Examples
157 153 --------
158
159 154 >>> s = Struct(a=10,b=30)
160 155 >>> s2 = Struct(a=20,c=40)
161 156 >>> s += s2
@@ -170,7 +165,6 b' class Struct(dict):'
170 165
171 166 Examples
172 167 --------
173
174 168 >>> s1 = Struct(a=10,b=30)
175 169 >>> s2 = Struct(a=20,c=40)
176 170 >>> s = s1 + s2
@@ -186,7 +180,6 b' class Struct(dict):'
186 180
187 181 Examples
188 182 --------
189
190 183 >>> s1 = Struct(a=10,b=30)
191 184 >>> s2 = Struct(a=40)
192 185 >>> s = s1 - s2
@@ -202,7 +195,6 b' class Struct(dict):'
202 195
203 196 Examples
204 197 --------
205
206 198 >>> s1 = Struct(a=10,b=30)
207 199 >>> s2 = Struct(a=40)
208 200 >>> s1 -= s2
@@ -236,7 +228,6 b' class Struct(dict):'
236 228
237 229 Examples
238 230 --------
239
240 231 >>> s = Struct(a=10,b=30)
241 232 >>> s2 = s.copy()
242 233 >>> type(s2) is Struct
@@ -251,7 +242,6 b' class Struct(dict):'
251 242
252 243 Examples
253 244 --------
254
255 245 >>> s = Struct(a=10)
256 246 >>> s.hasattr('a')
257 247 True
@@ -284,7 +274,7 b' class Struct(dict):'
284 274
285 275 Parameters
286 276 ----------
287 __loc_data : dict, Struct
277 __loc_data__ : dict, Struct
288 278 The data to merge into self
289 279 __conflict_solve : dict
290 280 The conflict policy dict. The keys are binary functions used to
@@ -292,12 +282,11 b' class Struct(dict):'
292 282 the keys the conflict resolution function applies to. Instead of
293 283 a list of strings a space separated string can be used, like
294 284 'a b c'.
295 kw : dict
285 **kw : dict
296 286 Additional key, value pairs to merge in
297 287
298 288 Notes
299 289 -----
300
301 290 The `__conflict_solve` dict is a dictionary of binary functions which will be used to
302 291 solve key conflicts. Here is an example::
303 292
@@ -338,7 +327,6 b' class Struct(dict):'
338 327
339 328 Examples
340 329 --------
341
342 330 This show the default policy:
343 331
344 332 >>> s = Struct(a=10,b=30)
1 NO CONTENT: modified file
1 NO CONTENT: modified file
@@ -109,7 +109,7 b' def get_py_filename(name, force_win32=None):'
109 109 raise IOError('File `%r` not found.' % name)
110 110
111 111
112 def filefind(filename, path_dirs=None):
112 def filefind(filename: str, path_dirs=None) -> str:
113 113 """Find a file by looking through a sequence of paths.
114 114
115 115 This iterates through a sequence of paths looking for a file and returns
@@ -139,7 +139,12 b' def filefind(filename, path_dirs=None):'
139 139
140 140 Returns
141 141 -------
142 Raises :exc:`IOError` or returns absolute path to file.
142 path : str
143 returns absolute path to file.
144
145 Raises
146 ------
147 IOError
143 148 """
144 149
145 150 # If paths are quoted, abspath gets confused, strip them...
@@ -178,7 +183,6 b' def get_home_dir(require_writable=False) -> str:'
178 183
179 184 Parameters
180 185 ----------
181
182 186 require_writable : bool [default: False]
183 187 if True:
184 188 guarantees the return value is a writable directory, otherwise
1 NO CONTENT: modified file
1 NO CONTENT: modified file
1 NO CONTENT: modified file
1 NO CONTENT: modified file
1 NO CONTENT: modified file
1 NO CONTENT: modified file
@@ -252,7 +252,6 b' def indent(instr,nspaces=4, ntabs=0, flatten=False):'
252 252
253 253 Parameters
254 254 ----------
255
256 255 instr : basestring
257 256 The string to be indented.
258 257 nspaces : int (default: 4)
@@ -266,7 +265,6 b' def indent(instr,nspaces=4, ntabs=0, flatten=False):'
266 265
267 266 Returns
268 267 -------
269
270 268 str|unicode : string indented by ntabs and nspaces.
271 269
272 270 """
@@ -390,7 +388,6 b' def wrap_paragraphs(text, ncols=80):'
390 388
391 389 Returns
392 390 -------
393
394 391 list of complete paragraphs, wrapped to fill `ncols` columns.
395 392 """
396 393 paragraph_re = re.compile(r'\n(\s*\n)+', re.MULTILINE)
@@ -651,7 +648,6 b' def compute_item_matrix(items, row_first=False, empty=None, *args, **kwargs) :'
651 648
652 649 Parameters
653 650 ----------
654
655 651 items
656 652 list of strings to columize
657 653 row_first : (default False)
@@ -666,14 +662,11 b' def compute_item_matrix(items, row_first=False, empty=None, *args, **kwargs) :'
666 662
667 663 Returns
668 664 -------
669
670 665 strings_matrix
671
672 666 nested list of string, the outer most list contains as many list as
673 667 rows, the innermost lists have each as many element as columns. If the
674 668 total number of elements in `items` does not equal the product of
675 669 rows*columns, the last element of some lists are filled with `None`.
676
677 670 dict_info
678 671 some info to make columnize easier:
679 672
@@ -713,14 +706,11 b" def columnize(items, row_first=False, separator=' ', displaywidth=80, spread=Fa"
713 706 ----------
714 707 items : sequence of strings
715 708 The strings to process.
716
717 709 row_first : (default False)
718 710 Whether to compute columns for a row-first matrix instead of
719 711 column-first (default).
720
721 712 separator : str, optional [default is two spaces]
722 713 The string that separates columns.
723
724 714 displaywidth : int, optional [default is 80]
725 715 Width of the display in number of characters.
726 716
@@ -28,7 +28,6 b' def line_at_cursor(cell, cursor_pos=0):'
28 28
29 29 Parameters
30 30 ----------
31
32 31 cell: str
33 32 multiline block of text
34 33 cursor_pos: integer
@@ -36,7 +35,6 b' def line_at_cursor(cell, cursor_pos=0):'
36 35
37 36 Returns
38 37 -------
39
40 38 (line, offset): (string, integer)
41 39 The line with the current cursor, and the character offset of the start of the line.
42 40 """
@@ -66,7 +64,6 b' def token_at_cursor(cell, cursor_pos=0):'
66 64
67 65 Parameters
68 66 ----------
69
70 67 cell : unicode
71 68 A block of Python code
72 69 cursor_pos : int
General Comments 0
You need to be logged in to leave comments. Login now