Go to file
rffontenelle a34a9fed11
ci/woodpecker/push/woodpecker Pipeline was successful Details
Improve parse_args (#2)
This solves two minor issues of the `powrap --help` output:

- First one is that argparse shows short and then long form of --help option, while powrap's arguments show long and then short, causing it to look like:

```
options:
  -h, --help      show this help message and exit
  --modified, -m  Use git to find modified files ...
  -C GIT_ROOT     To use with --modified to tell ...
  --quiet, -q     Do not show progress bar ...
  ...
```

- The other thing is that the exit code is set in multi-line string, but not actually printed as multi-line string. While it looks compacted and OK in the printed help message, I assume that's not the intended so I set RawTextHelpFormatter to make sure the formatting is honored.

```
exit code: 0:nothing to do 1:would rewrap 127:error running msgcat
```

Reviewed-on: #2
Co-authored-by: rffontenelle <rffontenelle@gmail.com>
Co-committed-by: rffontenelle <rffontenelle@gmail.com>
2023-07-18 12:13:18 +00:00
powrap Improve parse_args (#2) 2023-07-18 12:13:18 +00:00
tests fix mispellings 2022-04-26 21:53:05 +02:00
.gitignore Document dependencies, and add pinned setup.cfg dependencies in requirements-dev.txt via pip-compile. 2020-10-07 21:25:12 +02:00
.pre-commit-hooks.yaml Remove unnecessary option '--modified' from pre-commit hook configuration. (#88) 2020-10-21 00:43:56 +02:00
.woodpecker.yml Migrate from Github Actions to Woodpecker CI 2023-03-30 23:32:45 +02:00
LICENSE Initial commit 2017-05-24 22:41:55 +02:00
MANIFEST.in Initial commit 2017-05-24 22:41:55 +02:00
README.rst Build badge 2023-03-30 23:36:48 +02:00
pyproject.toml Project migrated out of Github. 2023-03-31 08:47:49 +02:00
requirements-dev.txt Drop Python 3.6 (#107) 2023-03-30 23:19:29 +02:00
requirements.txt Bump requirements. 2021-06-04 07:07:51 +02:00
tox.ini Drop Python 3.6 (#107) 2023-03-30 23:19:29 +02:00

README.rst

powrap

pypi build

Script to fix indentation of given .po files. If --modified is given, it will only fix modified files according to git (useful if your .po files are versioned).

if --quiet is given, the progress bar will not be shown

Powrap is part of poutils!

Poutils (.po utils) is a metapackage to easily install useful Python tools to use with po files and powrap is a part of it! Go check out Poutils to discover the other tools!

Dependencies

powrap relies on msgcat from gettext so you'll have to install gettext first, for example on Debian run:

apt install gettext

Contributing

Start by creating a venv and pip install -r requirements-dev.txt in it.

To run the tests, use tox -p auto.

To install powrap in the current venv run pip install -e ..

Dependencies

We're using pip-tools to pin our dependencies, but in the setup.cfg our dependencies are not pinned, the goal is to ensure powrap can easily be installed along with other tools.

Dependencies pinning is only done to have a reproducible development environment and corresponding env in the CI:

pip-compile setup.py  # generates requirements.txt
pip-compile requirements-dev.in  # generates requirements-dev.txt

It's possible to upgrade pinned dependencies with the --upgrade flag of pip-compile.