-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#219] support templates when exporting
- Loading branch information
1 parent
97ed70c
commit ee42d75
Showing
12 changed files
with
139 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,5 @@ | ||
"""Functions for formatting metadata validation problems | ||
""" | ||
|
||
# These functions in gui rather than lib to allow for translations using Qt's | ||
# tr() | ||
|
||
from itertools import chain | ||
|
||
|
||
def format_missing_mandatory(missing_mandatory): | ||
msg = u'Box [{0}] [{1}] lacks mandatory field [{2}]' | ||
for index, label, field in missing_mandatory: | ||
yield msg.format(1 + index, label, field) | ||
|
||
|
||
def format_failed_parse(failed_parse): | ||
msg = u'Could not parse value of [{0}] for box [{1}] [{2}]' | ||
for index, label, field in failed_parse: | ||
yield msg.format(1 + index, label, field) | ||
|
||
|
||
def format_missing_label(missing_label): | ||
msg = u'Missing object label for box [{0}]' | ||
for index in missing_label: | ||
yield msg.format(1 + index) | ||
|
||
|
||
def format_duplicated_labels(duplicated_labels): | ||
msg = u'Duplicated object label [{0}]' | ||
for duplicated in duplicated_labels: | ||
yield msg.format(duplicated) | ||
|
||
|
||
def format_validation_problems(v): | ||
return chain(format_missing_mandatory(v.missing_mandatory), | ||
format_failed_parse(v.failed_parse), | ||
format_missing_label(v.missing_label), | ||
format_duplicated_labels(v.duplicated_labels)) | ||
# TODO Hook validation functions into Qt's tr() | ||
from inselect.lib.validate_document import format_validation_problems # noqa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.