How to use the pikaur.i18n._ 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
_("[a] abort building all the packages"),
                    ))
                )
                answer = get_input(
                    prompt,
                    _('r').upper() + _('p') + _('c') + _('i') + _('d') + _('e') +
                    _('s') + _('a')
                )

            answer = answer.lower()[0]
            if answer == _("r"):  # pragma: no cover
                continue
            if answer == _("p"):  # pragma: no cover
                skip_pgp_check = True
                continue
            if answer == _("c"):  # pragma: no cover
                skip_file_checksums = True
                continue
            if answer == _("i"):  # pragma: no cover
                self.skip_carch_check = True
                continue
            if answer == _("d"):  # pragma: no cover
                self.prepare_build_destination(flush=True)
                continue
            if answer == _('e'):  # pragma: no cover
                editor_cmd = get_editor_or_exit()
                if editor_cmd:
                    interactive_spawn(
                        editor_cmd + [self.pkgbuild_path]
                    )
                    interactive_spawn(isolate_root_cmd([
                        'cp',
github actionless / pikaur / pikaur / install_cli.py View on Github external
if self.args.noconfirm:
                    answer = _("a")
                else:  # pragma: no cover
                    prompt = '{} {}\n{}\n{}\n{}\n{}\n> '.format(
                        color_line('::', 11),
                        _("Try recovering?"),
                        _("[c] git checkout -- '*'"),
                        # _("[c] git checkout -- '*' ; git clean -f -d -x"),
                        _("[r] remove dir and clone again"),
                        _("[s] skip this package"),
                        _("[a] abort")
                    )
                    answer = get_input(prompt, _('c') + _('r') + _('s') + _('a').upper())

                answer = answer.lower()[0]
                if answer == _("c"):  # pragma: no cover
                    package_build.git_reset_changed()
                elif answer == _("r"):  # pragma: no cover
                    remove_dir(package_build.repo_path)
                elif answer == _("s"):  # pragma: no cover
                    for skip_pkg_name in package_build.package_names:
                        self.discard_install_info(skip_pkg_name)
                else:
                    raise SysExit(125)
github actionless / pikaur / pikaur / build.py View on Github external
elif self.args.noconfirm:
                answer = _("a")
            else:  # pragma: no cover
                prompt = '{} {}\n{}\n> '.format(
                    color_line('::', 11),
                    _("Try recovering?"),
                    "\n".join((
                        _("[R] retry build"),
                        _("[p] PGP check skip"),
                        _("[c] checksums skip"),
                        _("[i] ignore architecture"),
                        _("[d] delete build dir and try again"),
                        _("[e] edit PKGBUILD"),
                        "-" * 24,
                        _("[s] skip building this package"),
                        _("[a] abort building all the packages"),
                    ))
                )
                answer = get_input(
                    prompt,
                    _('r').upper() + _('p') + _('c') + _('i') + _('d') + _('e') +
                    _('s') + _('a')
                )

            answer = answer.lower()[0]
            if answer == _("r"):  # pragma: no cover
                continue
            if answer == _("p"):  # pragma: no cover
                skip_pgp_check = True
                continue
            if answer == _("c"):  # pragma: no cover
                skip_file_checksums = True
github actionless / pikaur / pikaur / install_info_fetcher.py View on Github external
def get_aur_deps_info(self) -> None:
        all_aur_pkgs = []
        for info in self.aur_updates_install_info:
            if isinstance(info.package, AURPackageInfo):
                all_aur_pkgs.append(info.package)
            else:
                raise TypeError()
        if all_aur_pkgs:
            print_stdout(_("Resolving AUR dependencies..."))
        try:
            self.aur_deps_relations = find_aur_deps(all_aur_pkgs)
        except DependencyVersionMismatch as exc:
            if exc.location is not PackageSource.LOCAL:
                raise exc
            # if local package is too old
            # let's see if a newer one can be found in AUR:
            pkg_name = exc.depends_on
            _aur_pkg_list, not_found_aur_pkgs = find_aur_packages([pkg_name, ])
            if not_found_aur_pkgs:
                raise exc
            # start over computing deps and include just found AUR package:
            self.install_package_names.append(pkg_name)
            self.get_all_packages_info()
            return
        # prepare install info (InstallInfo objects)
github actionless / pikaur / pikaur / prompt.py View on Github external
good = None
        if pikspect:
            # pylint:disable=import-outside-toplevel
            from .pikspect import pikspect as pikspect_spawn
            good = pikspect_spawn(cmd_args, **kwargs).returncode == 0
        else:
            if 'conflicts' in kwargs:
                del kwargs['conflicts']
            good = interactive_spawn(cmd_args, **kwargs).returncode == 0
        if good:
            return good
        print_stderr(color_line(_("Command '{}' failed to execute.").format(
            ' '.join(cmd_args)
        ), 9))
        if not ask_to_continue(
                text=_("Do you want to retry?"),
                default_yes=not args.noconfirm
        ):
            return False
github actionless / pikaur / pikaur / install_cli.py View on Github external
_("Can't pull '{name}' in '{path}' from AUR:")
                    ).format(
                        name=', '.join(package_build.package_names),
                        path=package_build.repo_path
                    ),
                    9
                ))
                print_stderr(err.result.stdout_text)
                print_stderr(err.result.stderr_text)
                if self.args.noconfirm:
                    answer = _("a")
                else:  # pragma: no cover
                    prompt = '{} {}\n{}\n{}\n{}\n{}\n> '.format(
                        color_line('::', 11),
                        _("Try recovering?"),
                        _("[c] git checkout -- '*'"),
                        # _("[c] git checkout -- '*' ; git clean -f -d -x"),
                        _("[r] remove dir and clone again"),
                        _("[s] skip this package"),
                        _("[a] abort")
                    )
                    answer = get_input(prompt, _('c') + _('r') + _('s') + _('a').upper())

                answer = answer.lower()[0]
                if answer == _("c"):  # pragma: no cover
                    package_build.git_reset_changed()
                elif answer == _("r"):  # pragma: no cover
                    remove_dir(package_build.repo_path)
                elif answer == _("s"):  # pragma: no cover
                    for skip_pkg_name in package_build.package_names:
                        self.discard_install_info(skip_pkg_name)
                else:
