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

Delta Between Two Patch Sets: third_party/libadblockplus/download_ndk.py

Issue 29674555: Issue 6273 - Apply eyeo python code style (Closed)
Left Patch Set: Created Jan. 19, 2018, 7:28 a.m.
Right Patch Set: Removed sys.exit() where return code is always 0 Created Jan. 29, 2018, 12:50 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | third_party/libadblockplus/prepare_dependencies.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 from __future__ import print_function
2
1 import os 3 import os
2 import urllib 4 import urllib
3 import zipfile 5 import zipfile
4 import sys 6 import sys
5 import shutil 7 import shutil
6 8
7 9
8 def main(argv): 10 def main(argv):
9 # Download 11 # Download
10 ndk_src = 'https://dl.google.com/android/repository/android-ndk-r12b-linux-x 86_64.zip' 12 ndk_src = 'https://dl.google.com/android/repository/android-ndk-r12b-linux-x 86_64.zip'
(...skipping 23 matching lines...) Expand all
34 for info in zf.infolist(): 36 for info in zf.infolist():
35 zf.extract(info.filename, path=libadblockplus_third_party) 37 zf.extract(info.filename, path=libadblockplus_third_party)
36 out_path = os.path.join(libadblockplus_third_party, info.filename) 38 out_path = os.path.join(libadblockplus_third_party, info.filename)
37 39
38 perm = info.external_attr >> 16L 40 perm = info.external_attr >> 16L
39 os.chmod(out_path, perm) 41 os.chmod(out_path, perm)
40 42
41 # Delete zip 43 # Delete zip
42 os.remove(ndk_dst) 44 os.remove(ndk_dst)
43 45
44 return 0
45 46
46 47 if __name__ == '__main__':
47 if '__main__' == __name__:
48 try: 48 try:
49 sys.exit(main(sys.argv[1:])) 49 main(sys.argv[1:])
50 except KeyboardInterrupt: 50 except KeyboardInterrupt:
51 sys.stderr.write('interrupted\n') 51 sys.exit('interrupted')
52 sys.exit(1)
LEFTRIGHT

Powered by Google App Engine
This is Rietveld