From 00f75c753df3bbb59f1db35c752b4232b87766be Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 29 Jan 2015 18:50:12 +0200 Subject: [PATCH 1/2] Fix home dir path for Windows --- platformio/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/util.py b/platformio/util.py index 83c3bdf3..4f7ed8b2 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -37,7 +37,7 @@ def get_home_dir(): pass if not home_dir: - home_dir = expanduser("~/.platformio") + home_dir = join(expanduser("~"), ".platformio") if not isdir(home_dir): makedirs(home_dir) From 6e93806b12c5ebdd6933add4c2d3b086ff425bc8 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 29 Jan 2015 18:54:28 +0200 Subject: [PATCH 2/2] Allow args/kwargs for exec command --- platformio/util.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platformio/util.py b/platformio/util.py index 4f7ed8b2..4e2e93b7 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -85,9 +85,12 @@ def change_filemtime(path, time): utime(path, (time, time)) -def exec_command(args): - use_shell = system() == "Windows" - p = Popen(args, stdout=PIPE, stderr=PIPE, shell=use_shell) +def exec_command(*args, **kwargs): + kwargs['stdout'] = PIPE + kwargs['stderr'] = PIPE + kwargs['shell'] = system() == "Windows" + + p = Popen(*args, **kwargs) out, err = p.communicate() return dict(out=out.strip(), err=err.strip())