| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Generates profile dictionaries for Autofill. | 6 """Generates profile dictionaries for Autofill. |
| 7 | 7 |
| 8 Used to test autofill.AutofillTest.FormFillLatencyAfterSubmit. | 8 Used to test autofill.AutofillTest.FormFillLatencyAfterSubmit. |
| 9 Can be used as a stand alone script with -h to print out help text by running: | 9 Can be used as a stand alone script with -h to print out help text by running: |
| 10 python autofill_dataset_generator.py -h | 10 python autofill_dataset_generator.py -h |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 [u'NAME_LAST', None], | 97 [u'NAME_LAST', None], |
| 98 [u'EMAIL_ADDRESS', self.GenerateEmail], | 98 [u'EMAIL_ADDRESS', self.GenerateEmail], |
| 99 [u'COMPANY_NAME', None], | 99 [u'COMPANY_NAME', None], |
| 100 [u'ADDRESS_HOME_LINE1', self.GenerateAddress], | 100 [u'ADDRESS_HOME_LINE1', self.GenerateAddress], |
| 101 [u'ADDRESS_HOME_LINE2', None], | 101 [u'ADDRESS_HOME_LINE2', None], |
| 102 [u'ADDRESS_HOME_CITY', self.GenerateCity], | 102 [u'ADDRESS_HOME_CITY', self.GenerateCity], |
| 103 [u'ADDRESS_HOME_STATE', self.GenerateState], | 103 [u'ADDRESS_HOME_STATE', self.GenerateState], |
| 104 [u'ADDRESS_HOME_ZIP', self.GenerateZip], | 104 [u'ADDRESS_HOME_ZIP', self.GenerateZip], |
| 105 [u'ADDRESS_HOME_COUNTRY', u'United States'], | 105 [u'ADDRESS_HOME_COUNTRY', u'United States'], |
| 106 [u'PHONE_HOME_WHOLE_NUMBER', None], | 106 [u'PHONE_HOME_WHOLE_NUMBER', None], |
| 107 [u'PHONE_FAX_WHOLE_NUMBER', u'6501234555'], | |
| 108 ] | 107 ] |
| 109 | 108 |
| 110 self.next_dict = {} | 109 self.next_dict = {} |
| 111 # Using implicit line joining does not work well in this case as each line | 110 # Using implicit line joining does not work well in this case as each line |
| 112 # has to be strings and not function calls that may return strings. | 111 # has to be strings and not function calls that may return strings. |
| 113 self.output_pattern = u'{\'' + \ | 112 self.output_pattern = u'{\'' + \ |
| 114 u', '.join([u'u"%s" : u"%%s"' % key for key, method in self.fields]) + \ | 113 u', '.join([u'u"%s" : u"%%s"' % key for key, method in self.fields]) + \ |
| 115 u',}' | 114 u',}' |
| 116 | 115 |
| 117 def _GenerateField(self, field_construct): | 116 def _GenerateField(self, field_construct): |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 options.log_level = logging.WARNING | 298 options.log_level = logging.WARNING |
| 300 elif options.log_level == 'error': | 299 elif options.log_level == 'error': |
| 301 options.log_level = logging.ERROR | 300 options.log_level = logging.ERROR |
| 302 | 301 |
| 303 gen = DatasetGenerator(options.output_filename, options.log_level) | 302 gen = DatasetGenerator(options.output_filename, options.log_level) |
| 304 gen.GenerateDataset(options.dict_no) | 303 gen.GenerateDataset(options.dict_no) |
| 305 | 304 |
| 306 | 305 |
| 307 if __name__ == '__main__': | 306 if __name__ == '__main__': |
| 308 main() | 307 main() |
| OLD | NEW |