Exemplo n.º 1
0
	def query_all_entities(self):
		self._telnet_client.read_until("^] -> set crlf :")
		self._telnet_client.write("\r\n")
		self._telnet_client.expect([r"[\]r[\]r[\]nHello,.*[>][>][>] [>][>][>]"])
		self._telnet_client.write("from common.EntityManager import EntityManager\r\n".encode())
		self._telnet_client.read_until(">>>")
		self._telnet_client.write("print EntityManager._entities\r\n".encode())
		read_result = self._telnet_client.expect([r"{(.*)}"])
		match_pattern = read_result[1]
		if match_pattern is not None and match_pattern.groups():
			logger.debug("found entity: {0}".format(match_pattern.groups()[0]))
			self._set_found_entities(Utility.parse_found_entities_str(match_pattern.groups()[0]))