Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/subscriptions/subscriptionParser.py

Issue 11275006: Added script to generate notification.json for the emergencynotification mechanism (Closed)
Patch Set: Fixed closing and iterating through tar files Created July 29, 2013, 2:08 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sitescripts/management/bin/generateNotifications.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/subscriptions/subscriptionParser.py
===================================================================
--- a/sitescripts/subscriptions/subscriptionParser.py
+++ b/sitescripts/subscriptions/subscriptionParser.py
@@ -231,20 +231,18 @@ def get_settings():
return settings
def readSubscriptions():
repo = os.path.abspath(get_config().get('subscriptions', 'repository'))
data = subprocess.check_output(['hg', 'archive', '-R', repo, '-r', 'default', '-t', 'tar', '-I', os.path.join(repo, '*.subscription'), '-'])
result = {}
tarFile = tarfile.open(mode='r:', fileobj=StringIO(data))
- fileInfo = tarFile.next()
- while fileInfo:
+ for fileInfo in tarFile:
fileData = parseFile(fileInfo.name, codecs.getreader('utf8')(tarFile.extractfile(fileInfo)))
- fileInfo = tarFile.next()
if fileData.unavailable:
continue
if fileData.name in result:
warn('Name %s is claimed by multiple files' % (fileData.name))
result[fileData.name] = fileData
tarFile.close()
« no previous file with comments | « sitescripts/management/bin/generateNotifications.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld