2 # Copyright 2013 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.
6 """Embeds Chrome user data files in C++ code."""
16 parser
= optparse
.OptionParser()
18 '', '--directory', type='string', default
='.',
19 help='Path to directory where the cc/h file should be created')
20 options
, args
= parser
.parse_args()
22 global_string_map
= {}
23 for data_file
in args
:
24 title
= os
.path
.basename(os
.path
.splitext(data_file
)[0]).title()
25 var_name
= 'k' + title
.replace('_', '')
26 with
open(data_file
, 'r') as f
:
28 global_string_map
[var_name
] = contents
30 cpp_source
.WriteSource('user_data_dir', 'chrome/test/chromedriver/chrome',
31 options
.directory
, global_string_map
)
34 if __name__
== '__main__':