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