def run_post_build_function(handle, package, name, output): try: callback = ffi.from_handle(handle) callback(ffi_to_string(name), ffi_to_string(output).strip().split('\n')) return ffi.NULL except DeferParse: return ffi_from_string("Don't try to subinclude() from inside a post-build function") except Exception as err: return ffi_from_string(str(err))
def run_pre_build_function(handle, package, name): try: callback = ffi.from_handle(handle) callback(ffi_to_string(name)) return ffi.NULL except DeferParse: return ffi_from_string("Don't try to subinclude() from inside a pre-build function") except Exception as err: return ffi_from_string(str(err))