Best Python code snippet using tox_python
__init__.py
Source:__init__.py
1import re2from os.path import join, exists, realpath, relpath, basename3from os import makedirs4from tools.export.makefile import Makefile, GccArm, Armc5, IAR5class Eclipse(Makefile):6 """Generic Eclipse project. Intended to be subclassed by classes that7 specify a type of Makefile.8 """9 def generate(self):10 """Generate Makefile, .cproject & .project Eclipse project file,11 py_ocd_settings launch file, and software link .p2f file12 """13 super(Eclipse, self).generate()14 starting_dot = re.compile(r'(^[.]/|^[.]$)')15 ctx = {16 'name': self.project_name,17 'elf_location': join('BUILD',self.project_name)+'.elf',18 'c_symbols': self.toolchain.get_symbols(),19 'asm_symbols': self.toolchain.get_symbols(True),20 'target': self.target,21 'include_paths': [starting_dot.sub('%s/' % self.project_name, inc) for inc in self.resources.inc_dirs],22 'load_exe': str(self.LOAD_EXE).lower()23 }24 if not exists(join(self.export_dir,'eclipse-extras')):25 makedirs(join(self.export_dir,'eclipse-extras'))26 self.gen_file('cdt/pyocd_settings.tmpl', ctx,27 join('eclipse-extras',self.target+'_pyocd_settings.launch'))28 self.gen_file('cdt/necessary_software.tmpl', ctx,29 join('eclipse-extras','necessary_software.p2f'))30 self.gen_file('cdt/.cproject.tmpl', ctx, '.cproject')31 self.gen_file('cdt/.project.tmpl', ctx, '.project')32class EclipseGcc(Eclipse, GccArm):33 LOAD_EXE = True34 NAME = "Eclipse-GCC-ARM"35class EclipseArmc5(Eclipse, Armc5):36 LOAD_EXE = False37 NAME = "Eclipse-Armc5"38class EclipseIAR(Eclipse, IAR):39 LOAD_EXE = True...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!