mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 01:57:13 +02:00
Use generic MISSING helper
This commit is contained in:
@ -30,7 +30,7 @@ from SCons.Script import DefaultEnvironment # pylint: disable=import-error
|
|||||||
|
|
||||||
from platformio import exception, fs
|
from platformio import exception, fs
|
||||||
from platformio.builder.tools import platformio as piotool
|
from platformio.builder.tools import platformio as piotool
|
||||||
from platformio.compat import IS_WINDOWS, hashlib_encode_data, string_types
|
from platformio.compat import IS_WINDOWS, MISSING, hashlib_encode_data, string_types
|
||||||
from platformio.http import HTTPClientError, InternetIsOffline
|
from platformio.http import HTTPClientError, InternetIsOffline
|
||||||
from platformio.package.exception import (
|
from platformio.package.exception import (
|
||||||
MissingPackageManifestError,
|
MissingPackageManifestError,
|
||||||
@ -571,11 +571,10 @@ class ArduinoLibBuilder(LibBuilderBase):
|
|||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
if not self._manifest.get("dependencies"):
|
if not self._manifest.get("dependencies"):
|
||||||
return LibBuilderBase.lib_ldf_mode.fget(self)
|
return LibBuilderBase.lib_ldf_mode.fget(self)
|
||||||
missing = object()
|
|
||||||
global_value = self.env.GetProjectConfig().getraw(
|
global_value = self.env.GetProjectConfig().getraw(
|
||||||
"env:" + self.env["PIOENV"], "lib_ldf_mode", missing
|
"env:" + self.env["PIOENV"], "lib_ldf_mode", MISSING
|
||||||
)
|
)
|
||||||
if global_value != missing:
|
if global_value != MISSING:
|
||||||
return LibBuilderBase.lib_ldf_mode.fget(self)
|
return LibBuilderBase.lib_ldf_mode.fget(self)
|
||||||
# automatically enable C++ Preprocessing in runtime
|
# automatically enable C++ Preprocessing in runtime
|
||||||
# (Arduino IDE has this behavior)
|
# (Arduino IDE has this behavior)
|
||||||
@ -827,11 +826,10 @@ class PlatformIOLibBuilder(LibBuilderBase):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def lib_archive(self):
|
def lib_archive(self):
|
||||||
missing = object()
|
|
||||||
global_value = self.env.GetProjectConfig().getraw(
|
global_value = self.env.GetProjectConfig().getraw(
|
||||||
"env:" + self.env["PIOENV"], "lib_archive", missing
|
"env:" + self.env["PIOENV"], "lib_archive", MISSING
|
||||||
)
|
)
|
||||||
if global_value != missing:
|
if global_value != MISSING:
|
||||||
return self.env.GetProjectConfig().get(
|
return self.env.GetProjectConfig().get(
|
||||||
"env:" + self.env["PIOENV"], "lib_archive"
|
"env:" + self.env["PIOENV"], "lib_archive"
|
||||||
)
|
)
|
||||||
|
@ -16,7 +16,7 @@ import json
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from platformio import fs, proc, util
|
from platformio import fs, proc, util
|
||||||
from platformio.compat import string_types
|
from platformio.compat import MISSING, string_types
|
||||||
from platformio.debug.exception import DebugInvalidOptionsError
|
from platformio.debug.exception import DebugInvalidOptionsError
|
||||||
from platformio.project.config import ProjectConfig
|
from platformio.project.config import ProjectConfig
|
||||||
from platformio.project.helpers import load_build_metadata
|
from platformio.project.helpers import load_build_metadata
|
||||||
@ -96,9 +96,8 @@ class DebugConfigBase: # pylint: disable=too-many-instance-attributes
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def init_break(self):
|
def init_break(self):
|
||||||
missed = object()
|
result = self.env_options.get("debug_init_break", MISSING)
|
||||||
result = self.env_options.get("debug_init_break", missed)
|
if result != MISSING:
|
||||||
if result != missed:
|
|
||||||
return result
|
return result
|
||||||
result = None
|
result = None
|
||||||
if not result:
|
if not result:
|
||||||
|
Reference in New Issue
Block a user