MCPcopy
hub / github.com/budtmo/docker-android / Application

Class Application

cli/src/application/__init__.py:7–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5
6
7class Application:
8 class App(Enum):
9 APPIUM = "appium"
10 DEVICE = "device"
11 DISPLAY_SCREEN = "display_screen"
12 DISPLAY_WM = "display_wm"
13 PORT_FORWARDER = "port_forwarder"
14 VNC_SERVER = "vnc_server"
15 VNC_WEB = "vnc_web"
16
17 def __init__(self, name: str, command: str, additional_args: str = "", ui: bool = False) -> None:
18 self.logger = logging.getLogger(self.__class__.__name__)
19 self.name = name
20 self.command = command
21 self.additional_args = additional_args
22 self.ui = ui
23
24 def start(self) -> None:
25 if self.ui:
26 self.logger.info(f"{self.name} will be started with ui!")
27 subprocess.check_call(f"/usr/bin/xterm -T {self.name} -n {self.name} "
28 f"-e '{self.command} {self.additional_args}'", shell=True)
29 else:
30 self.logger.info(f"{self.name} will be started without ui!")
31 subprocess.check_call(f"{self.command} {self.additional_args}", shell=True)
32
33 def __repr__(self) -> str:
34 return "Application(name={n}, command={c}, args={args}, ui={ui})".format(
35 n=self.name, c=self.command, args=self.additional_args, ui=self.ui)

Callers 6

start_appiumFunction · 0.90
start_display_screenFunction · 0.90
start_display_wmFunction · 0.90
start_port_forwarderFunction · 0.90
start_vnc_serverFunction · 0.90
start_vnc_webFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected