| OLD | NEW |
| 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 Loading... |
| 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() |
| OLD | NEW |