How to use the pikaur.pprint.bold_line function in pikaur

To help you get started, we’ve selected a few pikaur 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 actionless / pikaur / pikaur / build.py View on Github external
if deps_packages_removed:
            print_error(
                _("Failed to remove installed dependencies, packages inconsistency: {}").format(
                    bold_line(', '.join(deps_packages_removed))
                )
            )
            if not ask_to_continue():
                raise SysExit(125)
        if not deps_packages_installed or self.args.keepbuilddeps:
            return

        print_stderr('{} {}:'.format(
            color_line('::', 13),
            _("Removing already installed dependencies for {}").format(
                bold_line(', '.join(self.package_names)))
        ))
        retry_interactive_command_or_exit(
            sudo(
                # pacman --remove flag conflicts with some --sync options:
                self._get_pacman_command(ignore_args=[
                    'overwrite',
                ]) + [
                    '--remove',
                ] + list(deps_packages_installed)
            ),
            pikspect=True,
        )
        PackageDB.discard_local_cache()
github actionless / pikaur / pikaur / main.py View on Github external
_("pikaur requires Python >= 3.7 to run."),
        )
        sys.exit(65)
    if running_as_root() and not check_systemd_dynamic_users():
        print_error(
            _("pikaur requires systemd >= 235 (dynamic users) to be run as root."),
        )
        sys.exit(65)
    if not dep_names:
        dep_names = [
            "fakeroot",
        ] + (['sudo'] if not running_as_root() else [])
    for dep_bin in dep_names:
        if not shutil.which(dep_bin):
            print_error("'{}' {}.".format(
                bold_line(dep_bin),
                "executable not found"
            ))
            sys.exit(2)
github actionless / pikaur / pikaur / build.py View on Github external
if (
                self._source_repo_updated
        ) or (
            not (is_devel_pkg(self.package_base) and check_dev_pkgs)
        ) or (
            (self.last_installed_hash != self.current_hash) and not self.reviewed
        ):
            return
        print_stdout('{} {}...'.format(
            color_line('::', 15),
            _n(
                "Downloading the latest sources for a devel package {}",
                "Downloading the latest sources for devel packages {}",
                len(self.package_names)
            ).format(
                bold_line(', '.join(self.package_names))
            )
        ))
        pkgver_result = joined_spawn(
            isolate_root_cmd(
                MakePkgCommand.get() + [
                    '--nobuild', '--noprepare', '--nocheck', '--nodeps'
                ],
                cwd=self.build_dir
            ),
            cwd=self.build_dir,
        )
        if pkgver_result.returncode != 0:
            print_error(_("failed to retrieve latest dev sources:"))
            print_stderr(pkgver_result.stdout_text)
            if not ask_to_continue(default_yes=False):
                raise SysExit(125)
github actionless / pikaur / pikaur / install_cli.py View on Github external
def review_build_files(self) -> None:  # pragma: no cover  pylint:disable=too-many-branches
        if self.args.needed or self.args.devel:
            for repo_status in set(self.package_builds_by_name.values()):
                if repo_status.last_installed_hash == repo_status.current_hash:
                    repo_status.reviewed = True
            self._get_installed_status()
        for repo_status in set(self.package_builds_by_name.values()):
            _pkg_label = bold_line(', '.join(repo_status.package_names))
            _skip_diff_label = _("Not showing diff for {pkg} package ({reason})")

            if repo_status.reviewed:
                print_warning(_skip_diff_label.format(
                    pkg=_pkg_label,
                    reason=_("already reviewed")
                ))
                continue

            if (
                    repo_status.last_installed_hash != repo_status.current_hash
            ) and (
                repo_status.last_installed_hash
            ) and (
                repo_status.current_hash
            ) and (
github actionless / pikaur / pikaur / install_cli.py View on Github external
def _confirm_sysupgrade(verbose=False) -> str:
            _print_sysupgrade(verbose=verbose)
            prompt = '{} {}\n{} {}\n>> '.format(
                color_line('::', 12),
                bold_line(_('Proceed with installation? [Y/n] ')),
                color_line('::', 12),
                bold_line(_('[v]iew package details   [m]anually select packages')))

            answer = get_input(prompt, _('y').upper() + _('n') + _('v') + _('m'))

            return answer
github actionless / pikaur / pikaur / pikspect.py View on Github external
def format_pacman_question(message: str, question=YesNo.QUESTION_YN_YES) -> str:
        return bold_line(" {} {} ".format(_p(message), question))
github actionless / pikaur / pikaur / print_department.py View on Github external
args = parse_args()
    local_pkgs_names = local_pkgs_versions.keys()
    sorted_packages: List[AnyPackage] = list(repo_packages) + list(sorted(
        aur_packages,
        key=get_sort_key,
        reverse=True
    ))
    enumerated_packages = list(enumerate(sorted_packages))
    if PikaurConfig().ui.ReverseSearchSorting.get_bool():
        enumerated_packages = list(reversed(enumerated_packages))

    for pkg_idx, package in enumerated_packages:
        # @TODO: return only packages for the current architecture
        idx = ''
        if enumerated:
            idx = bold_line(f'{pkg_idx+1}) ')

        pkg_name = package.name
        if args.quiet:
            print(f'{idx}{pkg_name}')
        else:

            repo = color_line('aur/', 9)
            if isinstance(package, pyalpm.Package):
                repo = pretty_format_repo_name(package.db.name)

            groups = ''
            if getattr(package, 'groups', None):
                groups = color_line('({}) '.format(' '.join(package.groups)), GROUP_COLOR)

            installed = ''
            if pkg_name in local_pkgs_names:
github actionless / pikaur / pikaur / news.py View on Github external
def _print_one_entry(news_entry: xml.etree.ElementTree.Element) -> None:
        child: xml.etree.ElementTree.Element
        for child in news_entry:
            if 'title' in child.tag:
                title = str(child.text)
            if 'pubDate' in child.tag:
                pub_date = str(child.text)
            if 'description' in child.tag:
                description = str(child.text)
        print_stdout(
            color_line(title, 14) + ' (' + bold_line(pub_date) + ')'
        )
        print_stdout(
            format_paragraph(strip_tags(description))
        )
        print_stdout()
github actionless / pikaur / pikaur / print_department.py View on Github external
def print_local_package_newer(package_name: str, aur_version: str) -> None:
    print_warning(
        _("{name} {version} local package is newer than in AUR ({aur_version}) - skipping").format(
            name=package_name,
            version=bold_line(_get_local_version(package_name)),
            aur_version=bold_line(aur_version),
        )