How to use the qface.generator.FileSystem.parse 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 / tests / test_generator.py View on Github external
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')
github Pelagicore / qface / tests / test_parser.py View on Github external
def test_parse():
    log.debug('test parse')
    system = FileSystem.parse(inputPath)
    assert system
github Pelagicore / qface / tests / test_generator.py View on Github external
def test_parse_document():
    system = FileSystem.parse(inputPath / 'com.pelagicore.ivi.tuner.qface')
    assert system.lookup('com.pelagicore.ivi.tuner')
github Pelagicore / qface / examples / csv / csv.py View on Github external
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)
github Pelagicore / qface / qface / builtin / qtcpp / qtcpp.py View on Github external
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)
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,