python写更改

python写更改,第1张

	def _writeCommand(self, prompt, cmd, timeout=30):
		engine = self.createEngine()
		logger = self.getLogger()

		logger.writeRaw(cmd)
		mac = self.getMacAddress()
		print("the writeRwa cmd is:",cmd)
		if "bosa_set" in cmd:

			print("the mac is ",mac)
			url = MgrUtils.getParameter(UtilsConfig.S_MES, UtilsConfig.K_URL, "")
			client = Client("{}?WSDL".format(url))
			sponse = client.service.GetBOSAImportData_Ex('GPONStation-SZ', 'NP1257G-test', mac)
			ls = json.loads(sponse)
			bosa_cmd="serialization --bosa_sn="+ls['BosaData'][0]['bosa_sn']+" --bosa_type="+ls['BosaData'][0]['bosa_type']+" --bosa_pn="+ls['BosaData'][0]['bosa_pn']\
					+" --bosa_vapd=" + ls['BosaData'][0]['bosa_vapd'] \
					 + " --bosa_impd=" + ls['BosaData'][0]['bosa_impd'] \
					 + " --bosa_apd_resp=" + ls['BosaData'][0]['bosa_apd_resp'] \
					 + " --darkcurrent_vapd10=" + ls['BosaData'][0]['darkcurrent_vapd10'] \
					 + " --darkcurrent_vop=" + ls['BosaData'][0]['darkcurrent_vop']
			cmd=bosa_cmd
			print("the bosa_cmd is :",cmd)
			#print("the response is :",sponse)
		if not cmd.endswith("\n"):
			cmd = "{}\n".format(cmd)

		engine.write(self._encode(cmd))

		response = self._decode(engine.read_until(self._encode(prompt), timeout))
		#print("the write command is :",response,"end")
		#print("the prompt is :", prompt)
		logger.writeRaw(response)
		if not re.search(prompt, response):
			raise Exception(MgrUtils.getString("timeoutText"))
		return response
	
		
			echo bosa_set
			# 
			bosa_set
		
	

	
		
		
			serialization --show
			# 
		
		20
		0
		
	

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/873696.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-13
下一篇 2022-05-13

发表评论

登录后才能评论

评论列表(0条)

保存