INNER CODE UNIT · Python

_get_local_agent_path

codematrixer/hmdriver2 · hmdriver2/_client.py:194

    def _get_local_agent_path(self) -> str:
        """Return the local path of the agent file."""
        target_agent = "uitest_agent_v1.1.0.so"
        return os.path.join(os.path.dirname(os.path.realpath(__file__)), "assets", target_agent)

    def _get_remote_md5sum(self, file_path: str) -> Optional[str]:
        """Get the MD5 checksum of a remote file."""
        command = f"md5sum {file_path}"
        output = self.hdc.shell(command).output.strip()
        return output.split()[0] if output else None

    def _get_local_md5sum(self, file_path: str) -> str:
        """Get the MD5 checksum of a local file."""
        hash_md5 = hashlib.md5()
        with open(file_path, "rb") as f:
            for chunk in iter(lambda: f.read(4096), b""):
                hash_md5.update(chunk)
        return hash_md5.hexdigest()

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…