| Index: sitescripts/subscriptions/combineSubscriptions.py |
| =================================================================== |
| --- a/sitescripts/subscriptions/combineSubscriptions.py |
| +++ b/sitescripts/subscriptions/combineSubscriptions.py |
| @@ -82,17 +82,17 @@ def conditionalWrite(filePath, data): |
| newData = re.sub(r'\s*\d+ \w+ \d+ \d+:\d+ UTC', '', newData) |
| if oldData == newData: |
| changed = False |
| if changed: |
| handle = codecs.open(filePath, 'wb', encoding='utf-8') |
| handle.write(data) |
| handle.close() |
| try: |
| - subprocess.Popen(['7za', 'a', '-tgzip', '-mx=9', '-bd', '-mpass=15', filePath + '.gz', filePath], stdout=subprocess.PIPE).communicate() |
| + subprocess.check_output(['7za', 'a', '-tgzip', '-mx=9', '-bd', '-mpass=15', filePath + '.gz', filePath]) |
| except: |
| print >>sys.stderr, 'Failed to compress file %s. Please ensure that p7zip is installed on the system.' % filePath |
| def processVerbatimFile(sourceDir, targetDir, file): |
| handle = codecs.open(os.path.join(sourceDir, file), 'rb', encoding='utf-8') |
| conditionalWrite(os.path.join(targetDir, file), handle.read()) |
| handle.close() |
| @@ -324,11 +324,11 @@ if __name__ == '__main__': |
| if option in ('-h', '--help'): |
| usage() |
| sys.exit() |
| elif option in ('-t', '--timeout'): |
| timeout = int(value) |
| if os.path.exists(os.path.join(sourceDir, '.hg')): |
| # Our source is a Mercurial repository, try updating |
| - subprocess.Popen(['hg', '-R', sourceDir, 'pull', '--update']).communicate() |
| + subprocess.check_call(['hg', '-q', '-R', sourceDir, 'pull', '--update']) |
| combineSubscriptions(sourceDir, targetDir, timeout) |