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

Side by Side Diff: chrome/test/data/autofill/merge/tools/serialize_profiles.py

Issue 7892048: Autofill: Remove fax number completely. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes. Created 9 years, 3 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
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import os.path 5 import os.path
6 import sqlite3 6 import sqlite3
7 import sys 7 import sys
8 8
9 from autofill_merge_common import SerializeProfiles, ColumnNameToFieldType 9 from autofill_merge_common import SerializeProfiles, ColumnNameToFieldType
10 10
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 # Read the autofill_profile_phones table. 67 # Read the autofill_profile_phones table.
68 try: 68 try:
69 cursor.execute("SELECT * from autofill_profile_phones;") 69 cursor.execute("SELECT * from autofill_profile_phones;")
70 except sqlite3.OperationalError: 70 except sqlite3.OperationalError:
71 print ("Failed to read the autofill_profile_phones table from \"%s\"" % 71 print ("Failed to read the autofill_profile_phones table from \"%s\"" %
72 database) 72 database)
73 raise 73 raise
74 74
75 for profile in cursor: 75 for profile in cursor:
76 guid = profile[0] 76 guid = profile[0]
77 if int(profile[1]) == 0: 77 profiles[guid].append(("PHONE_HOME_WHOLE_NUMBER", profile[2]))
78 profiles[guid].append(("PHONE_HOME_WHOLE_NUMBER", profile[2]))
79 else:
80 profiles[guid].append(("PHONE_FAX_WHOLE_NUMBER", profile[2]))
81 78
82 print SerializeProfiles(profiles.values()) 79 print SerializeProfiles(profiles.values())
83 80
84 81
85 if __name__ == '__main__': 82 if __name__ == '__main__':
86 main() 83 main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698