irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

update_schema_ids_for_cmake.py
Go to the documentation of this file.
1 from __future__ import print_function
2 
3 import json
4 import os
5 import sys
6 
7 
8 def update_schema_dict(schema_dict, target_directory, filename):
9  schema_dict['id'] = 'file://{target_directory}/{filename}#'.format(**vars())
10 
11 def main(schema_directory, target_directory):
12  for filename in os.listdir(schema_directory):
13  with open(os.path.join(schema_directory, filename)) as f:
14  schema_dict = json.load(f)
15  update_schema_dict(schema_dict, target_directory, filename)
16  with open(os.path.join(schema_directory, filename), 'w') as f:
17  json.dump(schema_dict, f, indent=4, sort_keys=True)
18 
19 if __name__ == '__main__':
20  if len(sys.argv) != 3:
21  print('Call as {0} <schema directory> <target directory>'.format(sys.argv[0]), file=sys.stderr)
22  sys.exit(1)
23  main(sys.argv[1], sys.argv[2])
update_schema_ids_for_cmake.update_schema_dict
def update_schema_dict(schema_dict, target_directory, filename)
Definition: update_schema_ids_for_cmake.py:8
update_schema_ids_for_cmake.main
def main(schema_directory, target_directory)
Definition: update_schema_ids_for_cmake.py:11