1. 程式人生 > 資訊 >三星正開發 DDR6-12800 記憶體,GDDR7 視訊記憶體規劃中

三星正開發 DDR6-12800 記憶體,GDDR7 視訊記憶體規劃中

def ac_upgrade_ftp(self, version=None, ftp_mode=True, ftp_info={}):
"""
通過FTP獲取版本檔案升級
:param version:需要升級的版本檔名稱
:param ftp_mode:True為匿名,False為不匿名,預設為True
:param ftp_info:引數包括
ftp_ip:必選引數
ftp_port:必選引數
ftp_username:ftp_mode不匿名必選
ftp_password:ftp_mode不匿名必選
:return:
"""
ftp_info = {
'ftp_ip': '192.168.100.1',
'ftp_port': '22',
'ftp_username': 'ad0min',
'ftp_password': 'Acc0ton123',
'version': ''}
uti.tab_enter('utilities', 'system_upgrade')
time.sleep(2)
ftp_must_param_anymous = ['ftp_ip', 'ftp_port']
ftp_must_param_user = ['ftp_ip', 'ftp_port', 'ftp_username', 'ftp_password']

if version is None or ftp_mode is None: #判斷版本資訊和升級方式是否為空,為空則直接退出
return

if ftp_mode:
for pararm_m in ftp_must_param_anymous: #判斷引數在不在anymous引數列表中並且判斷引數在不在字典中
if pararm_m not in ftp_info.keys():
return
else:
for pararm_m in ftp_must_param_user:
if pararm_m not in ftp_info.keys():
return

if ftp_mode:
self.click(By.XPATH, x_uti_su_up_via_ftp_yes_rd)
if ftp_info.setdefault('ftp_ip', None) is not None: #如果key不在字典中,則用default值插入key。如果key在字典中,返回key的值,否則預設
self.ccs(By.XPATH, x_uti_su_up_via_ftp_ip_ip, ftp_info.get('ftp_ip')) #返回指定鍵的值,如果該鍵不存在,返回預設值
self.ccs(By.XPATH, x_uti_su_up_via_ftp_port_ip, ftp_info.setdefault('ftp_port', 22))
self.ccs(By.XPATH, x_uti_su_up_via_ftp_file_ip, version)
else:
self.click(By.XPATH, x_uti_su_up_via_ftp_no_rd)
self.ccs(By.XPATH, x_uti_su_up_via_ftp_name_ip, ftp_info.get('ftp_username'))
self.ccs(By.XPATH, x_uti_su_up_via_ftp_pass_ip, ftp_info.get('ftp_password'))

if ftp_info.setdefault('ftp_ip', None) is not None:
self.ccs(By.XPATH, x_uti_su_up_via_ftp_ip_ip, ftp_info.get('ftp_ip'))
self.ccs(By.XPATH, x_uti_su_up_via_ftp_port_ip, ftp_info.setdefault('ftp_port', 22))
self.ccs(By.XPATH, x_uti_su_up_via_ftp_file_ip, version)
self.click(By.XPATH, x_uti_su_up_via_ftp_upload_rd)