2019-11-29 08:56:53 +11:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								# Generate toolchain download links from toolchain info makefile
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								from __future__ import print_function
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-26 10:49:01 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-11-29 08:56:53 +11:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								import os.path
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-26 10:49:01 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								from .util import call_with_python, copy_if_modified
							 | 
						
					
						
							
								
									
										
										
										
											2019-11-29 08:56:53 +11:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2020-02-03 17:38:45 +11:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2019-11-29 08:56:53 +11:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								def setup(app):
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    # we don't actually need idf-info, just a convenient event to trigger this on
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    app.connect('idf-info', generate_idf_tools_links)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    return {'parallel_read_safe': True, 'parallel_write_safe': True, 'version': '0.1'}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								def generate_idf_tools_links(app, project_description):
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-26 10:49:01 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    print('Generating IDF Tools list')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    os.environ['IDF_MAINTAINER'] = '1'
							 | 
						
					
						
							
								
									
										
										
										
											2019-11-29 08:56:53 +11:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    tools_rst = os.path.join(app.config.build_dir, 'inc', 'idf-tools-inc.rst')
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    tools_rst_tmp = os.path.join(app.config.build_dir, 'idf-tools-inc.rst')
							 | 
						
					
						
							
								
									
										
										
										
											2021-01-26 10:49:01 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								    call_with_python('{}/tools/idf_tools.py gen-doc --output {}'.format(app.config.idf_path, tools_rst_tmp))
							 | 
						
					
						
							
								
									
										
										
										
											2019-11-29 08:56:53 +11:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								    copy_if_modified(tools_rst_tmp, tools_rst)
							 |