forked from platformio/platformio-core
Remove unused Python imports
This commit is contained in:
1 parent
3adcf66453
commit
3df01405a1
22 files changed
+111
-131
No files matched your search
@@ -30,6 +30,7 @@ from platformio.commands.debug import helpers, initcfgs
|
||||
from platformio.commands.debug.process import BaseProcess
|
||||
from platformio.commands.debug.server import DebugServer
|
||||
from platformio.compat import PY2
|
||||
from platformio.project.helpers import get_project_cache_dir
|
||||
from platformio.telemetry import MeasurementProtocol
|
||||
|
||||
LOG_FILE = None
|
||||
@@ -49,10 +50,10 @@ class GDBClient(BaseProcess): # pylint: disable=too-many-instance-attributes
|
||||
self._debug_server = DebugServer(debug_options, env_options)
|
||||
self._session_id = None
|
||||
|
||||
if not isdir(util.get_cache_dir()):
|
||||
os.makedirs(util.get_cache_dir())
|
||||
if not isdir(get_project_cache_dir()):
|
||||
os.makedirs(get_project_cache_dir())
|
||||
self._gdbsrc_dir = mkdtemp(
|
||||
dir=util.get_cache_dir(), prefix=".piodebug-")
|
||||
dir=get_project_cache_dir(), prefix=".piodebug-")
|
||||
|
||||
self._target_is_run = False
|
||||
self._last_server_activity = 0
|
||||
|
||||
@@ -24,6 +24,7 @@ from platformio import exception, util
|
||||
from platformio.commands.debug import helpers
|
||||
from platformio.managers.core import inject_contrib_pysite
|
||||
from platformio.project.config import ProjectConfig
|
||||
from platformio.project.helpers import is_platformio_project
|
||||
|
||||
|
||||
@click.command(
|
||||
@@ -66,7 +67,7 @@ def cli(ctx, project_dir, project_conf, environment, verbose, interface,
|
||||
('~"%s\\n"' if helpers.is_mi_mode(__unprocessed) else "%s") %
|
||||
line)
|
||||
|
||||
if not util.is_platformio_project(project_dir) and os.getenv("CWD"):
|
||||
if not is_platformio_project(project_dir) and os.getenv("CWD"):
|
||||
project_dir = os.getenv("CWD")
|
||||
|
||||
with util.cd(project_dir):
|
||||
|
||||
@@ -17,9 +17,9 @@ import os
|
||||
import click
|
||||
from twisted.internet import protocol # pylint: disable=import-error
|
||||
|
||||
from platformio import util
|
||||
from platformio.commands.debug import helpers
|
||||
from platformio.compat import string_types
|
||||
from platformio.project.helpers import get_project_core_dir
|
||||
|
||||
LOG_FILE = None
|
||||
|
||||
@@ -29,7 +29,8 @@ class BaseProcess(protocol.ProcessProtocol, object):
|
||||
STDOUT_CHUNK_SIZE = 2048
|
||||
|
||||
COMMON_PATTERNS = {
|
||||
"PLATFORMIO_HOME_DIR": helpers.escape_path(util.get_home_dir()),
|
||||
"PLATFORMIO_HOME_DIR": helpers.escape_path(get_project_core_dir()),
|
||||
"PLATFORMIO_CORE_DIR": helpers.escape_path(get_project_core_dir()),
|
||||
"PYTHONEXE": os.getenv("PYTHONEXEPATH", "")
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ from twisted.internet import reactor # pylint: disable=import-error
|
||||
from platformio import exception, util
|
||||
from platformio.commands.debug import helpers
|
||||
from platformio.commands.debug.process import BaseProcess
|
||||
from platformio.proc import where_is_program
|
||||
|
||||
|
||||
class DebugServer(BaseProcess):
|
||||
@@ -47,7 +48,7 @@ class DebugServer(BaseProcess):
|
||||
server_executable = server_executable + ".exe"
|
||||
|
||||
if not isfile(server_executable):
|
||||
server_executable = util.where_is_program(server_executable)
|
||||
server_executable = where_is_program(server_executable)
|
||||
if not isfile(server_executable):
|
||||
raise exception.DebugInvalidOptions(
|
||||
"\nCould not launch Debug Server '%s'. Please check that it "
|
||||
|
||||
Reference in new issue
Block a user