mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 18:44:27 +02:00
Cache loaded project config
This commit is contained in:
@@ -334,12 +334,8 @@ def get_projectdata_dir():
|
|||||||
"data"))
|
"data"))
|
||||||
|
|
||||||
|
|
||||||
def load_project_config(path=None):
|
@memoized()
|
||||||
if not path or isdir(path):
|
def _load_project_config(path):
|
||||||
path = join(path or get_project_dir(), "platformio.ini")
|
|
||||||
if not isfile(path):
|
|
||||||
raise exception.NotPlatformIOProject(
|
|
||||||
dirname(path) if path.endswith("platformio.ini") else path)
|
|
||||||
cp = ProjectConfig()
|
cp = ProjectConfig()
|
||||||
try:
|
try:
|
||||||
cp.read(path)
|
cp.read(path)
|
||||||
@@ -348,6 +344,15 @@ def load_project_config(path=None):
|
|||||||
return cp
|
return cp
|
||||||
|
|
||||||
|
|
||||||
|
def load_project_config(path=None):
|
||||||
|
if not path or isdir(path):
|
||||||
|
path = join(path or get_project_dir(), "platformio.ini")
|
||||||
|
if not isfile(path):
|
||||||
|
raise exception.NotPlatformIOProject(
|
||||||
|
dirname(path) if path.endswith("platformio.ini") else path)
|
||||||
|
return _load_project_config(path)
|
||||||
|
|
||||||
|
|
||||||
def parse_conf_multi_values(items):
|
def parse_conf_multi_values(items):
|
||||||
result = []
|
result = []
|
||||||
if not items:
|
if not items:
|
||||||
|
Reference in New Issue
Block a user