diff --git a/platformio/app.py b/platformio/app.py index d1083649..34a2a7d1 100644 --- a/platformio/app.py +++ b/platformio/app.py @@ -22,9 +22,9 @@ from os.path import dirname, getmtime, isdir, isfile, join from time import time import requests -from lockfile import LockFile +from lockfile import LockFailed, LockFile -from platformio import __version__, util +from platformio import __version__, exception, util from platformio.exception import InvalidSettingName, InvalidSettingValue DEFAULT_SETTINGS = { @@ -106,7 +106,16 @@ class State(object): (time() - getmtime(self._lockfile.lock_file)) > 10: self._lockfile.break_lock() - self._lockfile.acquire() + try: + self._lockfile.acquire() + except LockFailed: + raise exception.PlatformioException( + "The directory `{0}` or its parent directory is not owned by " + "the current user and PlatformIO can not store configuration " + "data. \nPlease check the permissions and owner of that " + "directory. Otherwise, please remove manually `{0}` " + "directory and PlatformIO will create new from the current " + "user.".format(dirname(self.path))) def _unlock_state_file(self): if self._lockfile: diff --git a/scripts/get-platformio.py b/scripts/get-platformio.py index c67debfe..455de013 100644 --- a/scripts/get-platformio.py +++ b/scripts/get-platformio.py @@ -176,18 +176,6 @@ https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platf else: print("\n ==> Installation process has been " "successfully FINISHED! <==\n") - - try: - print_exec_result(exec_command("platformio")) - except: - try: - print_exec_result(exec_python_cmd([ - "-m", - "platformio.__main__" if sys.version_info < (2, 7, 0) else - "platformio"])) - except: - pass - finally: print (""" ----------------------------------------