-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7def9b7
commit bd73896
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# install kosh and aml_dmt into current Python | ||
# Sets permission correctly | ||
#!/usr/bin/env python | ||
import os | ||
import shlex | ||
import sys | ||
from subprocess import Popen, PIPE | ||
import argparse | ||
|
||
p = argparse.ArgumentParser() | ||
|
||
p.add_argument("--no_chmod", action="store_true") | ||
p.add_argument("-v", "--verbose", action="store_true") | ||
|
||
args = p .parse_args() | ||
|
||
os.chdir(os.path.expanduser("~/git/kosh")) | ||
|
||
def run_cmd(cmd, verbose=False): | ||
p = Popen(shlex.split(cmd), stdout=PIPE, stderr=PIPE) | ||
o,e = p.communicate() | ||
if verbose: | ||
print(o.decode("utf-8")) | ||
|
||
cmd = "python setup.py install" | ||
run_cmd(cmd, args.verbose) | ||
|
||
os.chdir(os.path.expanduser("~/git/data_management_tools")) | ||
run_cmd(cmd, args.verbose) | ||
|
||
if args.no_chmod: | ||
print("will not rechmod") | ||
else: | ||
print("Chmoding") | ||
cmd = f"find {sys.prefix}/bin -type f -exec chmod g+rx {{}} +" | ||
run_cmd(cmd, args.verbose) | ||
cmd = f"find {sys.prefix} -type f -exec chmod g+r {{}} +" | ||
run_cmd(cmd, args.verbose) | ||
cmd = f"find {sys.prefix} -type d -exec chmod g+rx {{}} +" | ||
run_cmd(cmd, args.verbose) |