diff options
Diffstat (limited to 'release/scripts/modules/sys_info.py')
-rw-r--r-- | release/scripts/modules/sys_info.py | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/release/scripts/modules/sys_info.py b/release/scripts/modules/sys_info.py index 16dfbf1bb3d..1272d81872d 100644 --- a/release/scripts/modules/sys_info.py +++ b/release/scripts/modules/sys_info.py @@ -51,8 +51,8 @@ def textWrap(text, length=70): def write_sysinfo(op): output_filename = "system-info.txt" - if output_filename in bpy.data.texts.keys(): - output = bpy.data.texts[output_filename] + output = bpy.data.texts.get(output_filename) + if output: output.clear() else: output = bpy.data.texts.new(name=output_filename) @@ -94,16 +94,19 @@ def write_sysinfo(op): output.write('autosave: {}\n'.format(bpy.utils.user_resource('AUTOSAVE'))) output.write('tempdir: {}\n'.format(bpy.app.tempdir)) - output.write('\nOpenGL\n') - output.write(lilies) - output.write('renderer:\t{}\n'.format(bgl.glGetString(bgl.GL_RENDERER))) - output.write('vendor:\t\t{}\n'.format(bgl.glGetString(bgl.GL_VENDOR))) - output.write('version:\t{}\n'.format(bgl.glGetString(bgl.GL_VERSION))) - output.write('extensions:\n') - - glext = bgl.glGetString(bgl.GL_EXTENSIONS) - glext = textWrap(glext, 70) - for l in glext: - output.write('\t\t{}\n'.format(l)) + if bpy.app.background: + output.write('\nOpenGL: missing, background mode\n') + else: + output.write('\nOpenGL\n') + output.write(lilies) + output.write('renderer:\t{}\n'.format(bgl.glGetString(bgl.GL_RENDERER))) + output.write('vendor:\t\t{}\n'.format(bgl.glGetString(bgl.GL_VENDOR))) + output.write('version:\t{}\n'.format(bgl.glGetString(bgl.GL_VERSION))) + output.write('extensions:\n') + + glext = bgl.glGetString(bgl.GL_EXTENSIONS) + glext = textWrap(glext, 70) + for l in glext: + output.write('\t\t{}\n'.format(l)) op.report({'INFO'}, "System information generated in 'system-info.txt'") |