exporter = Exporter(target, tempdir, project_name, build_url_resolver, extra_symbols=extra_symbols) exporter.scan_and_copy_resources(project_path, tempdir) exporter.generate() report['success'] = True except OldLibrariesException, e: report['errormsg'] = ERROR_MESSAGE_NOT_EXPORT_LIBS else: report['errormsg'] = ERROR_MESSAGE_UNSUPPORTED_TOOLCHAIN % (target, ide) zip_path = None if report['success']: # add readme file to every offline export. open(os.path.join(tempdir, 'GettingStarted.htm'),'w').write('<meta http-equiv="refresh" content="0; url=http://mbed.org/handbook/Getting-Started-mbed-Exporters#%s"/>'% (ide)) # copy .hgignore file to exported direcotry as well. copy(os.path.join(exporter.TEMPLATE_DIR,'.hgignore'),tempdir) zip_path = zip_working_directory_and_clean_up(tempdir, destination, project_name, clean) return zip_path, report ############################################################################### # Generate project folders following the online conventions ############################################################################### def copy_tree(src, dst, clean=True): if exists(dst): if clean: rmtree(dst) else: return copytree(src, dst)
else: try: exporter = Exporter(target, tempdir, project_name, build_url_resolver, extra_symbols=extra_symbols) exporter.scan_and_copy_resources(project_path, tempdir) exporter.generate() report['success'] = True except OldLibrariesException, e: report['errormsg'] = ERROR_MESSAGE_NOT_EXPORT_LIBS zip_path = None if report['success']: # add readme file to every offline export. open(os.path.join(tempdir, 'GettingStarted.htm'),'w').write('<meta http-equiv="refresh" content="0; url=http://mbed.org/handbook/Getting-Started-mbed-Exporters#%s"/>'% (ide)) # copy .hgignore file to exported direcotry as well. copy(os.path.join(exporter.TEMPLATE_DIR,'.hgignore'),tempdir) zip_path = zip_working_directory_and_clean_up(tempdir, destination, project_name, clean) return zip_path, report ############################################################################### # Generate project folders following the online conventions ############################################################################### def copy_tree(src, dst, clean=True): if exists(dst): if clean: rmtree(dst) else: return copytree(src, dst)