zoukankan      html  css  js  c++  java
  • iPhone的设备名转换

     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'未识别的手机版本')
  • 相关阅读:
    删除ubuntu中多余的主题和背景文件
    android 开发之动画Activity
    android开发之自定义组件
    android 开发之Activity切换
    程序设计课件
    初识Proximal Policy Optimization (PPO)
    初识Auction Theory
    什么是Experience Replay和Seperate Target Networks
    初识ActorCritic
    初识Stackelberg Game
  • 原文地址:https://www.cnblogs.com/xiyuan2016/p/10150484.html
Copyright © 2011-2022 走看看