mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-31 02:27:13 +02:00
Move "remote" command to the root
This commit is contained in:
@ -16,7 +16,7 @@ import os
|
|||||||
|
|
||||||
from twisted.internet import protocol, reactor # pylint: disable=import-error
|
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):
|
class ProcessAsyncCmd(protocol.ProcessProtocol, AsyncCommandBase):
|
@ -17,8 +17,8 @@ import os
|
|||||||
import zlib
|
import zlib
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
from platformio.commands.remote.ac.base import AsyncCommandBase
|
from platformio.remote.ac.base import AsyncCommandBase
|
||||||
from platformio.commands.remote.projectsync import PROJECT_SYNC_STAGE, ProjectSync
|
from platformio.remote.projectsync import PROJECT_SYNC_STAGE, ProjectSync
|
||||||
|
|
||||||
|
|
||||||
class ProjectSyncAsyncCmd(AsyncCommandBase):
|
class ProjectSyncAsyncCmd(AsyncCommandBase):
|
@ -17,7 +17,7 @@ from time import sleep
|
|||||||
from twisted.internet import protocol, reactor # pylint: disable=import-error
|
from twisted.internet import protocol, reactor # pylint: disable=import-error
|
||||||
from twisted.internet.serialport import SerialPort # 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):
|
class SerialPortAsyncCmd(protocol.Protocol, AsyncCommandBase):
|
@ -60,14 +60,14 @@ def remote_agent():
|
|||||||
type=click.Path(file_okay=False, dir_okay=True, writable=True, resolve_path=True),
|
type=click.Path(file_okay=False, dir_okay=True, writable=True, resolve_path=True),
|
||||||
)
|
)
|
||||||
def remote_agent_start(name, share, working_dir):
|
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()
|
RemoteAgentService(name, share, working_dir).connect()
|
||||||
|
|
||||||
|
|
||||||
@remote_agent.command("list", short_help="List active agents")
|
@remote_agent.command("list", short_help="List active agents")
|
||||||
def remote_agent_list():
|
def remote_agent_list():
|
||||||
from platformio.commands.remote.client.agent_list import AgentListClient
|
from platformio.remote.client.agent_list import AgentListClient
|
||||||
|
|
||||||
AgentListClient().connect()
|
AgentListClient().connect()
|
||||||
|
|
||||||
@ -84,7 +84,7 @@ def remote_agent_list():
|
|||||||
)
|
)
|
||||||
@click.pass_obj
|
@click.pass_obj
|
||||||
def remote_update(agents, only_check, dry_run):
|
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()
|
UpdateCoreClient("update", agents, dict(only_check=only_check or dry_run)).connect()
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ def remote_run(
|
|||||||
verbose,
|
verbose,
|
||||||
):
|
):
|
||||||
|
|
||||||
from platformio.commands.remote.client.run_or_test import RunOrTestClient
|
from platformio.remote.client.run_or_test import RunOrTestClient
|
||||||
|
|
||||||
cr = RunOrTestClient(
|
cr = RunOrTestClient(
|
||||||
"run",
|
"run",
|
||||||
@ -213,7 +213,7 @@ def remote_test( # pylint: disable=redefined-builtin
|
|||||||
verbose,
|
verbose,
|
||||||
):
|
):
|
||||||
|
|
||||||
from platformio.commands.remote.client.run_or_test import RunOrTestClient
|
from platformio.remote.client.run_or_test import RunOrTestClient
|
||||||
|
|
||||||
cr = RunOrTestClient(
|
cr = RunOrTestClient(
|
||||||
"test",
|
"test",
|
||||||
@ -263,7 +263,7 @@ def remote_device():
|
|||||||
@click.option("--json-output", is_flag=True)
|
@click.option("--json-output", is_flag=True)
|
||||||
@click.pass_obj
|
@click.pass_obj
|
||||||
def device_list(agents, json_output):
|
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()
|
DeviceListClient(agents, json_output).connect()
|
||||||
|
|
||||||
@ -346,7 +346,7 @@ def device_list(agents, json_output):
|
|||||||
@click.pass_obj
|
@click.pass_obj
|
||||||
@click.pass_context
|
@click.pass_context
|
||||||
def device_monitor(ctx, agents, **kwargs):
|
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"]:
|
if kwargs["sock"]:
|
||||||
return DeviceMonitorClient(agents, **kwargs).connect()
|
return DeviceMonitorClient(agents, **kwargs).connect()
|
@ -16,7 +16,7 @@ from datetime import datetime
|
|||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
from platformio.commands.remote.client.base import RemoteClientBase
|
from platformio.remote.client.base import RemoteClientBase
|
||||||
|
|
||||||
|
|
||||||
class AgentListClient(RemoteClientBase):
|
class AgentListClient(RemoteClientBase):
|
@ -18,13 +18,13 @@ from twisted.logger import LogLevel # pylint: disable=import-error
|
|||||||
from twisted.spread import pb # pylint: disable=import-error
|
from twisted.spread import pb # pylint: disable=import-error
|
||||||
|
|
||||||
from platformio import proc
|
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.device.list import list_serial_ports
|
||||||
from platformio.project.config import ProjectConfig
|
from platformio.project.config import ProjectConfig
|
||||||
from platformio.project.exception import NotPlatformIOProjectError
|
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):
|
class RemoteAgentService(RemoteClientBase):
|
@ -15,7 +15,7 @@
|
|||||||
import click
|
import click
|
||||||
from twisted.spread import pb # 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 AsyncClientBase(RemoteClientBase):
|
class AsyncClientBase(RemoteClientBase):
|
@ -26,8 +26,8 @@ from twisted.spread import pb # pylint: disable=import-error
|
|||||||
from zope.interface import provider # pylint: disable=import-error
|
from zope.interface import provider # pylint: disable=import-error
|
||||||
|
|
||||||
from platformio import __pioremote_endpoint__, __version__, app, exception, maintenance
|
from platformio import __pioremote_endpoint__, __version__, app, exception, maintenance
|
||||||
from platformio.commands.remote.factory.client import RemoteClientFactory
|
from platformio.remote.factory.client import RemoteClientFactory
|
||||||
from platformio.commands.remote.factory.ssl import SSLContextFactory
|
from platformio.remote.factory.ssl import SSLContextFactory
|
||||||
|
|
||||||
|
|
||||||
class RemoteClientBase( # pylint: disable=too-many-instance-attributes
|
class RemoteClientBase( # pylint: disable=too-many-instance-attributes
|
@ -16,7 +16,7 @@ import json
|
|||||||
|
|
||||||
import click
|
import click
|
||||||
|
|
||||||
from platformio.commands.remote.client.base import RemoteClientBase
|
from platformio.remote.client.base import RemoteClientBase
|
||||||
|
|
||||||
|
|
||||||
class DeviceListClient(RemoteClientBase):
|
class DeviceListClient(RemoteClientBase):
|
@ -19,7 +19,7 @@ import click
|
|||||||
from twisted.internet import protocol, reactor, task # pylint: disable=import-error
|
from twisted.internet import protocol, reactor, task # pylint: disable=import-error
|
||||||
from twisted.spread import pb # 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
|
class SMBridgeProtocol(protocol.Protocol): # pylint: disable=no-init
|
@ -21,10 +21,10 @@ from io import BytesIO
|
|||||||
from twisted.spread import pb # pylint: disable=import-error
|
from twisted.spread import pb # pylint: disable=import-error
|
||||||
|
|
||||||
from platformio import fs
|
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.compat import hashlib_encode_data
|
||||||
from platformio.project.config import ProjectConfig
|
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):
|
class RunOrTestClient(AsyncClientBase):
|
@ -12,7 +12,7 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
from platformio.commands.remote.client.async_base import AsyncClientBase
|
from platformio.remote.client.async_base import AsyncClientBase
|
||||||
|
|
||||||
|
|
||||||
class UpdateCoreClient(AsyncClientBase):
|
class UpdateCoreClient(AsyncClientBase):
|
Reference in New Issue
Block a user