Package fortuneengine :: Package pyconsole :: Module pyconsole :: Class Console
[hide private]
[frames] | no frames]

Class Console

source code

Known Subclasses:

Instance Methods [hide private]
 
__init__(self, screen, rect, functions={}, key_calls={}, vars={}, syntax={}) source code
 
load_cfg(self)
Loads the config file path/pygame-console.cfg All variables are initialized to their defaults, then new values will be loaded from the config file if it exists.
source code
 
init_default_cfg(self) source code
 
safe_set_attr(self, name, value)
Safely set the console variables
source code
 
add_func_calls(self, functions)
Add functions to the func_calls dictionary.
source code
 
add_key_calls(self, functions)
Add functions to the key_calls dictionary.
source code
 
output(self, text)
Prepare text to be displayed...
source code
 
set_active(self, b=None)
Activate or Deactivate the console...
source code
 
format_input_line(self)
Format input line to be displayed
source code
 
draw(self)
Draw the console to the parent screen
source code
 
set_interpreter(self) source code
 
catch_output(self) source code
 
release_output(self) source code
 
submit_input(self, text)
Submit input 1) Move input to output 2) Evaluate input 3) Clear input line
source code
 
send_python(self, text)
Sends input the the python interpreter in effect giving the user the ability to do anything python can.
source code
 
send_pyconsole(self, text)
Sends input to pyconsole to be interpreted
source code
 
setvar(self, name, value)
Sets the value of a variable
source code
 
getvar(self, name)
Gets the value of a variable, this is useful for people that want to access console variables from within their game
source code
 
setvars(self, vars) source code
 
getvars(self, opt_dict=None) source code
 
add_to_history(self, text)
Add specified text to the history
source code
 
clear_input(self)
Clear input line and reset cursor position
source code
 
set_pos(self, newpos)
Moves cursor safely
source code
 
str_insert(self, text, strn)
Insert characters at the current cursor position
source code
 
process_input(self, event)
Loop through pygame events and evaluate them
source code
 
convert_token(self, tok)
Convert a token to its proper type
source code
 
tokenize(self, s)
Tokenize input line, convert tokens to proper types
source code
 
clear(self)
Clear the Screen
source code
 
help(self, *args)
Output information about functions...
source code
Method Details [hide private]

add_func_calls(self, functions)

source code 
Add functions to the func_calls dictionary.
Arguments:
   functions -- dictionary of functions to add.

add_key_calls(self, functions)

source code 
Add functions to the key_calls dictionary.
Arguments:
   functions -- dictionary of key_calls to add.

output(self, text)

source code 
Prepare text to be displayed
Arguments:
   text -- Text to be displayed

set_active(self, b=None)

source code 
Activate or Deactivate the console
Arguments:
   b -- Optional boolean argument, True=Activate False=Deactivate

help(self, *args)

source code 
Output information about functions
Arguments:
   args -- arbitrary argument list of function names
     |- No Args - A list of available functions will be displayed
     |- One or more Args - Docstring of each function will be displayed