标签:iphone 5 erro 形式 def value color 设备 iphone8 return
def convertDeviceName(self, deviceName): """ 转换deviceName(如iPhone 6,2)为用户习惯形式(如iPhone 5s) """ if deviceName == [‘iPhone5,1‘, ‘iPhone5,2‘]: deviceName_new = ‘iPhone 5‘ return deviceName_new elif deviceName in [‘iPhone5,3‘, ‘iPhone5,4‘]: deviceName_new = ‘iPhone 5C‘ return deviceName_new elif deviceName in [‘iPhone6,1‘, ‘iPhone6,2‘]: deviceName_new = ‘iPhone 5s‘ return deviceName_new elif deviceName in [‘iPhone7,1‘]: deviceName_new = ‘iPhone 6 Plus‘ return deviceName_new elif deviceName in [‘iPhone7,2‘]: deviceName_new = ‘iPhone 6‘ return deviceName_new elif deviceName in [‘iPhone8,1‘]: deviceName_new = ‘iPhone 6s‘ return deviceName_new elif deviceName in [‘iPhone8,2‘]: deviceName_new = ‘iPhone 6s Plus‘ return deviceName_new elif deviceName in [‘iPhone8,4‘]: deviceName_new = ‘iPhone SE‘ return deviceName_new elif deviceName in [‘iPhone9,1‘, ‘iPhone9,3‘]: deviceName_new = ‘iPhone 7‘ return deviceName_new elif deviceName in [‘iPhone9,2‘, ‘iPhone9,4‘]: deviceName_new = ‘iPhone 7 Plus‘ return deviceName_new elif deviceName in [‘iPhone10,1‘, ‘iPhone10,4‘]: deviceName_new = ‘iPhone 8‘ return deviceName_new elif deviceName in [‘iPhone10,2‘, ‘iPhone10,5‘]: deviceName_new = ‘iPhone 8 Plus‘ return deviceName_new elif deviceName in [‘iPhone10,3‘, ‘iPhone10,6‘]: deviceName_new = ‘iPhone X‘ return deviceName_new else: raise ValueError(u‘未识别的手机版本‘)
标签:iphone 5 erro 形式 def value color 设备 iphone8 return
原文地址:https://www.cnblogs.com/xiyuan2016/p/10150484.html