zoukankan      html  css  js  c++  java
  • Python VIL Realse

    #!/usr/bin/python
    #-*- coding:utf-8 –*-
    
    import os
    import sys
    import re
    import shutil
    import xlrd
    import xlwt
    from xlutils.copy import copy
    
    '''
    提取相关RELEASE信息,追加“SW Release Note.xls”
    运行命令 ./gen_release.py "Modified reason"
    '''
    
    def fun_genRelease():
        list = []
        curLine = ""
        book = xlrd.open_workbook(r'./mergedir/SW Release Note.xls',formatting_info=True)
        sheet = book.sheet_by_index(0)
        
        newBook = copy(book)
        newSheet = newBook.get_sheet(0)
        list.append(sheet.nrows-1)
        with open("./drivers/include/project.h", "r") as mFile:
            proData = mFile.read()
            
        with open("./aps/include/common_patch.h","r") as comFile:
            comData = comFile.read()
        modeId = re.search(".*DEFAULT_MODE_IDs+(d+).*",comData).group(1)
            
        pat = re.compile(".*?(d+).*{.*"((d+)_.*)",s+&w+[d+],s+/*(.*?)*/s+&w+[d+],s+/*(.*)*/.*")
        
        list.append(re.search(".*CONFIG_APP_FOLDER_NAME.*"(.*)"", proData).group(1))
        board = re.search(".*CONFIG_MODEL_BOARD_NAMEs+"(w+)"",proData).group(1)
        
        with open("./aps/customer/radisson/%s/adaptable/model_data.c" %board,"r") as modeFile:
            modeList = modeFile.readlines()
            
        for line in modeList:
            if pat.search(line) and pat.search(line).group(1) == modeId:
                curLine = line
                break
            
        list.append(pat.search(curLine).group(2))
        list.append(pat.search(curLine).group(3))
        list.append(pat.search(curLine).group(4))
        list.append(pat.search(curLine).group(5))
        list.append("LL" if "LL" in pat.search(curLine).group(2) else "NON LL")
        list.append("" if len(sys.argv) ==1 else sys.argv[1])
        
        with open("./aps/include/timestamp.h","r") as verFile:
            verData = verFile.read()
            
        list.append("%s%s" %(board,re.search(".*TIME_VERSIONs+"(w+)".*",verData).group(1)))
        list.append("")
        list.append("")
        list.append("bjornLee")
        
        #写EXCEL
        #for col in range(sheet.ncols):
        col = 0
        for cell in list:
            newSheet.write(sheet.nrows,col,cell)
            col = col+1
            #newSheet.write(sheet.nrows,col,"test")
        newBook.save(r'./mergedir/SW Release Note.xls')
        print "
    ",list,"
    "
        
        
    
    def main():
        fun_genRelease()
        
    if __name__ == '__main__':
        main()
    
    
    
    
    
        
        
    
    
    
        
        
    
    
        
  • 相关阅读:
    sgdisk基本用法
    影响性能的关键部分-ceph的osd journal写
    SSD固态盘应用于Ceph集群的四种典型使用场景
    Ceph在OpenStack中的地位
    Ceph的工作原理及流程
    Ceph系统的层次结构
    SharePoint运行状况分析器有关磁盘空间不足的警告
    Microsoft Exchange本地和Exchange Online可以与第三方服务共享
    SharePoint Server 2016 WEB 网站浏览器支持
    禁用自动映射的 Exchange 邮箱
  • 原文地址:https://www.cnblogs.com/jiangzhaowei/p/9278478.html
Copyright © 2011-2022 走看看