| Index: sitescripts/extensions/bin/updateRecommendations.py |
| =================================================================== |
| --- a/sitescripts/extensions/bin/updateRecommendations.py |
| +++ b/sitescripts/extensions/bin/updateRecommendations.py |
| @@ -20,19 +20,21 @@ from sitescripts.utils import get_config |
| from sitescripts.subscriptions.bin.processTemplate import writeSubscriptions |
| from tempfile import mkdtemp |
| from shutil import rmtree |
| def updateRecommendations(): |
| repository = get_config().get('extensions', 'abp_repository') |
| tempdir = mkdtemp(prefix='adblockplus') |
| try: |
| - subprocess.Popen(['hg', 'clone', '-U', repository, tempdir], stdout=subprocess.PIPE).communicate() |
| - subprocess.Popen(['hg', 'up', '-R', tempdir, '-r', 'default'], stdout=subprocess.PIPE).communicate() |
| + subprocess.check_call(['hg', 'clone', '-q', '-U', repository, tempdir]) |
| + subprocess.check_call(['hg', 'up', '-q', '-R', tempdir, '-r', 'default']) |
| writeSubscriptions('recommendations', os.path.join(tempdir, 'chrome', 'content', 'ui', 'subscriptions.xml')) |
| - subprocess.Popen(['hg', 'commit', '-R', tempdir, '-u', 'hgbot', '-m', 'Updated list of recommended subscriptions'], stdout=subprocess.PIPE).communicate() |
| - subprocess.Popen(['hg', 'push', '-R', tempdir], stdout=subprocess.PIPE).communicate() |
| + subprocess.check_call(['hg', 'commit', '-q', '-R', tempdir, '-u', 'hgbot', '-m', 'Updated list of recommended subscriptions']) |
| + |
| + # Don't check the result of this call, it will be 1 if nothing needs pushing |
| + subprocess.call(['hg', 'push', '-q', '-R', tempdir]) |
| finally: |
| rmtree(tempdir) |
| if __name__ == '__main__': |
| setupStderr() |
| updateRecommendations() |