你好,我的问题是关于一个Python脚本,我正试图开始工作。关键在于,当某人提交SVN时,他们会看到一个包含四行代码的登录模板:Branch
,Bug_Number
,Feature affected
和{
以下是我到目前为止在python中得到的基于一个旧python脚本的内容。在
print "Importing the items"
import re
import sys
import os
print "Initializing the list."
argsList = []
hndFile = open(sys.argv[1],"r")
for line in hndFile:
argsList.append(line)
hndFile.close()
print "Checking what is blank"
faOK = ovOK = False
for line in argsList:
line = line.strip()
if line.startswith('FEATURE_AFFECTED:'):
faOK = line[17:] != ''
if line.startswith('OVERVIEW:'):
ovOK = line[9:] != ''
if not faOK:
print "You Must Enter the Feature Affected"
ret = -1
elif not ovOK:
print "You Must Enter an Overview of the Fix"
ret = -1
else:
ret = 0
print "Finishing the script"
sys.exit(ret)
任何建议都会有帮助。我正在使用Windows XP,目前没有任何变化。我也在使用collabnet svn。目前,当我尝试运行这个脚本时,没有发生任何事情。我知道我没有在脚本中添加svnlook,我真的想不出在哪里添加以及为它添加变量。非常感谢。在
目前没有回答
相关问题 更多 >
编程相关推荐