misc uninteresting stuff (killing time at airport commit)

- pep8 updates
- RNA_TwoDFilterActuator --> RNA_Filter2DActuator
- minor changes to conolse namespace init.
This commit is contained in:
2010-05-03 16:00:42 +00:00
parent 0fdd003d9a
commit 245ab753f5
13 changed files with 46 additions and 39 deletions

View File

@@ -40,9 +40,9 @@ def get_console(console_id):
'''
from code import InteractiveConsole
try:
consoles = get_console.consoles
except:
consoles = getattr(get_console, "consoles", None)
if consoles is None:
consoles = get_console.consoles = {}
# clear all dead consoles, use text names as IDs
@@ -53,16 +53,17 @@ def get_console(console_id):
del consoles[id]
'''
try:
console, stdout, stderr = consoles[console_id]
console_data = consoles.get(console_id)
if console_data:
console, stdout, stderr = console_data
# XXX, bug in python 3.1.2 ?
# seems there is no way to clear StringIO objects for writing, have to make new ones each time.
import io
stdout = io.StringIO()
stderr = io.StringIO()
except:
else:
namespace = {'__builtins__': __builtins__, 'bpy': bpy}
console = InteractiveConsole(namespace)