String fix and a bunch of PEP8 issues I had collected in the meanwhile.

This commit is contained in:
Guillermo S. Romero
2009-12-04 17:54:48 +00:00
parent 19c0a169b8
commit 648122b1a2
14 changed files with 108 additions and 102 deletions

View File

@@ -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',)