gen-css-properties.py 827 B

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