Save sys-info to file instead of a text block

The main reason for this change is this file is typically used when making bug reports,
its best if users attach this file to reports directly.
This commit is contained in:
Campbell Barton
2016-01-07 00:18:40 +11:00
parent cbc0a73ae4
commit 60c0c47dba
2 changed files with 23 additions and 14 deletions

View File

@@ -21,7 +21,7 @@
# classes for extracting info from blenders internal classes
def write_sysinfo(op):
def write_sysinfo(filepath):
import sys
import textwrap
@@ -30,14 +30,6 @@ def write_sysinfo(op):
import bpy
import bgl
output_filename = "system-info.txt"
output = bpy.data.texts.get(output_filename)
if output:
output.clear()
else:
output = bpy.data.texts.new(name=output_filename)
# pretty repr
def prepr(v):
r = repr(v)
@@ -49,6 +41,8 @@ def write_sysinfo(op):
return r
output = open(filepath, 'w', encoding="utf-8")
header = "= Blender %s System Information =\n" % bpy.app.version_string
lilies = "%s\n\n" % ((len(header) - 1) * "=")
output.write(lilies[:-1])
@@ -204,6 +198,5 @@ def write_sysinfo(op):
output.write(title("Cycles"))
output.write(cycles.engine.system_info())
output.current_line_index = 0
output.close()
op.report({'INFO'}, "System information generated in 'system-info.txt'")