Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def prep_schema_doc(infile, outfile, inpath, options):
doc1 = etree.parse(infile)
root1 = doc1.getroot()
params = Params()
params.parent_url = infile
params.base_url = os.path.split(inpath)[0]
inserts = []
if not options.no_collect_includes:
collect_inserts(root1, params, inserts, options)
root2 = copy.copy(root1)
clear_includes_and_imports(root2)
for insert_node in inserts:
root2.append(insert_node)
else:
root2 = root1
if not options.no_redefine_groups:
process_groups(root2)
raise_anon_complextypes(root2)
fix_type_names(root2, options)
doc2 = etree.ElementTree(root2)
def get_all_root_file_paths(
infile,
inpath='',
catalogpath=None,
shallow=False):
load_catalog(catalogpath)
doc1 = etree.parse(infile)
root1 = doc1.getroot()
rootPaths = []
params = Params()
params.parent_url = infile
params.base_url = os.path.split(inpath)[0]
get_root_file_paths(root1, params, rootPaths, shallow)
rootPaths.append(inpath)
return rootPaths