You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great to be able to get the results of the stix2validator.print_results() function as a string representation. Take the base example currently in the Readme:
It would be nice to do e.g. foo = print_results(results) or something similar to get that as a string to work with.
Alternately maybe the results variable (a stix2validator.validators.FileValidationResults object) could have a __repr__ function built into it that provides the same output? If it went that direction it could probably make use of the FileValidationResults.as_dict() function here. Maybe?
Any thoughts on best way to implement this before I go off and make something up that works for me and do a pull request?
The text was updated successfully, but these errors were encountered:
It might make sense to define __str__ on the FileValidationResults class, that calls .as_dict() as you propose. Then print_results() could aggregate the string representations of all the results and return it after it calls .log() on them.
It would be great to be able to get the results of the
stix2validator.print_results()
function as a string representation. Take the base example currently in the Readme:It would be nice to do e.g.
foo = print_results(results)
or something similar to get that as a string to work with.Alternately maybe the
results
variable (astix2validator.validators.FileValidationResults
object) could have a__repr__
function built into it that provides the same output? If it went that direction it could probably make use of theFileValidationResults.as_dict()
function here. Maybe?Any thoughts on best way to implement this before I go off and make something up that works for me and do a pull request?
The text was updated successfully, but these errors were encountered: