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_ID\s+(\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_NAME\s+\"(\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_VERSION\s+\"(\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 "\n",list,"\n" def main():
fun_genRelease() if __name__ == '__main__':
main()
Python VIL Realse的更多相关文章
- Python VIL Service Bin
#!/usr/bin/python #coding:UTF-8 import sys import re import getopt import md5 import os import subpr ...
- python 学习源码练习(1)
#编译方式,python3 文件名 #!/usr/bin/python3#print('hello world') mystring = 'hello world'print (mystring) # ...
- python 单变量线性回归
单变量线性回归(Linear Regression with One Variable)¶ In [54]: #初始化工作 import random import numpy as np imp ...
- python+Django创建第一个项目
1.首先搭建好环境 1.1 安装pyhton,Linux系统中,python是系统自带的所以就不用安装 1.2 安装Django框架 使用pip安装: pip install django 1.3 检 ...
- Python中的多进程与多线程(一)
一.背景 最近在Azkaban的测试工作中,需要在测试环境下模拟线上的调度场景进行稳定性测试.故而重操python旧业,通过python编写脚本来构造类似线上的调度场景.在脚本编写过程中,碰到这样一个 ...
- Python高手之路【六】python基础之字符串格式化
Python的字符串格式化有两种方式: 百分号方式.format方式 百分号的方式相对来说比较老,而format方式则是比较先进的方式,企图替换古老的方式,目前两者并存.[PEP-3101] This ...
- Python 小而美的函数
python提供了一些有趣且实用的函数,如any all zip,这些函数能够大幅简化我们得代码,可以更优雅的处理可迭代的对象,同时使用的时候也得注意一些情况 any any(iterable) ...
- JavaScript之父Brendan Eich,Clojure 创建者Rich Hickey,Python创建者Van Rossum等编程大牛对程序员的职业建议
软件开发是现时很火的职业.据美国劳动局发布的一项统计数据显示,从2014年至2024年,美国就业市场对开发人员的需求量将增长17%,而这个增长率比起所有职业的平均需求量高出了7%.很多人年轻人会选择编 ...
- 可爱的豆子——使用Beans思想让Python代码更易维护
title: 可爱的豆子--使用Beans思想让Python代码更易维护 toc: false comments: true date: 2016-06-19 21:43:33 tags: [Pyth ...
随机推荐
- 20145201李子璇 《网络对抗》 Web安全基础实践
1.实验后回答问题 (1)SQL注入攻击原理,如何防御 原理:通过构建特殊的输入作为参数传入web应用程序.即把SQL命令注入到Web表单的输入域或页面请求的查询字符串,和之前已经设定好的查询语句构成 ...
- Ubuntu 16.04+1080Ti机器学习基本环境配置【转】
本文转载自:https://blog.csdn.net/MahoneSun/article/details/80808930 一.设置网络 机器有两张网卡,将当前正在使用的“有线连接1”配置为以下的设 ...
- cuda8.0 出错:/usr/bin/ld: 找不到 -lGL【转】
本文转自:https://blog.csdn.net/u010159842/article/details/56833030 最近在学习深度学习,在搭建CUDA8.0的时候,出现一个非常不好的问题: ...
- git status出现 fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git 提示说没有.git这样一个目录,解决办法如下: git ini ...
- Gym 100712I Bahosain and Digits(开关翻转问题)
http://codeforces.com/gym/100712/attachments 题意: 给出一串数字,每次选择连续的k个数字加上任意数(超过10就取余),最后要使得所有数字都相等,求最大的k ...
- UVa 1635 无关的元素(唯一分解定理+二项式定理)
https://vjudge.net/problem/UVA-1635 题意: 给定n个数a1,a2,...an,依次求出相邻两数之和,将得到一个新数列.重复上述操作,最后结果将变成一个数.问这个数除 ...
- [java]No qualifying bean of type 解决方法
1.错误原因:注解写错 2.原理如下: 现在的spring早就已经摆脱了之前一堆xml配置文件的情况,都是通过注解配置的方式进行依赖注入了,通常情况下,我们会有一个配置类,然后通过Annotation ...
- Hadoop1.2.1完全分布模式安装教程
假设有三台机器,它们的IP地址和对应的主机名为: 192.168.12.18 localhost.localdomain 192.168.2.215 rhel5 ...
- IOS-网络(发送JSON数据给服务器和多值参数)
三步走: 1.使用POST请求 2.设置请求头 [request setValue:@"application/json" forHTTPHeaderField:@"Co ...
- Android 遍历全国的地区二(获取天气)
根据上次的内容 1. 界面布局 weather_layout.xml <LinearLayout xmlns:android="http://schemas.android.com/a ...