##// END OF EJS Templates
More fixes to doc formatting
Thomas Kluyver -
Show More
@@ -102,7 +102,7 b' class KernelClient(LoggingConfigurable, ConnectionFileMixin):'
102 102 This will create the channels if they do not exist and then start
103 103 them (their activity runs in a thread). If port numbers of 0 are
104 104 being used (random ports) then you must first call
105 :method:`start_kernel`. If the channels have been stopped and you
105 :meth:`start_kernel`. If the channels have been stopped and you
106 106 call this, :class:`RuntimeError` will be raised.
107 107 """
108 108 if shell:
@@ -527,11 +527,13 b' class Session(Configurable):'
527 527 Returns
528 528 -------
529 529 msg_list : list
530 The list of bytes objects to be sent with the format:
531 [ident1,ident2,...,DELIM,HMAC,p_header,p_parent,p_metadata,p_content,
532 buffer1,buffer2,...]. In this list, the p_* entities are
533 the packed or serialized versions, so if JSON is used, these
534 are utf8 encoded JSON strings.
530 The list of bytes objects to be sent with the format::
531
532 [ident1, ident2, ..., DELIM, HMAC, p_header, p_parent,
533 p_metadata, p_content, buffer1, buffer2, ...]
534
535 In this list, the ``p_*`` entities are the packed or serialized
536 versions, so if JSON is used, these are utf8 encoded JSON strings.
535 537 """
536 538 content = msg.get('content', {})
537 539 if content is None:
@@ -197,31 +197,31 b' class KernelMagics(Magics):'
197 197 temporary file and will execute the contents of this file when you
198 198 close it (don't forget to save it!).
199 199
200
201 200 Options:
202 201
203 -n <number>: open the editor at a specified line number. By default,
204 the IPython editor hook uses the unix syntax 'editor +N filename', but
205 you can configure this by providing your own modified hook if your
206 favorite editor supports line-number specifications with a different
207 syntax.
202 -n <number>
203 Open the editor at a specified line number. By default, the IPython
204 editor hook uses the unix syntax 'editor +N filename', but you can
205 configure this by providing your own modified hook if your favorite
206 editor supports line-number specifications with a different syntax.
208 207
209 -p: this will call the editor with the same data as the previous time
210 it was used, regardless of how long ago (in your current session) it
211 was.
208 -p
209 Call the editor with the same data as the previous time it was used,
210 regardless of how long ago (in your current session) it was.
212 211
213 -r: use 'raw' input. This option only applies to input taken from the
212 -r
213 Use 'raw' input. This option only applies to input taken from the
214 214 user's history. By default, the 'processed' history is used, so that
215 215 magics are loaded in their transformed version to valid Python. If
216 216 this option is given, the raw input as typed as the command line is
217 217 used instead. When you exit the editor, it will be executed by
218 218 IPython's own processor.
219 219
220 -x: do not execute the edited code immediately upon exit. This is
221 mainly useful if you are editing programs which need to be called with
220 -x
221 Do not execute the edited code immediately upon exit. This is mainly
222 useful if you are editing programs which need to be called with
222 223 command line arguments, which you can then do using %run.
223 224
224
225 225 Arguments:
226 226
227 227 If arguments are given, the following possibilites exist:
@@ -237,7 +237,7 b' class KernelMagics(Magics):'
237 237
238 238 - If the argument is the name of an object (other than a string),
239 239 IPython will try to locate the file where it was defined and open the
240 editor at the point where it is defined. You can use `%edit function`
240 editor at the point where it is defined. You can use ``%edit function``
241 241 to load an editor exactly at the point where 'function' is defined,
242 242 edit it and have the file be executed automatically.
243 243
@@ -258,50 +258,50 b' class KernelMagics(Magics):'
258 258 After executing your code, %edit will return as output the code you
259 259 typed in the editor (except when it was an existing file). This way
260 260 you can reload the code in further invocations of %edit as a variable,
261 via _<NUMBER> or Out[<NUMBER>], where <NUMBER> is the prompt number of
261 via ``_<NUMBER>` or ``Out[<NUMBER>]``, where <NUMBER> is the prompt number of
262 262 the output.
263 263
264 264 Note that %edit is also available through the alias %ed.
265 265
266 266 This is an example of creating a simple function inside the editor and
267 then modifying it. First, start up the editor:
267 then modifying it. First, start up the editor::
268 268
269 269 In [1]: ed
270 270 Editing... done. Executing edited code...
271 271 Out[1]: 'def foo():n print "foo() was defined in an editing session"n'
272 272
273 We can then call the function foo():
273 We can then call the function foo()::
274 274
275 275 In [2]: foo()
276 276 foo() was defined in an editing session
277 277
278 278 Now we edit foo. IPython automatically loads the editor with the
279 (temporary) file where foo() was previously defined:
279 (temporary) file where foo() was previously defined::
280 280
281 281 In [3]: ed foo
282 282 Editing... done. Executing edited code...
283 283
284 And if we call foo() again we get the modified version:
284 And if we call foo() again we get the modified version::
285 285
286 286 In [4]: foo()
287 287 foo() has now been changed!
288 288
289 289 Here is an example of how to edit a code snippet successive
290 times. First we call the editor:
290 times. First we call the editor::
291 291
292 292 In [5]: ed
293 293 Editing... done. Executing edited code...
294 294 hello
295 295 Out[5]: "print 'hello'n"
296 296
297 Now we call it again with the previous output (stored in _):
297 Now we call it again with the previous output (stored in _)::
298 298
299 299 In [6]: ed _
300 300 Editing... done. Executing edited code...
301 301 hello world
302 302 Out[6]: "print 'hello world'n"
303 303
304 Now we call it with the output #8 (stored in _8, also as Out[8]):
304 Now we call it with the output #8 (stored in ``_8``, also as Out[8])::
305 305
306 306 In [7]: ed _8
307 307 Editing... done. Executing edited code...
@@ -366,7 +366,8 b' class BackgroundJobBase(threading.Thread):'
366 366 - A strform attribute used in calls to __str__.
367 367
368 368 - A call() method, which will make the actual execution call and must
369 return a value to be held in the 'result' field of the job object."""
369 return a value to be held in the 'result' field of the job object.
370 """
370 371
371 372 # Class constants for status, in string and as numerical codes (when
372 373 # updating jobs lists, we don't want to do string comparisons). This will
@@ -378,6 +379,10 b' class BackgroundJobBase(threading.Thread):'
378 379 stat_dead_c = -1
379 380
380 381 def __init__(self):
382 """Must be implemented in subclasses.
383
384 Subclasses must call :meth:`_init` for standard initialisation.
385 """
381 386 raise NotImplementedError("This class can not be instantiated directly.")
382 387
383 388 def _init(self):
@@ -103,10 +103,13 b' class Exporter(LoggingConfigurable):'
103 103
104 104 Parameters
105 105 ----------
106 nb : Notebook node
107 resources : dict (**kw)
108 of additional resources that can be accessed read/write by
109 preprocessors.
106 nb : :class:`~IPython.nbformat.v3.nbbase.NotebookNode`
107 Notebook node
108 resources : dict
109 Additional resources that can be accessed read/write by
110 preprocessors and filters.
111 **kw
112 Ignored (?)
110 113 """
111 114 nb_copy = copy.deepcopy(nb)
112 115 resources = self._init_resources(resources)
@@ -193,9 +193,10 b' class TemplateExporter(Exporter):'
193 193
194 194 Parameters
195 195 ----------
196 nb : Notebook node
197 resources : dict (**kw)
198 of additional resources that can be accessed read/write by
196 nb : :class:`~IPython.nbformat.v3.nbbase.NotebookNode`
197 Notebook node
198 resources : dict
199 Additional resources that can be accessed read/write by
199 200 preprocessors and filters.
200 201 """
201 202 nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw)
@@ -1308,6 +1308,7 b' class HTCondorLauncher(BatchSystemLauncher):'
1308 1308 this - the mechanism of shebanged scripts means that the python binary will be
1309 1309 launched with argv[0] set to the *location of the ip{cluster, engine, controller}
1310 1310 scripts on the remote node*. This means you need to take care that:
1311
1311 1312 a. Your remote nodes have their paths configured correctly, with the ipengine and ipcontroller
1312 1313 of the python environment you wish to execute code in having top precedence.
1313 1314 b. This functionality is untested on Windows.
@@ -31,7 +31,6 b' ipython_promptin:'
31 31 The default is 'In [%d]:'. This expects that the line numbers are used
32 32 in the prompt.
33 33 ipython_promptout:
34
35 34 The string to represent the IPython prompt in the generated ReST. The
36 35 default is 'Out [%d]:'. This expects that the line numbers are used
37 36 in the prompt.
@@ -81,7 +81,8 b' def belong(candidates,checklist):'
81 81 def with_obj(object, **args):
82 82 """Set multiple attributes for an object, similar to Pascal's with.
83 83
84 Example:
84 Example::
85
85 86 with_obj(jim,
86 87 born = 1960,
87 88 haircolour = 'Brown',
General Comments 0
You need to be logged in to leave comments. Login now