Author: rinrab Date: Sat Jul 13 18:13:55 2024 New Revision: 1919197 URL: http://svn.apache.org/viewvc?rev=1919197&view=rev Log: On the 'cmake' branch: gen_cmake.py: Little refactoring in ezt invocation.
* build/generator/gen_cmake.py (Generator.write): Parse the template by separate command, add output_file variable, format code. Modified: subversion/branches/cmake/build/generator/gen_cmake.py Modified: subversion/branches/cmake/build/generator/gen_cmake.py URL: http://svn.apache.org/viewvc/subversion/branches/cmake/build/generator/gen_cmake.py?rev=1919197&r1=1919196&r2=1919197&view=diff ============================================================================== --- subversion/branches/cmake/build/generator/gen_cmake.py (original) +++ subversion/branches/cmake/build/generator/gen_cmake.py Sat Jul 13 18:13:55 2024 @@ -210,11 +210,12 @@ class Generator(gen_base.GeneratorBase): data = _eztdata( targets = targets, ) + output_file = open(os.path.join('build', 'cmake', 'targets.cmake'), 'w') - template = ezt.Template(os.path.join('build', 'generator', 'templates', - 'targets.cmake.ezt'), - compress_whitespace=False) - template.generate(open(os.path.join('build', 'cmake', 'targets.cmake'), 'w'), data) + template = ezt.Template(compress_whitespace=False) + template.parse_file(os.path.join('build', 'generator', 'templates', + 'targets.cmake.ezt')) + template.generate(output_file, data) def get_install_sources(self): install_sources = self.graph.get_all_sources(gen_base.DT_INSTALL)