Better project structure

This commit is contained in:
Anthony Sottile 2014-04-12 07:28:25 -07:00
parent f31f092f9b
commit 1746a97e24
52 changed files with 221 additions and 189 deletions

View file

@ -1,4 +1,4 @@
import jsonschema
import os
import os.path
import shutil
@ -27,3 +27,10 @@ def copy_tree_to_path(src_dir, dest_dir):
shutil.copytree(srcname, destname)
else:
shutil.copy(srcname, destname)
def is_valid_according_to_schema(obj, schema):
try:
jsonschema.validate(obj, schema)
return True
except jsonschema.exceptions.ValidationError:
return False