Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Side by Side Diff: chrome/test/data/safe_browsing/download_update.py

Issue 3846004: Delete safe_browsing_database tests and test data. (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/usr/bin/python
2 # Copyright (c) 2009 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import urllib,sys
7
8
9 url = 'http://safebrowsing.clients.google.com/safebrowsing/downloads?client=goog leclient&appver=1.0&pver=2.1'
10
11 if len(sys.argv) == 1:
12 data = 'goog-phish-shavar;\ngoog-malware-shavar;\n'
13 else:
14 post_data_file = sys.argv[1]
15 file = open(post_data_file, "r")
16 data = file.read()
17 file.close
18
19 response = urllib.urlopen(url, data)
20
21 response_file = open("response", "r+")
22 response_file.write(response.read())
23 response_file.seek(0)
24
25 counter = 0
26
27 for line in response_file:
28 if not line.startswith('u:'):
29 continue
30
31 chunk_url = 'http://' + line[2:]
32 filename = chunk_url[chunk_url.rfind('/') + 1:]
33 filename = "%03d" % counter + filename[0:filename.rfind('_')]
34 counter += 1
35
36 urllib.urlretrieve(chunk_url, filename)
37
38 response_file.close()
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_database_unittest.cc ('k') | chrome/test/data/safe_browsing/filter/database » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698