move launcher installation from installer to oml

This commit is contained in:
Jan Gerber 2015-03-31 20:24:14 +02:00
commit 393fe7eb6e
5 changed files with 116 additions and 67 deletions

View file

@ -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)