diff options
author | Sergei Trofimov <sergei.trofimov@arm.com> | 2015-03-10 13:09:31 +0000 |
---|---|---|
committer | Sergei Trofimov <sergei.trofimov@arm.com> | 2015-03-10 13:09:31 +0000 |
commit | a747ec7e4c2ea8a25bfc675f80042eb6600c7050 (patch) | |
tree | 077c0439a89a5c33b9fa1dbf9e81146ca9960d3c /dev_scripts/clean_install |
Initial commit of open source Workload Automation.
Diffstat (limited to 'dev_scripts/clean_install')
-rwxr-xr-x | dev_scripts/clean_install | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/dev_scripts/clean_install b/dev_scripts/clean_install new file mode 100755 index 00000000..7d647e5a --- /dev/null +++ b/dev_scripts/clean_install @@ -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') + |