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

Delta Between Two Patch Sets: sitescripts/subscriptions/bin/updateMalwareDomainsList.py

Issue 10942098: Make sure subprocess calls don`t ignore result codes indicating errors. Fix JS docs generation whil… (Closed)
Left Patch Set: Fixed wrong argument format Created July 4, 2013, 1:01 p.m.
Right Patch Set: Created July 8, 2013, 9:03 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 # coding: utf-8 1 # coding: utf-8
2 2
3 # This file is part of the Adblock Plus web scripts, 3 # This file is part of the Adblock Plus web scripts,
4 # Copyright (C) 2006-2013 Eyeo GmbH 4 # Copyright (C) 2006-2013 Eyeo GmbH
5 # 5 #
6 # Adblock Plus is free software: you can redistribute it and/or modify 6 # Adblock Plus is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License version 3 as 7 # it under the terms of the GNU General Public License version 3 as
8 # published by the Free Software Foundation. 8 # published by the Free Software Foundation.
9 # 9 #
10 # Adblock Plus is distributed in the hope that it will be useful, 10 # Adblock Plus is distributed in the hope that it will be useful,
(...skipping 29 matching lines...) Expand all
40 40
41 data = urllib.urlopen('http://mirror3.malwaredomains.com/files/justdomains.z ip').read() 41 data = urllib.urlopen('http://mirror3.malwaredomains.com/files/justdomains.z ip').read()
42 zip = zipfile.ZipFile(StringIO(data), 'r') 42 zip = zipfile.ZipFile(StringIO(data), 'r')
43 info = zip.infolist()[0] 43 info = zip.infolist()[0]
44 for line in str(zip.read(info.filename)).splitlines(): 44 for line in str(zip.read(info.filename)).splitlines():
45 if not line: 45 if not line:
46 continue 46 continue
47 print >>file, '||%s^' % line.strip().decode('iso-8859-1') 47 print >>file, '||%s^' % line.strip().decode('iso-8859-1')
48 file.close(); 48 file.close();
49 49
50 subprocess.check_call(['hg', '-q', 'commit', '-R', tempdir, '-A', '-u', 'hgb ot', '-m', 'Updated malwaredomains.com data']) 50 if subprocess.check_output(['hg', 'stat', '-R', tempdir]) != '':
51 51 subprocess.check_call(['hg', '-q', 'commit', '-R', tempdir, '-A', '-u', 'h gbot', '-m', 'Updated malwaredomains.com data'])
52 # Don't check the result of this call, it will be 1 if nothing needs pushing 52 subprocess.check_call(['hg', '-q', 'push', '-R', tempdir])
53 subprocess.call(['hg', '-q', 'push', '-R', tempdir])
54 finally: 53 finally:
55 shutil.rmtree(tempdir, ignore_errors=True) 54 shutil.rmtree(tempdir, ignore_errors=True)
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld