diff options
author | Guillermo S. Romero <gsr.b3d@infernal-iceberg.com> | 2009-12-04 20:54:48 +0300 |
---|---|---|
committer | Guillermo S. Romero <gsr.b3d@infernal-iceberg.com> | 2009-12-04 20:54:48 +0300 |
commit | 648122b1a22752f9f27d4ea74942f480973ee3e7 (patch) | |
tree | 93aff210de9f2966941777214ff5ac2b3ff6edda /release/scripts/op | |
parent | 19c0a169b8ef7965e50e0da144560755df188839 (diff) |
String fix and a bunch of PEP8 issues I had collected in the meanwhile.
Diffstat (limited to 'release/scripts/op')
-rw-r--r-- | release/scripts/op/console_python.py | 3 | ||||
-rw-r--r-- | release/scripts/op/console_shell.py | 13 |
2 files changed, 10 insertions, 6 deletions
diff --git a/release/scripts/op/console_python.py b/release/scripts/op/console_python.py index 532602655fa..7f1d35ede20 100644 --- a/release/scripts/op/console_python.py +++ b/release/scripts/op/console_python.py @@ -22,11 +22,13 @@ import bpy language_id = 'python' + def add_scrollback(text, text_type): for l in text.split('\n'): bpy.ops.console.scrollback_append(text=l.replace('\t', ' '), type=text_type) + def get_console(console_id): ''' helper function for console operators @@ -70,6 +72,7 @@ def get_console(console_id): PROMPT = '>>> ' PROMPT_MULTI = '... ' + def execute(context): sc = context.space_data diff --git a/release/scripts/op/console_shell.py b/release/scripts/op/console_shell.py index 7262a434a51..7dec9477f51 100644 --- a/release/scripts/op/console_shell.py +++ b/release/scripts/op/console_shell.py @@ -25,19 +25,21 @@ import bpy language_id = 'shell' + def add_scrollback(text, text_type): for l in text.split('\n'): bpy.ops.console.scrollback_append(text=l.replace('\t', ' '), type=text_type) + def shell_run(text): import subprocess - val, output= subprocess.getstatusoutput(text) + val, output = subprocess.getstatusoutput(text) if not val: - style= 'OUTPUT' + style = 'OUTPUT' else: - style= 'ERROR' + style = 'ERROR' add_scrollback(output, style) @@ -60,7 +62,7 @@ def execute(context): bpy.ops.console.history_append(text="", current_character=0, remove_duplicates=True) - sc.prompt = os.getcwd()+PROMPT + sc.prompt = os.getcwd() + PROMPT return ('FINISHED',) @@ -74,7 +76,6 @@ def banner(context): sc = context.space_data shell_run("bash --version") - sc.prompt = os.getcwd()+PROMPT + sc.prompt = os.getcwd() + PROMPT return ('FINISHED',) - |