How to use the qface.watch.monitor 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 qt / qtivi / src / tools / ivigenerator / generate.py View on Github external
It takes several files or directories as src and generates the code
    in the given dst directory.
    """

    global builtin_config
    builtin_config_path = here / '.config'
    if 'IVIGENERATOR_CONFIG' in os.environ:
        builtin_config_path = os.environ['IVIGENERATOR_CONFIG']
    builtin_config = yaml.load(open(builtin_config_path), Loader=yaml.SafeLoader)
    if not 'VERSION' in builtin_config or not 'FEATURES' in builtin_config:
        sys.exit("Invalid builtin config")

    if reload:
        script = '{0} {1} {2}'.format(Path(__file__).abspath(), ' '.join(src), dst)
        monitor(src, script)
    else:
        moduleConfig = {
            "module": module,
            "force": force
        }
        run(format, moduleConfig, annotations, src, dst)
github Pelagicore / qface / qface / builtin / qtcpp / qtcpp.py View on Github external
def app(src, dst, reload):
    """Takes several files or directories as src and generates the code
    in the given dst directory."""
    if reload:
        script = Path(__file__).abspath()
        monitor(script, src, dst)
    else:
        run(src, dst)
github Pelagicore / qface / qface / builtin / qtqml / qtqml.py View on Github external
def app(src, dst, reload):
    """Takes several files or directories as src and generates the code
    in the given dst directory."""
    if reload:
        script = Path(__file__).abspath()
        monitor(script, src, dst)
    else:
        run(src, dst)
github Pelagicore / qface / qface / app.py View on Github external
def main(rules, target, reload, source, watch, scaffold, feature, force, run):
    rules = Path(rules)
    if reload:
        argv = sys.argv.copy()
        argv.remove('--reload')
        watch_list = list(source)
        watch_list.append(rules.dirname())
        if watch:
            watch_list.append(watch)
        monitor(args=argv, watch=watch_list)
    else:
        features = set(feature)
        if scaffold:
            features.add('scaffold')
        run_generator(rules, source, target, features=features, force=force)
        if run:
            sh(run)