Skip to content
This repository has been archived by the owner on May 18, 2019. It is now read-only.

New Preferences system #101

Merged
merged 3 commits into from
Aug 22, 2015
Merged

New Preferences system #101

merged 3 commits into from
Aug 22, 2015

Conversation

le717
Copy link
Owner

@le717 le717 commented Aug 7, 2015

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 new pref/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 the debugPrint function to a Console.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.

This was referenced Aug 7, 2015
@le717 le717 modified the milestone: 1.2.5 Aug 7, 2015
@JoshTheDerf
Copy link
Collaborator

Nice! :)

@le717
Copy link
Owner Author

le717 commented Aug 7, 2015

For complete documentation sake, this PR also changes how the plugin is installed, and as such it will require the user to uninstall any previous versions. However, this will help out in the long run.

+ Small refactoring to load new script

+ Change all debugPrint calls to Console.log
- Remove debugPrint

Small bug fixes

More bug fixes, new methods

Incorporate the new preferences system

Rename class to more logical name

Update setup.py for script changes

Also trim out number of files added

Use the version defined in __version__.py

Add importOps key to dictionary
le717 pushed a commit that referenced this pull request Aug 22, 2015
@le717 le717 merged commit f37c4c7 into master Aug 22, 2015
@le717 le717 deleted the better-utils branch August 22, 2015 15:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants