1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-05 18:31:12 +01:00
workload-automation/dev_scripts/clean_install
2015-03-10 13:09:31 +00:00

35 lines
919 B
Python
Executable File

#!/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')