mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-09-25 14:42:37 +01:00
Initial commit of open source Workload Automation.
This commit is contained in:
34
dev_scripts/clean_install
Executable file
34
dev_scripts/clean_install
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python
|
||||
import os
|
||||
import sys
|
||||
import shutil
|
||||
import logging
|
||||
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
|
||||
def get_installed_path():
|
||||
paths = [p for p in sys.path if len(p) > 2]
|
||||
for path in paths:
|
||||
candidate = os.path.join(path, 'wlauto')
|
||||
if os.path.isdir(candidate):
|
||||
return candidate
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
installed_path = get_installed_path()
|
||||
if installed_path:
|
||||
logging.info('Removing installed package from {}.'.format(installed_path))
|
||||
shutil.rmtree(installed_path)
|
||||
if os.path.isdir('build'):
|
||||
logging.info('Removing local build directory.')
|
||||
shutil.rmtree('build')
|
||||
logging.info('Removing *.pyc files.')
|
||||
for root, dirs, files in os.walk('wlauto'):
|
||||
for file in files:
|
||||
if file.lower().endswith('.pyc'):
|
||||
os.remove(os.path.join(root, file))
|
||||
|
||||
os.system('python setup.py install')
|
||||
|
Reference in New Issue
Block a user