mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-30 10:07:14 +02:00
YAPF
This commit is contained in:
@ -354,7 +354,8 @@ def get_cid():
|
|||||||
except: # pylint: disable=bare-except
|
except: # pylint: disable=bare-except
|
||||||
pass
|
pass
|
||||||
cid = str(
|
cid = str(
|
||||||
uuid.UUID(bytes=hashlib.md5(str(_uid if _uid else uuid.getnode()))
|
uuid.UUID(
|
||||||
.digest()))
|
bytes=hashlib.md5(str(_uid if _uid else uuid.getnode()))
|
||||||
|
.digest()))
|
||||||
set_state_item("cid", cid)
|
set_state_item("cid", cid)
|
||||||
return cid
|
return cid
|
||||||
|
@ -138,8 +138,9 @@ for var in ("BUILD_FLAGS", "SRC_BUILD_FLAGS", "SRC_FILTER", "EXTRA_SCRIPTS",
|
|||||||
|
|
||||||
# Configure extra library source directories for LDF
|
# Configure extra library source directories for LDF
|
||||||
if util.get_project_optional_dir("lib_extra_dirs"):
|
if util.get_project_optional_dir("lib_extra_dirs"):
|
||||||
env.Prepend(LIBSOURCE_DIRS=util.parse_conf_multi_values(
|
env.Prepend(
|
||||||
util.get_project_optional_dir("lib_extra_dirs")))
|
LIBSOURCE_DIRS=util.parse_conf_multi_values(
|
||||||
|
util.get_project_optional_dir("lib_extra_dirs")))
|
||||||
env.Prepend(LIBSOURCE_DIRS=env.get("LIB_EXTRA_DIRS", []))
|
env.Prepend(LIBSOURCE_DIRS=env.get("LIB_EXTRA_DIRS", []))
|
||||||
env['LIBSOURCE_DIRS'] = [
|
env['LIBSOURCE_DIRS'] = [
|
||||||
expanduser(d) if d.startswith("~") else d for d in env['LIBSOURCE_DIRS']
|
expanduser(d) if d.startswith("~") else d for d in env['LIBSOURCE_DIRS']
|
||||||
|
@ -35,8 +35,9 @@ SRC_FILTER_DEFAULT = ["+<*>", "-<.git%s>" % sep, "-<svn%s>" % sep]
|
|||||||
def BuildProgram(env):
|
def BuildProgram(env):
|
||||||
|
|
||||||
def _append_pio_macros():
|
def _append_pio_macros():
|
||||||
env.AppendUnique(CPPDEFINES=[("PLATFORMIO", int(
|
env.AppendUnique(CPPDEFINES=[(
|
||||||
"{0:02d}{1:02d}{2:02d}".format(*pioversion_to_intstr())))])
|
"PLATFORMIO",
|
||||||
|
int("{0:02d}{1:02d}{2:02d}".format(*pioversion_to_intstr())))])
|
||||||
|
|
||||||
_append_pio_macros()
|
_append_pio_macros()
|
||||||
|
|
||||||
|
@ -180,13 +180,14 @@ class EnvironmentProcessor(object):
|
|||||||
self.options[k] = self.options[k].strip()
|
self.options[k] = self.options[k].strip()
|
||||||
|
|
||||||
if not self.silent:
|
if not self.silent:
|
||||||
click.echo(
|
click.echo("[%s] Processing %s (%s)" %
|
||||||
"[%s] Processing %s (%s)" %
|
(datetime.now().strftime("%c"),
|
||||||
(datetime.now().strftime("%c"),
|
click.style(self.name, fg="cyan", bold=True),
|
||||||
click.style(self.name, fg="cyan", bold=True), "; ".join([
|
"; ".join([
|
||||||
"%s: %s" % (k, ", ".join(util.parse_conf_multi_values(v)))
|
"%s: %s" %
|
||||||
for k, v in self.options.items()
|
(k, ", ".join(util.parse_conf_multi_values(v)))
|
||||||
])))
|
for k, v in self.options.items()
|
||||||
|
])))
|
||||||
click.secho("-" * terminal_width, bold=True)
|
click.secho("-" * terminal_width, bold=True)
|
||||||
|
|
||||||
self.options = self._validate_options(self.options)
|
self.options = self._validate_options(self.options)
|
||||||
|
@ -36,13 +36,11 @@ PIOPLUS_AUTO_UPDATES_MAX = 100
|
|||||||
class CorePackageManager(PackageManager):
|
class CorePackageManager(PackageManager):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
PackageManager.__init__(
|
PackageManager.__init__(self, join(util.get_home_dir(), "packages"), [
|
||||||
self,
|
"https://dl.bintray.com/platformio/dl-packages/manifest.json",
|
||||||
join(util.get_home_dir(), "packages"), [
|
"http%s://dl.platformio.org/packages/manifest.json" %
|
||||||
"https://dl.bintray.com/platformio/dl-packages/manifest.json",
|
("" if sys.version_info < (2, 7, 9) else "s")
|
||||||
"http%s://dl.platformio.org/packages/manifest.json" %
|
])
|
||||||
("" if sys.version_info < (2, 7, 9) else "s")
|
|
||||||
])
|
|
||||||
|
|
||||||
def install(self, name, requirements=None, *args, **kwargs):
|
def install(self, name, requirements=None, *args, **kwargs):
|
||||||
PackageManager.install(self, name, requirements, *args, **kwargs)
|
PackageManager.install(self, name, requirements, *args, **kwargs)
|
||||||
|
@ -499,8 +499,8 @@ class BasePkgManager(PkgRepoMixin, PkgInstallerMixin):
|
|||||||
url_marker = "://"
|
url_marker = "://"
|
||||||
|
|
||||||
req_conditions = [
|
req_conditions = [
|
||||||
not requirements,
|
|
||||||
"@" in text,
|
"@" in text,
|
||||||
|
not requirements,
|
||||||
not url_marker.startswith("git")
|
not url_marker.startswith("git")
|
||||||
] # yapf: disable
|
] # yapf: disable
|
||||||
if all(req_conditions):
|
if all(req_conditions):
|
||||||
|
Reference in New Issue
Block a user