mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Minor improvements
This commit is contained in:
@ -285,10 +285,7 @@ def ProcessTest(env):
|
||||
join("$BUILD_DIR", "UnityTestLib"), get_core_package_dir("tool-unity"))
|
||||
env.Prepend(LIBS=[unitylib])
|
||||
|
||||
src_filter = [
|
||||
"+<*.cpp>",
|
||||
"+<*.c>"
|
||||
]
|
||||
src_filter = ["+<*.cpp>", "+<*.c>"]
|
||||
if "PIOTEST" in env:
|
||||
src_filter.append("+<%s%s>" % (env['PIOTEST'], sep))
|
||||
|
||||
|
@ -32,6 +32,10 @@ class MinitermException(PlatformioException):
|
||||
pass
|
||||
|
||||
|
||||
class UserSideException(PlatformioException):
|
||||
pass
|
||||
|
||||
|
||||
class AbortedByUser(PlatformioException):
|
||||
|
||||
MESSAGE = "Aborted by user"
|
||||
|
@ -46,7 +46,7 @@ class ProjectGenerator(object):
|
||||
|
||||
@util.memoized
|
||||
def get_project_env(self):
|
||||
data = None
|
||||
data = {}
|
||||
config = util.load_project_config(self.project_dir)
|
||||
for section in config.sections():
|
||||
if not section.startswith("env:"):
|
||||
|
@ -92,10 +92,24 @@ class MeasurementProtocol(TelemetryBase):
|
||||
self['an'] = " ".join(dpdata)
|
||||
|
||||
def _prefill_custom_data(self):
|
||||
|
||||
def _filter_args(items):
|
||||
result = []
|
||||
stop = False
|
||||
for item in items:
|
||||
item = str(item).lower()
|
||||
result.append(item)
|
||||
if stop:
|
||||
break
|
||||
if item == "account":
|
||||
stop = True
|
||||
return result
|
||||
|
||||
caller_id = str(app.get_session_var("caller_id"))
|
||||
self['cd1'] = util.get_systype()
|
||||
self['cd2'] = "Python/%s %s" % (platform.python_version(),
|
||||
platform.platform())
|
||||
self['cd3'] = " ".join(_filter_args(sys.argv[1:]))
|
||||
self['cd4'] = 1 if (not util.is_ci() and
|
||||
(caller_id or not util.is_container())) else 0
|
||||
if caller_id:
|
||||
@ -109,7 +123,6 @@ class MeasurementProtocol(TelemetryBase):
|
||||
return _arg
|
||||
return None
|
||||
|
||||
self['cd3'] = " ".join([str(s).lower() for s in sys.argv[1:]])
|
||||
if not app.get_session_var("command_ctx"):
|
||||
return
|
||||
ctx_args = app.get_session_var("command_ctx").args
|
||||
@ -301,12 +314,15 @@ def on_event(category, action, label=None, value=None, screen_name=None):
|
||||
|
||||
|
||||
def on_exception(e):
|
||||
skip = any([
|
||||
skip_conditions = [
|
||||
isinstance(e, cls)
|
||||
for cls in (IOError, exception.AbortedByUser,
|
||||
exception.NotGlobalLibDir, exception.InternetIsOffline)
|
||||
])
|
||||
if skip:
|
||||
exception.NotGlobalLibDir, exception.InternetIsOffline,
|
||||
exception.NotPlatformIOProject,
|
||||
exception.UserSideException)
|
||||
]
|
||||
skip_conditions.append("[API] Account: " in str(e))
|
||||
if any(skip_conditions):
|
||||
return
|
||||
is_crash = any([
|
||||
not isinstance(e, exception.PlatformioException),
|
||||
|
@ -19,7 +19,7 @@ from sys import modules
|
||||
from urlparse import urlparse
|
||||
|
||||
from platformio import util
|
||||
from platformio.exception import PlatformioException
|
||||
from platformio.exception import PlatformioException, UserSideException
|
||||
|
||||
|
||||
class VCSClientFactory(object):
|
||||
@ -64,7 +64,7 @@ class VCSClientBase(object):
|
||||
else:
|
||||
assert self.run_cmd(["--version"])
|
||||
except (AssertionError, OSError, PlatformioException):
|
||||
raise PlatformioException(
|
||||
raise UserSideException(
|
||||
"VCS: `%s` client is not installed in your system" %
|
||||
self.command)
|
||||
return True
|
||||
|
Reference in New Issue
Block a user