Hacky progress indicator.

This commit is contained in:
Jon Ciesla 2013-06-03 15:01:42 -05:00
parent 0293cacf6e
commit b7df1e915e

View file

@ -766,6 +766,8 @@ if __name__ == '__main__':
print "No requests to process!" print "No requests to process!"
exit(0) exit(0)
bugcount = len(bugs)
print "Making sure " + options.pkghost + " is available..." print "Making sure " + options.pkghost + " is available..."
try: try:
sshsock = socket.create_connection((options.pkghost, 80)) sshsock = socket.create_connection((options.pkghost, 80))
@ -803,10 +805,11 @@ if __name__ == '__main__':
# Iterate over bugs # Iterate over bugs
newre = re.compile('^New Package .* Request', re.MULTILINE) newre = re.compile('^New Package .* Request', re.MULTILINE)
changere = re.compile('^Package Change Request', re.MULTILINE) changere = re.compile('^Package Change Request', re.MULTILINE)
bugcounter=1
for i in bugs: for i in bugs:
firstfound = True firstfound = True
type = '' type = ''
print "Parsing bug %d - https://bugzilla.redhat.com/%d" % (i.id, i.id) print "Parsing bug %d - https://bugzilla.redhat.com/%d - processing %s of %s" % (i.id, i.id, str(bugcounter), str(bugcount))
for j in reversed(comments['bugs'][str(i.id)]['comments']): for j in reversed(comments['bugs'][str(i.id)]['comments']):
if newre.search(j['text']): if newre.search(j['text']):
type = 'new' type = 'new'
@ -831,6 +834,7 @@ if __name__ == '__main__':
processed = create_branches(package, options.pkghost, options.pkghostlocal, processed) processed = create_branches(package, options.pkghost, options.pkghostlocal, processed)
if not more: if not more:
break break
bugcounter = bugcounter + 1
if len(processed): if len(processed):
print '\nYou must now run this on the git server\nto set up the git repository:' print '\nYou must now run this on the git server\nto set up the git repository:'