AuctionPoolLoggerUtil.getLogger()
LoggerFactory.getLogger(XXXXX.class)
import fileinput
import os
import re
__author__ = 'ykdsg'
packDir='/Users/ykdsg/svn_workspace/auctionplatform/misc_refactory/auctionplatform/ap-biz/src/main/java/com/yk/misccenter'
#查找class name
findClassNameP=re.compile(r"(?<=class\s)\w*")
findXP=re.compile(r"XXXXX")
def processDirectory(args,dirname,filenames):
# print 'Directory',dirname
for filename in filenames:
if os.path.splitext(filename)[1]=='.java':
# print 'file',filename
fullFileUrl=dirname+ "/"+filename
fileObj=open(fullFileUrl)
className=''
# Optional in-place filtering: if the keyword argument inplace=1 is passed to fileinput.input() or to
# the FileInput constructor, the file is moved to a backup file and standard output is directed to the
# input file (if a file of the same name as the backup file already exists, it will be replaced silently)
# . This makes it possible to write a filter that rewrites its input file in place. If the backup
# parameter is given (typically as backup='.<some extension>'), it specifies the extension for the
# backup file, and the backup file remains around; by default, the extension is '.bak' and it is deleted
# when the output file is closed. In-place filtering is disabled when standard input is read.
for line in fileinput.input(fullFileUrl, inplace=1):
matchClass = findClassNameP.search(line)
if matchClass:
className = matchClass.group()
matchX=findXP.search(line)
if matchX:
#print 后面需要有, 否则会出现多余的空行
print line.replace('XXXXX',className),
else:
print line,
def search():
os.path.walk(packDir,processDirectory,None)
if __name__ == '__main__':
search()
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有