This repository has been archived by the owner on May 18, 2019. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduce a new
src/ldutils.py
module containing a new preferences system and relocated message logger.This new script started out for a different but related (and unfinished) project, but I decided to incorporate it in here.
This replaces the old, hacky, and unsafe
exec(compile(lines, config_filename, 'exec'))
system by using a newpref/LDR-Importer.json
file and properly loading it into the script. There is room for expansion as needed. This also improves the LDraw install detection on Win, Mac, and Linux and moves thedebugPrint
function to aConsole.log
method.This required a bit of refactoring to set up, but that should not have a major (if any) effect on other PRs. The only real code effects will be
debugPrint()
is no longer a function and will need to be replaced with the new method right before/after merging.I have not yet updated the packaging script but will do so.I have fully tested this on Windows 7 x64 and Blender 2.72 and 2.75a as well as under Python 3.4.3 outside of Blender context.
Bonus: the script is now ~1024 lines instead of 1202. 😄
@tribex You'll probably be interested in this as (IIRC) you initially added the old preferences system.