Skip to content

Commit f35632e

Browse files
committed
Add README.md and long description
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
1 parent 120c2ad commit f35632e

2 files changed

Lines changed: 77 additions & 2 deletions

File tree

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# mmdzanata
2+
## Prerequisites
3+
* [libmodulemd](https://github.com/fedora-modularity/libmodulemd)
4+
* [koji](https://pagure.io/koji)
5+
* [zanata-client](https://github.com/zanata/zanata-client)
6+
7+
To install on Fedora 28+, run:
8+
```
9+
dnf install libmodulemd koji zanata-client
10+
```
11+
12+
## Installation
13+
With the prerequisites installed, the latest version can be installed with
14+
`pip install mmdzanata` or on Fedora 28+ with `dnf install mmdzanata`
15+
(recommended).
16+
17+
## CLI Usage
18+
### Zanata Client Setup
19+
Use of the upload feature for string extraction requires setting up the
20+
Zanata client appropriately. Follow the
21+
[instructions](http://docs.zanata.org/en/release/client/configuration/) from
22+
Zanata to set up your `~/.config/zanata.ini` file appropriately. Note that
23+
you will want to do this against
24+
https://fedora.zanata.org
25+
and not
26+
https://translate.zanata.org
27+
28+
### Extract Translatable Strings
29+
To extract translatable strings from modules for a particular Fedora
30+
release (e.g. f29):
31+
```
32+
mmdzanata --branch f29 extract [--upload]
33+
```
34+
This will read all of the module metadata from the Koji build-system and
35+
convert the translatable strings to a Zanata-compatible gettext document. If
36+
`--upload` is passed, it will also attempt to use the `zanata-cli` tool to
37+
upload the strings to the Zanata server. See the "Zanata Client Setup"
38+
section above for information on how to configure this.
39+
40+
### Produce modulemd-translations YAML
41+
To read the translated strings from Zanata and convert them into
42+
modulemd-translations YAML documents that can be included in repodata:
43+
```
44+
mmdzanata --branch f29 generate_modulemd
45+
```
46+
47+
This will produce a YAML file in the current directory with all known
48+
translated strings.
49+
50+
## API
51+
### mmdzanata
52+
The mmdzanata class has two primary methods:
53+
* get_module_catalog_from_tags()
54+
* generate_metadata()
55+
56+
#### mmdzanata.get_module_catalog_from_tags()
57+
This returns a babel.message.Catalog object containing all of the
58+
translatable strings from any module tagged with one of the passed tags.
59+
60+
#### mmmdzanata.generate_metadata()
61+
This returns an iterable of modulemd-translation objects from the supplied
62+
Zanata project and branch.
63+
64+
### mmdzanata.fedora
65+
This class provides helper routines for dealing with translations in Fedora
66+
Modules.

setup.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@
1414

1515
from setuptools import setup
1616

17+
with open("README.md", "r") as fh:
18+
long_description = fh.read()
19+
1720
setup(
1821
name='mmdzanata',
19-
version='0.1',
22+
version='0.2',
2023
packages=['mmdzanata', 'mmdzanata.fedora'],
21-
url='',
24+
url='https://github.com/sgallagher/modulemd-zanata',
2225
license='MIT',
2326
author='Stephen Gallagher',
2427
author_email='sgallagh@redhat.com',
2528
description='Tools for working with translations of modulemd',
29+
long_description=long_description,
2630
# mmdzanata also requires koji, libmodulemd and zanata-client which are not
2731
# available on PyPI and must be installed separately. On Fedora, this is
2832
# done with `dnf install koji libmodulemd zanata-client`
@@ -34,4 +38,9 @@
3438
entry_points={
3539
'console_scripts': ['mmdzanata=mmdzanata.cli:cli'],
3640
},
41+
classifiers=(
42+
"Programming Language :: Python :: 3",
43+
"License :: OSI Approved :: MIT License",
44+
"Operating System :: POSIX :: Linux",
45+
),
3746
)

0 commit comments

Comments
 (0)