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

Commit

Permalink
Merge branch 'release/v0.7.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Nunes committed Jul 13, 2016
2 parents 5575279 + 7ebcd58 commit 40daa33
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 25 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# Changelog

0.7.2 (2016-07-13)

* Plugin node should now have the correct required child nodes.
* Fixed validation and warning dialogs and ignore process.
* Fixed files processing in preview.

----------------------------------

0.7.1 (2016-07-12)

* Fixed preview issue with non-existent nodes under info root.
* Updated validation and children groups.

----------------------------------

0.7.0 (2016-07-10)

* Fixed rare bug with the validator.
Expand Down
62 changes: 40 additions & 22 deletions designer/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from PyQt5.QtCore import Qt, pyqtSignal, QStringListModel, QMimeData
from PyQt5.uic import loadUi
from requests import get, codes, ConnectionError, Timeout
from validator import validate_tree, check_warnings, ValidatorError
from validator import validate_tree, check_warnings, ValidatorError, ValidationError, WarningError, MissingFolderError
from . import cur_folder, __version__
from .io import import_, new, export, sort_elements, elem_factory, copy_element
from .previews import PreviewDispatcherThread, PreviewMoGui
Expand Down Expand Up @@ -701,17 +701,25 @@ def open(self, path=""):
info_root, config_root = import_(normpath(package_path))
if info_root is not None and config_root is not None:
if self.settings_dict["Load"]["validate"]:
validate_tree(
parse(BytesIO(tostring(config_root, pretty_print=True))),
join(cur_folder, "resources", "mod_schema.xsd"),
self.settings_dict["Load"]["validate_ignore"]
)
try:
validate_tree(
parse(BytesIO(tostring(config_root, pretty_print=True))),
join(cur_folder, "resources", "mod_schema.xsd"),
)
except ValidationError as p:
generic_errorbox(p.title, str(p), p.detailed)
if not self.settings_dict["Load"]["validate_ignore"]:
return
if self.settings_dict["Load"]["warnings"]:
check_warnings(
package_path,
config_root,
self.settings_dict["Save"]["warn_ignore"]
)
try:
check_warnings(
package_path,
config_root,
)
except WarningError as p:
generic_errorbox(p.title, str(p), p.detailed)
if not self.settings_dict["Save"]["warn_ignore"]:
return
else:
info_root, config_root = new()

Expand Down Expand Up @@ -752,20 +760,30 @@ def save(self):
sort_elements(self._info_root)
sort_elements(self._config_root)
if self.settings_dict["Save"]["validate"]:
validate_tree(
parse(BytesIO(tostring(self._config_root, pretty_print=True))),
join(cur_folder, "resources", "mod_schema.xsd"),
self.settings_dict["Save"]["validate_ignore"]
)
try:
validate_tree(
parse(BytesIO(tostring(self._config_root, pretty_print=True))),
join(cur_folder, "resources", "mod_schema.xsd"),
)
except ValidationError as e:
generic_errorbox(e.title, str(e), e.detailed)
if not self.settings_dict["Save"]["validate_ignore"]:
return
if self.settings_dict["Save"]["warnings"]:
check_warnings(
self._package_path,
self._config_root,
self.settings_dict["Save"]["warn_ignore"]
)
try:
check_warnings(
self._package_path,
self._config_root,
)
except MissingFolderError:
pass
except WarningError as e:
generic_errorbox(e.title, str(e), e.detailed)
if not self.settings_dict["Save"]["warn_ignore"]:
return
export(self._info_root, self._config_root, self._package_path)
self.undo_stack.setClean()
except ValidatorError as e:
except (DesignerError, ValidatorError) as e:
generic_errorbox(e.title, str(e))
return

Expand Down
1 change: 1 addition & 0 deletions designer/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,7 @@ def _init(self):
)
required = (
NodeConfigPluginDescription,
NodeConfigTypeDesc,
)
properties = OrderedDict([
("name", PropertyText("Name"))
Expand Down
6 changes: 4 additions & 2 deletions designer/previews.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,8 +597,10 @@ def recurse_add_items(folder, parent):
recurse_add_items(abs_source, parent_item)

for file_ in button.property("file_list"):
if (button.isChecked() or folder_.always_install or
folder_.install_usable and button.property("type") != "NotUsable"):
if (button.isChecked() and button.property("type") != "NotUsable" or
file_.always_install or
file_.install_usable and button.property("type") != "NotUsable" or
button.property("type") == "Required"):
destination = file_.destination
abs_source = file_.abs_source
rel_source = file_.rel_source
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.7.1
current_version = 0.7.2
current_build = 0

[bdist_wheel]
Expand Down

0 comments on commit 40daa33

Please sign in to comment.