Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2016-01-06 16:18:40 +0300
committerCampbell Barton <ideasman42@gmail.com>2016-01-06 16:24:33 +0300
commit60c0c47dba97ef2bdbc4bdb6e936da0297a0c1f9 (patch)
tree4a937ef2c88b46a3c67ae404acce16f4c899dbc5 /release
parentcbc0a73ae423bf467824b5d4e1e0974ad2a0fddd (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')
-rw-r--r--release/scripts/modules/sys_info.py15
-rw-r--r--release/scripts/startup/bl_operators/wm.py22
2 files changed, 23 insertions, 14 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'")
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 1ebe7267d38..b9dc691f41f 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -1388,16 +1388,32 @@ class WM_OT_appconfig_activate(Operator):
class WM_OT_sysinfo(Operator):
- """Generate system info text, accessible from Blender's internal text editor"""
+ """Generate system information, saved into a text file"""
bl_idname = "wm.sysinfo"
- bl_label = "System Info"
+ bl_label = "Save System Info"
+
+ filepath = StringProperty(
+ subtype='FILE_PATH',
+ options={'SKIP_SAVE'},
+ )
def execute(self, context):
import sys_info
- sys_info.write_sysinfo(self)
+ sys_info.write_sysinfo(self.filepath)
return {'FINISHED'}
+ def invoke(self, context, event):
+ import os
+
+ if not self.filepath:
+ self.filepath = os.path.join(
+ os.path.expanduser("~"), "system-info.txt")
+
+ wm = context.window_manager
+ wm.fileselect_add(self)
+ return {'RUNNING_MODAL'}
+
class WM_OT_copy_prev_settings(Operator):
"""Copy settings from previous version"""