How to use print_declaration method in localstack

Best Python code snippet using localstack_python

incbin.py

Source:incbin.py Github

copy

Full Screen

...21 f = open(path, "w")22 for asset in files:23 print_asset(f, asset)24 f.close()25def print_declaration(f, asset):26 asset_basename = os.path.splitext(asset)[0]27 f.write("extern unsigned char _ion_simulator_" + asset_basename + "_start;\n")28 f.write("extern unsigned char _ion_simulator_" + asset_basename + "_end;\n")29def print_mapping(f, asset):30 asset_basename = os.path.splitext(asset)[0]31 f.write('ResourceMap("' + asset + '", &_ion_simulator_' + asset_basename +'_start, &_ion_simulator_' + asset_basename + '_end),\n')32def print_header(files, path):33 f = open(path, "w")34 f.write("#ifndef ION_SIMULATOR_LINUX_IMAGES_H\n")35 f.write("#define ION_SIMULATOR_LINUX_IMAGES_H\n\n")36 f.write("// This file is auto-generated by incbin.py\n\n")37 for asset in files:38 print_declaration(f, asset)39 f.write("\nclass ResourceMap {\n")40 f.write("public:\n")41 f.write(" constexpr ResourceMap(const char * identifier, unsigned char * start, unsigned char * end) : m_identifier(identifier), m_start(start), m_end(end) {}\n")42 f.write(" const char * identifier() const { return m_identifier; }\n")43 f.write(" unsigned char * start() const { return m_start; }\n")44 f.write(" unsigned char * end() const { return m_end; }\n")45 f.write("private:\n")46 f.write(" const char * m_identifier;\n")47 f.write(" unsigned char * m_start;\n")48 f.write(" unsigned char * m_end;\n")49 f.write("};\n\n")50 f.write("static constexpr ResourceMap resources_addresses[] = {\n")51 for asset in files:52 print_mapping(f, asset)...

Full Screen

Full Screen

resgen.py

Source:resgen.py Github

copy

Full Screen

...8parser = argparse.ArgumentParser(description="Process some windows resources.")9parser.add_argument('assets', metavar='asset', type=str, nargs='+', help='The list of assets')10parser.add_argument('-o', required=True, help='The file to generate')11args = parser.parse_args()12def print_declaration(f, asset, identifier):13 f.write(str(identifier) + ' RCDATA ' + '"../assets/' + asset + '"\n')14def print_mapping(f, asset, identifier):15 f.write('ResourceID("' + asset + '", ' + str(identifier) + '),\n')16def print_mapping_header(f):17 f.write("#ifndef ION_SIMULATOR_WINDOWS_IMAGES_H\n")18 f.write("#define ION_SIMULATOR_WINDOWS_IMAGES_H\n\n")19 f.write("// This file is auto-generated by resgen.py\n\n")20 f.write("\nclass ResourceID {\n")21 f.write("public:\n")22 f.write(" constexpr ResourceID(const char * identifier, int id) : m_identifier(identifier), m_id(id) {}\n")23 f.write(" const char * identifier() const { return m_identifier; }\n")24 f.write(" int id() const { return m_id; }\n")25 f.write("private:\n")26 f.write(" const char * m_identifier;\n")...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful