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

Method _use_override_config

cli/src/device/emulator.py:113–135  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

111 self.logger.info("Samsung device profile is linked")
112
113 def _use_override_config(self) -> None:
114 override_confg_path = os.getenv(ENV.EMULATOR_CONFIG_PATH)
115
116 if override_confg_path is None:
117 self.logger.info(f"The environment variable 'EMULATOR_CONFIG_PATH' is not set")
118 return
119
120 self.logger.info(f"Environment variable 'EMULATOR_CONFIG_PATH' found: {override_confg_path}")
121
122 if not os.path.isfile(override_confg_path):
123 self.logger.warning(f"Source file '{override_confg_path}' does not exist.")
124 return
125
126 if not os.access(override_confg_path, os.R_OK):
127 self.logger.warning(f"Source file '{override_confg_path}' is not readable.")
128 return
129
130 try:
131 with open(override_confg_path, 'r') as src, open(self.path_emulator_config, 'a') as dst:
132 dst.write(src.read())
133 self.logger.info(f"Content from '{override_confg_path}' successfully appended to '{self.path_emulator_config}'.")
134 except Exception as e:
135 self.logger.error(f"An error occurred while copying file content: {e}")
136
137 def _add_skin(self) -> None:
138 device_skin_path = os.path.join(

Calls

no outgoing calls