String fix and a bunch of PEP8 issues I had collected in the meanwhile.
This commit is contained in:
@@ -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',)
|
||||
|
||||
|
Reference in New Issue
Block a user