From d2be7033e992f0e7ed5a54cc90fb5bc0db35f0b7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 31 May 2022 17:12:59 +0300 Subject: [PATCH] Move "remote" command to the root --- platformio/{commands => }/remote/__init__.py | 0 platformio/{commands => }/remote/ac/__init__.py | 0 platformio/{commands => }/remote/ac/base.py | 0 platformio/{commands => }/remote/ac/process.py | 2 +- platformio/{commands => }/remote/ac/psync.py | 4 ++-- platformio/{commands => }/remote/ac/serial.py | 2 +- .../{commands/remote/command.py => remote/cli.py} | 14 +++++++------- .../{commands => }/remote/client/__init__.py | 0 .../{commands => }/remote/client/agent_list.py | 2 +- .../{commands => }/remote/client/agent_service.py | 8 ++++---- .../{commands => }/remote/client/async_base.py | 2 +- platformio/{commands => }/remote/client/base.py | 4 ++-- .../{commands => }/remote/client/device_list.py | 2 +- .../{commands => }/remote/client/device_monitor.py | 2 +- .../{commands => }/remote/client/run_or_test.py | 4 ++-- .../{commands => }/remote/client/update_core.py | 2 +- .../{commands => }/remote/factory/__init__.py | 0 platformio/{commands => }/remote/factory/client.py | 0 platformio/{commands => }/remote/factory/ssl.py | 0 platformio/{commands => }/remote/projectsync.py | 0 20 files changed, 24 insertions(+), 24 deletions(-) rename platformio/{commands => }/remote/__init__.py (100%) rename platformio/{commands => }/remote/ac/__init__.py (100%) rename platformio/{commands => }/remote/ac/base.py (100%) rename platformio/{commands => }/remote/ac/process.py (95%) rename platformio/{commands => }/remote/ac/psync.py (93%) rename platformio/{commands => }/remote/ac/serial.py (96%) rename platformio/{commands/remote/command.py => remote/cli.py} (95%) rename platformio/{commands => }/remote/client/__init__.py (100%) rename platformio/{commands => }/remote/client/agent_list.py (94%) rename platformio/{commands => }/remote/client/agent_service.py (96%) rename platformio/{commands => }/remote/client/async_base.py (97%) rename platformio/{commands => }/remote/client/base.py (97%) rename platformio/{commands => }/remote/client/device_list.py (96%) rename platformio/{commands => }/remote/client/device_monitor.py (99%) rename platformio/{commands => }/remote/client/run_or_test.py (98%) rename platformio/{commands => }/remote/client/update_core.py (92%) rename platformio/{commands => }/remote/factory/__init__.py (100%) rename platformio/{commands => }/remote/factory/client.py (100%) rename platformio/{commands => }/remote/factory/ssl.py (100%) rename platformio/{commands => }/remote/projectsync.py (100%) diff --git a/platformio/commands/remote/__init__.py b/platformio/remote/__init__.py similarity index 100% rename from platformio/commands/remote/__init__.py rename to platformio/remote/__init__.py diff --git a/platformio/commands/remote/ac/__init__.py b/platformio/remote/ac/__init__.py similarity index 100% rename from platformio/commands/remote/ac/__init__.py rename to platformio/remote/ac/__init__.py diff --git a/platformio/commands/remote/ac/base.py b/platformio/remote/ac/base.py similarity index 100% rename from platformio/commands/remote/ac/base.py rename to platformio/remote/ac/base.py diff --git a/platformio/commands/remote/ac/process.py b/platformio/remote/ac/process.py similarity index 95% rename from platformio/commands/remote/ac/process.py rename to platformio/remote/ac/process.py index 9e4f6989..91da456e 100644 --- a/platformio/commands/remote/ac/process.py +++ b/platformio/remote/ac/process.py @@ -16,7 +16,7 @@ import os from twisted.internet import protocol, reactor # pylint: disable=import-error -from platformio.commands.remote.ac.base import AsyncCommandBase +from platformio.remote.ac.base import AsyncCommandBase class ProcessAsyncCmd(protocol.ProcessProtocol, AsyncCommandBase): diff --git a/platformio/commands/remote/ac/psync.py b/platformio/remote/ac/psync.py similarity index 93% rename from platformio/commands/remote/ac/psync.py rename to platformio/remote/ac/psync.py index 87789ed8..8728737c 100644 --- a/platformio/commands/remote/ac/psync.py +++ b/platformio/remote/ac/psync.py @@ -17,8 +17,8 @@ import os import zlib from io import BytesIO -from platformio.commands.remote.ac.base import AsyncCommandBase -from platformio.commands.remote.projectsync import PROJECT_SYNC_STAGE, ProjectSync +from platformio.remote.ac.base import AsyncCommandBase +from platformio.remote.projectsync import PROJECT_SYNC_STAGE, ProjectSync class ProjectSyncAsyncCmd(AsyncCommandBase): diff --git a/platformio/commands/remote/ac/serial.py b/platformio/remote/ac/serial.py similarity index 96% rename from platformio/commands/remote/ac/serial.py rename to platformio/remote/ac/serial.py index d0181f9c..7f7f83f9 100644 --- a/platformio/commands/remote/ac/serial.py +++ b/platformio/remote/ac/serial.py @@ -17,7 +17,7 @@ from time import sleep from twisted.internet import protocol, reactor # pylint: disable=import-error from twisted.internet.serialport import SerialPort # pylint: disable=import-error -from platformio.commands.remote.ac.base import AsyncCommandBase +from platformio.remote.ac.base import AsyncCommandBase class SerialPortAsyncCmd(protocol.Protocol, AsyncCommandBase): diff --git a/platformio/commands/remote/command.py b/platformio/remote/cli.py similarity index 95% rename from platformio/commands/remote/command.py rename to platformio/remote/cli.py index acc0d310..6df9d8a1 100644 --- a/platformio/commands/remote/command.py +++ b/platformio/remote/cli.py @@ -60,14 +60,14 @@ def remote_agent(): type=click.Path(file_okay=False, dir_okay=True, writable=True, resolve_path=True), ) def remote_agent_start(name, share, working_dir): - from platformio.commands.remote.client.agent_service import RemoteAgentService + from platformio.remote.client.agent_service import RemoteAgentService RemoteAgentService(name, share, working_dir).connect() @remote_agent.command("list", short_help="List active agents") def remote_agent_list(): - from platformio.commands.remote.client.agent_list import AgentListClient + from platformio.remote.client.agent_list import AgentListClient AgentListClient().connect() @@ -84,7 +84,7 @@ def remote_agent_list(): ) @click.pass_obj def remote_update(agents, only_check, dry_run): - from platformio.commands.remote.client.update_core import UpdateCoreClient + from platformio.remote.client.update_core import UpdateCoreClient UpdateCoreClient("update", agents, dict(only_check=only_check or dry_run)).connect() @@ -120,7 +120,7 @@ def remote_run( verbose, ): - from platformio.commands.remote.client.run_or_test import RunOrTestClient + from platformio.remote.client.run_or_test import RunOrTestClient cr = RunOrTestClient( "run", @@ -213,7 +213,7 @@ def remote_test( # pylint: disable=redefined-builtin verbose, ): - from platformio.commands.remote.client.run_or_test import RunOrTestClient + from platformio.remote.client.run_or_test import RunOrTestClient cr = RunOrTestClient( "test", @@ -263,7 +263,7 @@ def remote_device(): @click.option("--json-output", is_flag=True) @click.pass_obj def device_list(agents, json_output): - from platformio.commands.remote.client.device_list import DeviceListClient + from platformio.remote.client.device_list import DeviceListClient DeviceListClient(agents, json_output).connect() @@ -346,7 +346,7 @@ def device_list(agents, json_output): @click.pass_obj @click.pass_context def device_monitor(ctx, agents, **kwargs): - from platformio.commands.remote.client.device_monitor import DeviceMonitorClient + from platformio.remote.client.device_monitor import DeviceMonitorClient if kwargs["sock"]: return DeviceMonitorClient(agents, **kwargs).connect() diff --git a/platformio/commands/remote/client/__init__.py b/platformio/remote/client/__init__.py similarity index 100% rename from platformio/commands/remote/client/__init__.py rename to platformio/remote/client/__init__.py diff --git a/platformio/commands/remote/client/agent_list.py b/platformio/remote/client/agent_list.py similarity index 94% rename from platformio/commands/remote/client/agent_list.py rename to platformio/remote/client/agent_list.py index df1de28b..103c0f8c 100644 --- a/platformio/commands/remote/client/agent_list.py +++ b/platformio/remote/client/agent_list.py @@ -16,7 +16,7 @@ from datetime import datetime import click -from platformio.commands.remote.client.base import RemoteClientBase +from platformio.remote.client.base import RemoteClientBase class AgentListClient(RemoteClientBase): diff --git a/platformio/commands/remote/client/agent_service.py b/platformio/remote/client/agent_service.py similarity index 96% rename from platformio/commands/remote/client/agent_service.py rename to platformio/remote/client/agent_service.py index 0501021a..a2f0a05a 100644 --- a/platformio/commands/remote/client/agent_service.py +++ b/platformio/remote/client/agent_service.py @@ -18,13 +18,13 @@ from twisted.logger import LogLevel # pylint: disable=import-error from twisted.spread import pb # pylint: disable=import-error from platformio import proc -from platformio.commands.remote.ac.process import ProcessAsyncCmd -from platformio.commands.remote.ac.psync import ProjectSyncAsyncCmd -from platformio.commands.remote.ac.serial import SerialPortAsyncCmd -from platformio.commands.remote.client.base import RemoteClientBase from platformio.device.list import list_serial_ports from platformio.project.config import ProjectConfig from platformio.project.exception import NotPlatformIOProjectError +from platformio.remote.ac.process import ProcessAsyncCmd +from platformio.remote.ac.psync import ProjectSyncAsyncCmd +from platformio.remote.ac.serial import SerialPortAsyncCmd +from platformio.remote.client.base import RemoteClientBase class RemoteAgentService(RemoteClientBase): diff --git a/platformio/commands/remote/client/async_base.py b/platformio/remote/client/async_base.py similarity index 97% rename from platformio/commands/remote/client/async_base.py rename to platformio/remote/client/async_base.py index a07e110b..488802a5 100644 --- a/platformio/commands/remote/client/async_base.py +++ b/platformio/remote/client/async_base.py @@ -15,7 +15,7 @@ import click from twisted.spread import pb # pylint: disable=import-error -from platformio.commands.remote.client.base import RemoteClientBase +from platformio.remote.client.base import RemoteClientBase class AsyncClientBase(RemoteClientBase): diff --git a/platformio/commands/remote/client/base.py b/platformio/remote/client/base.py similarity index 97% rename from platformio/commands/remote/client/base.py rename to platformio/remote/client/base.py index 7ca7be3b..fe2c4fb4 100644 --- a/platformio/commands/remote/client/base.py +++ b/platformio/remote/client/base.py @@ -26,8 +26,8 @@ from twisted.spread import pb # pylint: disable=import-error from zope.interface import provider # pylint: disable=import-error from platformio import __pioremote_endpoint__, __version__, app, exception, maintenance -from platformio.commands.remote.factory.client import RemoteClientFactory -from platformio.commands.remote.factory.ssl import SSLContextFactory +from platformio.remote.factory.client import RemoteClientFactory +from platformio.remote.factory.ssl import SSLContextFactory class RemoteClientBase( # pylint: disable=too-many-instance-attributes diff --git a/platformio/commands/remote/client/device_list.py b/platformio/remote/client/device_list.py similarity index 96% rename from platformio/commands/remote/client/device_list.py rename to platformio/remote/client/device_list.py index dba1729f..a22911b4 100644 --- a/platformio/commands/remote/client/device_list.py +++ b/platformio/remote/client/device_list.py @@ -16,7 +16,7 @@ import json import click -from platformio.commands.remote.client.base import RemoteClientBase +from platformio.remote.client.base import RemoteClientBase class DeviceListClient(RemoteClientBase): diff --git a/platformio/commands/remote/client/device_monitor.py b/platformio/remote/client/device_monitor.py similarity index 99% rename from platformio/commands/remote/client/device_monitor.py rename to platformio/remote/client/device_monitor.py index b880d270..7ddc0048 100644 --- a/platformio/commands/remote/client/device_monitor.py +++ b/platformio/remote/client/device_monitor.py @@ -19,7 +19,7 @@ import click from twisted.internet import protocol, reactor, task # pylint: disable=import-error from twisted.spread import pb # pylint: disable=import-error -from platformio.commands.remote.client.base import RemoteClientBase +from platformio.remote.client.base import RemoteClientBase class SMBridgeProtocol(protocol.Protocol): # pylint: disable=no-init diff --git a/platformio/commands/remote/client/run_or_test.py b/platformio/remote/client/run_or_test.py similarity index 98% rename from platformio/commands/remote/client/run_or_test.py rename to platformio/remote/client/run_or_test.py index cdc1465d..71065640 100644 --- a/platformio/commands/remote/client/run_or_test.py +++ b/platformio/remote/client/run_or_test.py @@ -21,10 +21,10 @@ from io import BytesIO from twisted.spread import pb # pylint: disable=import-error from platformio import fs -from platformio.commands.remote.client.async_base import AsyncClientBase -from platformio.commands.remote.projectsync import PROJECT_SYNC_STAGE, ProjectSync from platformio.compat import hashlib_encode_data from platformio.project.config import ProjectConfig +from platformio.remote.client.async_base import AsyncClientBase +from platformio.remote.projectsync import PROJECT_SYNC_STAGE, ProjectSync class RunOrTestClient(AsyncClientBase): diff --git a/platformio/commands/remote/client/update_core.py b/platformio/remote/client/update_core.py similarity index 92% rename from platformio/commands/remote/client/update_core.py rename to platformio/remote/client/update_core.py index 49e4488c..4fdec4cc 100644 --- a/platformio/commands/remote/client/update_core.py +++ b/platformio/remote/client/update_core.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from platformio.commands.remote.client.async_base import AsyncClientBase +from platformio.remote.client.async_base import AsyncClientBase class UpdateCoreClient(AsyncClientBase): diff --git a/platformio/commands/remote/factory/__init__.py b/platformio/remote/factory/__init__.py similarity index 100% rename from platformio/commands/remote/factory/__init__.py rename to platformio/remote/factory/__init__.py diff --git a/platformio/commands/remote/factory/client.py b/platformio/remote/factory/client.py similarity index 100% rename from platformio/commands/remote/factory/client.py rename to platformio/remote/factory/client.py diff --git a/platformio/commands/remote/factory/ssl.py b/platformio/remote/factory/ssl.py similarity index 100% rename from platformio/commands/remote/factory/ssl.py rename to platformio/remote/factory/ssl.py diff --git a/platformio/commands/remote/projectsync.py b/platformio/remote/projectsync.py similarity index 100% rename from platformio/commands/remote/projectsync.py rename to platformio/remote/projectsync.py