栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

python写更改

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

python写更改

	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
		
	

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/864864.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号