gen-css-properties.py (790B)
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 5 import os 6 import sys 7 import subprocess 8 9 10 def main(output, css_properties, exe): 11 # moz.build passes in the exe name without any path, so to run it we need to 12 # prepend the './' 13 run_exe = exe if os.path.isabs(exe) else "./%s" % exe 14 15 # Use universal_newlines so everything is '\n', which gets converted to 16 # '\r\n' when writing out the file in Windows. 17 data = subprocess.check_output([run_exe], universal_newlines=True) 18 with open(css_properties) as f: 19 data += f.read() 20 output.write(data) 21 22 23 if __name__ == "__main__": 24 main(sys.stdout, *sys.argv[1:])