Ejemplo n.º 1
0
def makerc(qrc_files, recursive, verbose):
    """Generate python module for corresponding given qrc files.

    Args:
        qrc_files (tuple): Paths to qrc files that need to generate its
            corresponding rc files.
        recursive (bool): If True, search recursively qrc filed from launching
            directory.
        verbose (bool): Boolean determining if messages will be displayed.

    """
    # Check all qrc files recursively
    if recursive:
        recursive_qrc_files = recursive_file_search("qrc")

        # Check if recursive option find qrc files
        if not recursive_qrc_files:
            v.error("Could not find any qrc files")
        else:
            generate_rc(recursive_qrc_files, verbose)

    # Process given files or warns user if none
    if qrc_files:
        generate_rc(qrc_files, verbose)
    elif not recursive:
        v.warning("No qrc files was given to process.")
Ejemplo n.º 2
0
def update(config, qrc_files, project, verbose):
    """Update project's qrc files through information stored in config file.

    Args:
        config (:class:`PyqtcliConfig`): PyqtcliConfig object representing
            project config file.
        qrc_files (tuple): Paths to qrc files that need to get updated.
        project (bool): If True, all registered qrc files will be updated.
        verbose (bool): Boolean determining if messages will be displayed.

    """
    if project:
        recursive_qrc_files = recursive_file_search("qrc")
        update_project(recursive_qrc_files, config, verbose)
        generate_rc(recursive_qrc_files, verbose)

    elif qrc_files:
        update_project(qrc_files, config, verbose)
        generate_rc(qrc_files, verbose)

    else:
        v.warning("No qrc files to update")