Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_parse_document_mixed():
src = [inputPath, inputPath / 'com.pelagicore.ivi.climate.qface']
system = FileSystem.parse(src)
assert system.lookup('com.pelagicore.ivi.tuner')
assert system.lookup('com.pelagicore.ivi.climate')
assert system.lookup('com.pelagicore.one')
def test_parse():
log.debug('test parse')
system = FileSystem.parse(inputPath)
assert system
def test_parse_document():
system = FileSystem.parse(inputPath / 'com.pelagicore.ivi.tuner.qface')
assert system.lookup('com.pelagicore.ivi.tuner')
def run(src, dst):
system = FileSystem.parse(src)
generator = Generator(search_path='templates')
ctx = {'dst': dst, 'system': system}
generator.write('{{dst}}/modules.csv', 'modules.csv', ctx)
def run(src, dst):
log.debug('run {0} {1}'.format(src, dst))
system = FileSystem.parse(src)
generator = Generator(search_path=here / 'templates')
generator.register_filter('returnType', Filters.returnType)
generator.register_filter('parameterType', Filters.parameterType)
generator.register_filter('defaultValue', Filters.defaultValue)
generator.register_filter('parameters', Filters.parameters)
generator.register_filter('parse_doc', parse_doc)
ctx = {'dst': dst}
for module in system.modules:
log.debug('generate code for module %s', module)
ctx.update({'module': module})
dst = generator.apply('{{dst}}/{{module|lower|replace(".", "-")}}', ctx)
generator.destination = dst
generator.write('.qmake.conf', 'qmake.conf', ctx)
generator.write('{{module|lower|replace(".", "-")}}.pro', 'plugin.pro', ctx, preserve=True)
generator.write('CMakeLists.txt', 'CMakeLists.txt', ctx)
generator.write('plugin.cpp', 'plugin.cpp', ctx, preserve=True)
def run(src, dst):
log.debug('run {0} {1}'.format(src, dst))
system = FileSystem.parse(src)
search_path = [
Path('_templates').abspath(),
Path(here / 'templates').abspath()
]
generator = Generator(search_path=search_path)
generator.register_filter('defaultValue', Filters.defaultValue)
generator.register_filter('propertyType', Filters.propertyType)
ctx = {'dst': dst}
for module in system.modules:
module_name = module.module_name
module_path = '/'.join(module.name_parts)
plugin_name = "".join(module.name_parts[:2])
ctx.update({
'module': module,
'module_name': module_name,
'module_path': module_path,