Commit 48557efa authored by Mitar's avatar Mitar

Updating disable script.

parent 6ae267bb
...@@ -18,13 +18,14 @@ arguments = parser.parse_args() ...@@ -18,13 +18,14 @@ arguments = parser.parse_args()
for primitive_name in arguments.primitive_names: for primitive_name in arguments.primitive_names:
if os.path.exists(primitive_name): if os.path.exists(primitive_name):
path = os.path.join('failed', primitive_name) segments = primitive_name.split('/')
shutil.rmtree(path, ignore_errors=True) interface_version, python_path, version, filename = [segments[i] for i in [-5, -3, -2, -1]]
os.renames(primitive_name, path) if filename != 'primitive.json':
raise ValueError("Not a path to \"primitive.json\" file: " + primitive_name)
else: else:
interface_version, python_path, version = primitive_name.split('/') interface_version, python_path, version = primitive_name.split('/')
for globbed_file_path in glob.glob('{interface_version}/*/{python_path}/{version}'.format(interface_version=interface_version, python_path=python_path, version=version)): for globbed_file_path in glob.glob('{interface_version}/*/{python_path}/{version}'.format(interface_version=interface_version, python_path=python_path, version=version)):
path = os.path.join('failed', globbed_file_path) path = os.path.join('failed', globbed_file_path)
shutil.rmtree(path, ignore_errors=True) shutil.rmtree(path, ignore_errors=True)
os.renames(globbed_file_path, path) os.renames(globbed_file_path, path)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment