diff options
Diffstat (limited to 'release/scripts/sysinfo.py')
-rw-r--r-- | release/scripts/sysinfo.py | 139 |
1 files changed, 88 insertions, 51 deletions
diff --git a/release/scripts/sysinfo.py b/release/scripts/sysinfo.py index daa6867e1a8..01cff8ae57f 100644 --- a/release/scripts/sysinfo.py +++ b/release/scripts/sysinfo.py @@ -12,13 +12,13 @@ __url__ = ("blender", "elysiun") __version__ = "1.1" __bpydoc__ = """\ This script creates a text in Blender's Text Editor with information -about your OS, video card, OpenGL driver, Blender and Python versions and -more. +about your OS, video card, OpenGL driver, Blender and Python versions, +script related paths and more. -If you are experiencing trouble running Blender or its scripts in general, -this information can be useful for online searches (like checking if there -are known issues related to your video card) or to get help from other users -or the program's developers. +If you are experiencing trouble running Blender itself or any Blender Python +script, this information can be useful to fix any problems or at least for +online searches (like checking if there are known issues related to your +video card) or to get help from other users or the program's developers. """ # $Id$ @@ -85,7 +85,8 @@ def textWrap(text, length = 70): # msg = sys.exc_info()[1].__str__().split()[3] # Blender.Draw.PupMenu("Python error:|This script requires the %s module" %msg) -header = "= Blender %s System Information =" % Blender.Get("version") +version = Blender.Get('version') / 100.0 +header = "= Blender %s System Information =" % version lilies = len(header)*"="+"\n" header = lilies + header + "\n" + lilies @@ -97,40 +98,12 @@ output.write("Platform: %s\n========\n\n" % sys.platform) output.write("Python:\n======\n\n") output.write("- Version: %s\n\n" % sys.version) -output.write("- Path:\n\n") +output.write("- Paths:\n\n") for p in sys.path: output.write(p + '\n') output.write("\n- Directories:") -if not Blender.Get('homedir'): - outmsg = """ - -<WARNING> - Blender home dir not found! - This should probably be "<path>/.blender/" - where <path> is usually the user's home dir. - - Blender's home dir is where entries like: - folders scripts/, plugins/ and locale/ and - files .Blanguages and .bfont.ttf - are located. - - It's also where Blender stores the Bpymenus file - with information about registered scripts, so it - only needs to scan scripts dir(s) when they are - modified. -""" - output.write(outmsg) - if Blender.Get('scriptsdir').find('release') > 0: - output.write(""" -It seems this Blender binary is located at its cvs source tree: -that's ok, but the scripts registration data will be recreated -from dir(s) whenever you start the program, instead of only -when those dirs are modified. - -Adding a .blender/ subdir to e. g. your home dir can prevent that. -""") - dirlist = [ ['homedir', 'Blender home dir', 1], ['scriptsdir', 'Default dir for scripts', 1], @@ -139,11 +112,14 @@ dirlist = [ ['udatadir', 'Data dir "bpydata/" inside user defined dir', 0] ] +has_dir = {} + for dir in dirlist: dirname, dirstr, is_critical = dir dirpath = Blender.Get(dirname) output.write("\n\n %s:\n" % dirstr) if not dirpath: + has_dir[dirname] = False if is_critical: warnings += 1 output.write(" <WARNING> -- not found") @@ -152,24 +128,34 @@ for dir in dirlist: output.write(" <NOTICE> -- not found") else: output.write(" %s" % dirpath) + has_dir[dirname] = True -configdir = bsys.join(Blender.Get('datadir'), 'config') -output.write('\n\n Default config data "bpydata/config/" dir:') -if bsys.exists(configdir): - output.write(" %s" % configdir) -else: - warnings += 1 - output.write(""" - <WARNING> -- not found. - config/ should be inside the default scripts *data dir*. - It's used by Blender to store scripts configuration data. -""") +if not has_dir['homedir']: + outmsg = """ + +<WARNING> - Blender home dir not found! + This should probably be "<path>/.blender/" + where <path> is usually the user's home dir. -if Blender.Get('udatadir'): + Blender's home dir is where entries like: + folders scripts/, plugins/ and locale/ and + files .Blanguages and .bfont.ttf + are located. + + It's also where Blender stores the Bpymenus file + with information about registered scripts, so it + only needs to scan scripts dir(s) when they are + modified. +""" + output.write(outmsg) + +has_uconfdir = False +if has_dir['udatadir']: uconfigdir = bsys.join(Blender.Get('udatadir'), 'config') output.write("\n\n User defined config data dir:") - if bsys.exists(configdir): - output.write(" %s" % configdir) + if bsys.exists(uconfigdir): + has_uconfdir = True + output.write(" %s" % uconfigdir) else: notices += 1 output.write(""" @@ -180,6 +166,49 @@ if Blender.Get('udatadir'): won't overwrite the data.) """) +configdir = bsys.join(Blender.Get('datadir'), 'config') +output.write('\n\n Default config data "bpydata/config/" dir:\n') +if bsys.exists(configdir): + output.write(" %s" % configdir) +else: + warnings += 1 + output.write("""<WARNING> -- not found. + config/ should be inside the default scripts *data dir*. + It's used by Blender to store scripts configuration data + when <user defined scripts dir>/bpydata/config/ dir is + not available. +""") + +if has_uconfdir: + output.write(""" + +The user defined config dir will be used. +""") + +cvsdir = 'release/scripts' +if bsys.dirsep == '\\': cvsdir = cvsdir.replace('/','\\') +sdir = Blender.Get('scriptsdir') +if sdir and sdir.find(cvsdir) >= 0: + if has_uconfdir: + notices += 1 + output.write("\n\n<NOTICE>:\n") + else: + warnings += 1 + output.write("\n\n<WARNING>:\n") + output.write(""" +It seems this Blender binary is located in its cvs source tree. + +It's recommended that the release/scripts/ dir tree is copied +to your blender home dir. +""") + if not has_uconfdir: + output.write(""" +Since you also don't have a user defined scripts dir with the +bpydata/config dir inside it, it will not be possible to save +and restore scripts configuration data files, since writing +to a dir inside a cvs tree is not a good idea and is avoided. +""") + missing_mods = [] # missing basic modules try: @@ -197,11 +226,19 @@ Some expected modules were not found. Because of that some scripts bundled with Blender may not work. Please read the FAQ in the Readme.html file shipped with Blender for information about how to fix the problem. -Missing modules:""" +Missing modules: +""" output.write(outmsg) warnings += 1 for m in missing_mods: output.write('-> ' + m + '\n') + if 'BPyRegistry' in missing_mods: + output.write(""" +Module BPyRegistry.py is missing! +Without this module it's not possible to save and restore +scripts configuration data files. +""") + else: output.write("\n\n- Modules: all basic ones were found.\n") |