How to use the qface.helper.qtqml.Filters function in qface

To help you get started, we’ve selected a few qface examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Pelagicore / qface / qface / builtin / qtqml / qtqml.py View on Github external
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)
github Pelagicore / qface / qface / helper / qtqml.py View on Github external
def get_filters():
        return {
            'qml.className': Filters.className,
            'qml.defaultValue': Filters.defaultValue,
            'qml.propertyType': Filters.propertyType,
        }
github Pelagicore / qface / qface / helper / qtqml.py View on Github external
def get_filters():
        return {
            'qml.className': Filters.className,
            'qml.defaultValue': Filters.defaultValue,
            'qml.propertyType': Filters.propertyType,
        }
github Pelagicore / qface / qface / helper / qtqml.py View on Github external
def get_filters():
        return {
            'qml.className': Filters.className,
            'qml.defaultValue': Filters.defaultValue,
            'qml.propertyType': Filters.propertyType,
        }
github Pelagicore / qface / qface / helper / qtqml.py View on Github external
def className(symbol):
        classPrefix = Filters.classPrefix
        return '{0}{1}'.format(classPrefix, symbol.name)
github Pelagicore / qface / qface / builtin / qtqml / qtqml.py View on Github external
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)