This commit is contained in:
mattbasta 2010-12-06 19:11:40 -05:00
Родитель 3e26c40c42
Коммит 3e976845bc
1 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -1,16 +1,25 @@
from cStringIO import StringIO
import json
from StringIO import StringIO
import validator.main
import validator.testcases.targetapplication
from validator.errorbundler import ErrorBundle
from validator.constants import PACKAGE_ANY
def validate(path, format="json"):
def validate(path, format="json", approved_applications="", determined=True):
"Perform validation in one easy step!"
output = StringIO()
# Load up the target applications
validator.testcases.targetapplication.APPROVED_APPLICATIONS = \
json.loads(open(approved_applications if
approved_applications else
"validator/app_versions.json").read())
bundle = ErrorBundle(pipe=output, no_color=True, listed=True)
bundle = ErrorBundle(pipe=output, no_color=True, listed=True,
determined=determined)
validator.main.prepare_package(bundle, path, PACKAGE_ANY)
# Write the results to the pipe