Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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,
'plugin_name': plugin_name,
})
generator.destination = generator.apply("{{dst}}/{{module_path}}", ctx)
generator.write('qmldir', 'qmldir', ctx)
generator.write('private/qmldir', 'private/qmldir', ctx)
generator.write('private/{{module_name}}Module.js', 'private/module.js', ctx)
def get_filters():
return {
'qml.className': Filters.className,
'qml.defaultValue': Filters.defaultValue,
'qml.propertyType': Filters.propertyType,
}
def get_filters():
return {
'qml.className': Filters.className,
'qml.defaultValue': Filters.defaultValue,
'qml.propertyType': Filters.propertyType,
}
def get_filters():
return {
'qml.className': Filters.className,
'qml.defaultValue': Filters.defaultValue,
'qml.propertyType': Filters.propertyType,
}
def className(symbol):
classPrefix = Filters.classPrefix
return '{0}{1}'.format(classPrefix, symbol.name)
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,
'plugin_name': plugin_name,
})
generator.destination = generator.apply("{{dst}}/{{module_path}}", ctx)
generator.write('qmldir', 'qmldir', ctx)
generator.write('private/qmldir', 'private/qmldir', ctx)
generator.write('private/{{module_name}}Module.js', 'private/module.js', ctx)