Commit 48557efa authored by Mitar's avatar Mitar

Updating disable script.

parent 6ae267bb
......@@ -18,13 +18,14 @@ arguments = parser.parse_args()
for primitive_name in arguments.primitive_names:
if os.path.exists(primitive_name):
path = os.path.join('failed', primitive_name)
shutil.rmtree(path, ignore_errors=True)
os.renames(primitive_name, path)
segments = primitive_name.split('/')
interface_version, python_path, version, filename = [segments[i] for i in [-5, -3, -2, -1]]
if filename != 'primitive.json':
raise ValueError("Not a path to \"primitive.json\" file: " + primitive_name)
else:
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)):
path = os.path.join('failed', globbed_file_path)
shutil.rmtree(path, ignore_errors=True)
os.renames(globbed_file_path, path)
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)
shutil.rmtree(path, ignore_errors=True)
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