1cb93a386Sopenharmony_ci#! /usr/bin/env python 2cb93a386Sopenharmony_ci# Copyright 2019 Google LLC. 3cb93a386Sopenharmony_ci# Use of this source code is governed by a BSD-style license that can be 4cb93a386Sopenharmony_ci# found in the LICENSE file. 5cb93a386Sopenharmony_ci''' Run this script to re-generate the `all_examples.cpp` file after adding or 6cb93a386Sopenharmony_ci deleting example fiddles. ''' 7cb93a386Sopenharmony_ciimport glob 8cb93a386Sopenharmony_ciimport os 9cb93a386Sopenharmony_cios.chdir(os.path.dirname(__file__)) 10cb93a386Sopenharmony_ciwith open('all_examples.cpp', 'w') as o: 11cb93a386Sopenharmony_ci o.write('// Copyright 2019 Google LLC.\n// Use of this source code is ' 12cb93a386Sopenharmony_ci 'governed by a BSD-style license that can be found in the ' 13cb93a386Sopenharmony_ci 'LICENSE file.\n') 14cb93a386Sopenharmony_ci for path in sorted(glob.glob('../../docs/examples/*.cpp')): 15cb93a386Sopenharmony_ci o.write('#include "%s"\n' % path) 16