Skip to content

Commit

Permalink
Implemented new [platformio] section for Configuration File | Res…
Browse files Browse the repository at this point in the history
…olve #14
  • Loading branch information
ivankravets committed Aug 22, 2014
1 parent e4ba030 commit 768eea8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
3 changes: 3 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
------------------

Expand Down
18 changes: 18 additions & 0 deletions docs/projectconf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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]
----------

Expand Down
10 changes: 9 additions & 1 deletion platformio/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 768eea8

Please sign in to comment.