tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

make-stl-wrappers.py (673B)


      1 # This Source Code Form is subject to the terms of the Mozilla Public
      2 # License, v. 2.0. If a copy of the MPL was not distributed with this
      3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
      4 import os
      5 import string
      6 
      7 from mozbuild.util import FileAvoidWrite
      8 
      9 # The 'unused' arg is the output file from the file_generate action. We actually
     10 # generate all the files in header_list
     11 
     12 
     13 def gen_wrappers(unused, template_file, outdir, compiler, *header_list):
     14    template = open(template_file).read()
     15 
     16    for header in header_list:
     17        with FileAvoidWrite(os.path.join(outdir, header)) as f:
     18            f.write(string.Template(template).substitute(HEADER=header))