github actionless / pikaur / pikaur / info_cli.py View on Github external
# packagebaseid=_(""),
    packagebase=_("Package Base"),
    version=_("Version"),
    desc=_("Description"),
    url=_("URL"),
    keywords=_("Keywords"),
    license=_("Licenses"),
    groups=_("Groups"),
    provides=_("Provides"),
    depends=_("Depends On"),
    optdepends=_("Optional Deps"),
    makedepends=_("Make Deps"),
    checkdepends=_("Check Deps"),
    conflicts=_("Conflicts With"),
    replaces=_("Replaces"),
    maintainer=_("Maintainer"),
    numvotes=_("Votes"),
    popularity=_("Popularity"),
    firstsubmitted=_("First Submitted"),
    lastmodified=_("Last Updated"),
    outofdate=_("Out-of-date"),
)


def _decorate_info_output(output: str) -> str:
    return output.replace(
        _('None'), color_line(_('None'), 8)
    )


def cli_info_packages() -> None:
    args = parse_args()
github actionless / pikaur / pikaur / print_department.py View on Github external
if (print_repo or verbose) and pkg_update.repository:
            pkg_name = '{}{}'.format(
                _color_line(pkg_update.repository + '/', 13),
                pkg_name
            )
            pkg_len += len(pkg_update.repository) + 1
        elif print_repo:
            pkg_name = '{}{}'.format(
                _color_line('aur/', 9),
                pkg_name
            )
            pkg_len += len('aur/')

        if pkg_update.required_by:
            required_by = ' ({})'.format(
                _('for {pkg}').format(
                    pkg=', '.join([p.package.name for p in pkg_update.required_by])
                )
            )
            pkg_len += len(required_by)
            dep_color = 3
            required_by = _color_line(' ({})', dep_color).format(
                _('for {pkg}').format(
                    pkg=_color_line(', ', dep_color).join([
                        _color_line(p.package.name, dep_color + 8) for p in pkg_update.required_by
                    ]) + _color_line('', dep_color, reset=False),
                )
            )
            pkg_name += required_by
        if pkg_update.provided_by:
            provided_by = ' ({})'.format(
                ' # '.join([p.name for p in pkg_update.provided_by])
github actionless / pikaur / pikaur / info_cli.py View on Github external
args = parse_args()
    return spawn(get_pacman_command() + args.raw).stdout_text


INFO_FIELDS = dict(
    git_url=_("AUR Git URL"),
    # id=_("id"),
    name=_("Name"),
    # packagebaseid=_(""),
    packagebase=_("Package Base"),
    version=_("Version"),
    desc=_("Description"),
    url=_("URL"),
    keywords=_("Keywords"),
    license=_("Licenses"),
    groups=_("Groups"),
    provides=_("Provides"),
    depends=_("Depends On"),
    optdepends=_("Optional Deps"),
    makedepends=_("Make Deps"),
    checkdepends=_("Check Deps"),
    conflicts=_("Conflicts With"),
    replaces=_("Replaces"),
    maintainer=_("Maintainer"),
    numvotes=_("Votes"),
    popularity=_("Popularity"),
    firstsubmitted=_("First Submitted"),
    lastmodified=_("Last Updated"),
    outofdate=_("Out-of-date"),
)