Implemented new `[platformio]` section for Configuration File | Resolve #14

This commit is contained in:
Ivan Kravets
2014-08-22 17:57:28 +03:00
parent e4ba030a0c
commit 768eea8a6d
3 changed files with 30 additions and 1 deletions

View File

@ -4,6 +4,9 @@ Release History
0.7.0 (?)
---------
* Implemented new ``[platformio]`` section for Configuration File with ``home_dir``
option (`issue #14 <https://github.com/ivankravets/platformio/issues/14>`_)
0.6.0 (2014-08-09)
------------------

View File

@ -14,6 +14,24 @@ The sections and their allowable values are described below.
.. contents::
[platformio]
------------
A ``platformio`` section is used for overriding default configuration options
Options
~~~~~~~
``home_dir``
^^^^^^^^^^^^
A PlatformIO's home directory that is used to store platforms tools chain,
frameworks, libraries, service data and etc.
A default value is user's home directory: *Unix* - ``~/.platformio``,
Windows - ``%HOMEPATH%\.platformio``.
[env:NAME]
----------

View File

@ -26,7 +26,15 @@ def get_systype():
def get_home_dir():
return expanduser("~/.platformio")
home_dir = expanduser("~/.platformio")
try:
config = get_project_config()
if (config.has_section("platformio") and
config.has_option("platformio", "home_dir")):
return config.get("platformio", "home_dir")
except NotPlatformProject:
pass
return home_dir
def get_source_dir():