move launcher installation from installer to oml
This commit is contained in:
parent
d65ad0e8ea
commit
393fe7eb6e
5 changed files with 116 additions and 67 deletions
15
oml/utils.py
15
oml/utils.py
|
|
@ -230,3 +230,18 @@ def datetime2ts(dt):
|
|||
|
||||
def ts2datetime(ts):
|
||||
return datetime.utcfromtimestamp(float(ts))
|
||||
|
||||
def run(*cmd):
|
||||
p = subprocess.Popen(cmd, close_fds=True)
|
||||
p.wait()
|
||||
return p.returncode
|
||||
|
||||
def get(*cmd):
|
||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True)
|
||||
stdout, error = p.communicate()
|
||||
return stdout.decode()
|
||||
|
||||
def makefolder(path):
|
||||
dirname = os.path.dirname(path)
|
||||
if not os.path.exists(dirname):
|
||||
os.makedirs(dirname)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue