__author__ = \'JCC\'
#coding=utf-8
import xlsxwriter
import xlrd as read

class env:
    def __init__(self, FE_Version,OMM_Version,Net_Type,Board_Type,WeiZhi_Info,PC_Info):
        self.FE_Version = FE_Version
        self.OMM_Version = OMM_Version
        self.Net_Type = Net_Type
        self.Board_Type = Board_Type
        self.WeiZhi_Info = WeiZhi_Info
        self.PC_Info = PC_Info

    def show(self):
        print self.FE_Version,
        print self.OMM_Version,
        print self.Net_Type,
        print self.Board_Type,
        print self.WeiZhi_Info,
        print self.PC_Info,

    def auto_test(self):
        print "开始自动化测试了"

    def getinfo(self):
        print "开始采集性能数据"

    def envcheck(self):
        print"开始环境巡检了"

    def clearuspp(self):
        print"开始清库了"

    def update(self):
        print"开始升级了"

class V4_env(env):
    def __init__(self,FE_Version,OMM_Version,Net_Type,Board_Type,WeiZhi_Info,PC_Info,DST_Type,ORACEL_Version):
        env.__init__(self,FE_Version,OMM_Version,Net_Type,Board_Type,WeiZhi_Info,PC_Info)
        self.DST_Type = DST_Type
        self.ORACEL_Version =ORACEL_Version


    def show(self):

        print "业务版本:",
        print self.FE_Version
        print "网管版本:",
        print self.OMM_Version
        print "网元类型:",
        print  self.Net_Type
        print "单板类型:",
        print self.Board_Type
        print "位置信息:",
        print self.WeiZhi_Info
        print "调试及信息:",
        print self.PC_Info
        print "DST信息:",
        print self.DST_Type
        print "ORACLE版本信息:",
        print self.ORACEL_Version


    def auto_test_spec(self,net_type):
        print "开始%s自动化测试了"%(net_type)

class V5_env(env):
    def __init__(self,FE_Version,OMM_Version,Net_Type,Board_Type,WeiZhi_Info,PC_Info,TECS_Version,MANO_Version):
        env.__init__(self,FE_Version,OMM_Version,Net_Type,Board_Type,WeiZhi_Info,PC_Info)
        self.TECS_Version = TECS_Version
        self.MANO_Version =MANO_Version

    def show(self):
        print "业务版本:",
        print self.FE_Version
        print "网管版本:",
        print self.OMM_Version
        print "网元类型:",
        print  self.Net_Type
        print "单板类型:",
        print self.Board_Type
        print "位置信息:",
        print self.WeiZhi_Info
        print "调试及信息:",
        print self.PC_Info
        print "TECS版本信息:",
        print  self.TECS_Version
        print "MANO版本信息:",
        print  self.MANO_Version

    def VM_els(self):
        print "开始虚机伸缩"

    def RONG_els(self):
        print "开始缩扩容"

def Func(obj):
    obj.getinfo()
    obj.clearuspp()
    obj.envcheck()
    obj.update()
    obj.auto_test()

def main():
    data = read.open_workbook(\'hello.xls\')
    table = data.sheet_by_name(u\'V4\')
    rows = table.nrows
    for i in range(1,rows,1):
        s1_v4=V4_env(table.row_values(i)[1],table.row_values(i)[2],table.row_values(i)[3],table.row_values(i)[4],table.row_values(i)[5],table.row_values(i)[6],table.row_values(i)[7],table.row_values(i)[8])
        print "——————————V4版本信息(第%d套环境)——————————"% (i)
        s1_v4.show()

    table = data.sheet_by_name(u\'V5\')
    jcc_C = table.nrows
    for i in range(1,jcc_C,1):
        s1_v5=V5_env(table.row_values(i)[1],table.row_values(i)[2],table.row_values(i)[3],table.row_values(i)[4],table.row_values(i)[5],table.row_values(i)[6],table.row_values(i)[7],table.row_values(i)[8])
        print "——————————V5版本信息(第%d套环境)——————————"% (i)
        s1_v5.show()



if __name__=="__main__":
    main()

 

版权声明:本文为stonerainjc原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/stonerainjc/p/6822490.html