1# Copyright 2024 The Chromium Authors 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import logging 6 7from devil.android.sdk import adb_wrapper 8 9from pylib.local.device import local_device_environment 10 11 12class LocalDeviceEthernetEnvironment( 13 local_device_environment.LocalDeviceEnvironment): 14 """ 15 A subclass of LocalDeviceEnvironment for devices connected over ethernet. 16 17 This class cannot be instantiated. Subclasses should implement the 18 GetDeviceHostname method, as this is specific to each environment. 19 """ 20 21 def __init__(self, args, output_manager, error_func): 22 super().__init__(args, output_manager, error_func) 23 hostname = self.GetDeviceHostname() 24 logging.info('connecting to %s', hostname) 25 adb_wrapper.AdbWrapper.Connect(hostname) 26 27 def GetDeviceHostname(self): 28 raise NotImplementedError 29