Package topo :: Package misc :: Module commandline :: Class CommandPrompt
[hide private]
[frames] | no frames]

Class CommandPrompt

source code

            object --+    
                     |    
IPCommandPromptHandler --+
                         |
                        CommandPrompt

Control over input prompt.

Several predefined formats are provided, and any of these (or any arbitrary string) can be used by calling set_format() with their values.

See the IPython manual for details: http://ipython.scipy.org/doc/manual/html/config/index.html

Examples:
# Use one of the predefined formats: CommandPrompt.set_format(CommandPrompt.basic_format) # Just print the command number: CommandPrompt.set_format('# ') # Print the command number but don't use color: CommandPrompt.set_format('N ') # Print the value of my_var at each prompt: CommandPrompt.set_format('${my_var}>>> ')
Instance Methods [hide private]

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Methods [hide private]

Inherited from IPCommandPromptHandler: get_format, set_format

Class Variables [hide private]
  _prompt = 'prompt1'
str(object) -> string
  basic_format = 'Topographica>>> '
str(object) -> string
  simtime_format = 'topo_t${topo.sim.timestr()}>>> '
str(object) -> string
  simtimecmd_format = 'topo_t${topo.sim.timestr()}_c\\#>>> '
str(object) -> string
  _format = 'topo_t${topo.sim.timestr()}_c\\#>>> '
str(object) -> string
Properties [hide private]

Inherited from object: __class__

Class Variable Details [hide private]

_prompt

str(object) -> string

Return a nice string representation of the object. If the argument is a string, the return value is the same object.

Value:
'prompt1'

basic_format

str(object) -> string

Return a nice string representation of the object. If the argument is a string, the return value is the same object.

Value:
'Topographica>>> '

simtime_format

str(object) -> string

Return a nice string representation of the object. If the argument is a string, the return value is the same object.

Value:
'topo_t${topo.sim.timestr()}>>> '

simtimecmd_format

str(object) -> string

Return a nice string representation of the object. If the argument is a string, the return value is the same object.

Value:
'topo_t${topo.sim.timestr()}_c\\#>>> '

_format

str(object) -> string

Return a nice string representation of the object. If the argument is a string, the return value is the same object.

Value:
'topo_t${topo.sim.timestr()}_c\\#>>> '