diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-01-06 16:18:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-01-06 16:24:33 +0300 |
commit | 60c0c47dba97ef2bdbc4bdb6e936da0297a0c1f9 (patch) | |
tree | 4a937ef2c88b46a3c67ae404acce16f4c899dbc5 /release/scripts/modules/sys_info.py | |
parent | cbc0a73ae423bf467824b5d4e1e0974ad2a0fddd (diff) |
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.
Diffstat (limited to 'release/scripts/modules/sys_info.py')
-rw-r--r-- | release/scripts/modules/sys_info.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/release/scripts/modules/sys_info.py b/release/scripts/modules/sys_info.py index 1b5de95ae7e..c4b2d9ff897 100644 --- a/release/scripts/modules/sys_info.py +++ b/release/scripts/modules/sys_info.py @@ -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'") |