Skip to content

Commit b19a0d8

Browse files
committed
Drop remaining zanata references and rename package
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
1 parent 0781719 commit b19a0d8

5 files changed

Lines changed: 34 additions & 48 deletions

File tree

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
import requests
1717

1818
KOJI_URL = 'https://koji.fedoraproject.org/kojihub'
19-
ZANATA_URL = "https://fedora.zanata.org"
20-
ZANATA_PROJECT = "fedora-modularity-translations"
21-
ZANATA_DOCUMENT = "fedora-modularity-translations"
2219

2320

2421
def get_fedora_rawhide_version(session, debug=False):
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/python3
2+
# -*- coding: utf-8 -*-
3+
# This file is part of ModulemdTranslationHelpers
4+
# Copyright (C) 2018 Stephen Gallagher
5+
#
6+
# Fedora-License-Identifier: MIT
7+
# SPDX-2.0-License-Identifier: MIT
8+
# SPDX-3.0-License-Identifier: MIT
9+
#
10+
# This program is free software.
11+
# For more information on the license, see COPYING.
12+
# For more information on free software, see
13+
# <https://www.gnu.org/philosophy/free-sw.en.html>.
14+
15+
from ModulemdTranslationHelpers.Utils import get_module_catalog_from_tags
16+
from ModulemdTranslationHelpers.Utils import get_modulemd_translations
17+
import ModulemdTranslationHelpers.Fedora
Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,17 @@
1818
import koji
1919
import os
2020
import os.path
21-
import subprocess
22-
import sys
23-
import shutil
24-
import tempfile
2521

2622
from babel.messages import pofile
2723

2824
gi.require_version('Modulemd', '1.0')
2925
from gi.repository import Modulemd
3026

31-
from mmdzanata import get_module_catalog_from_tags, get_modulemd_translations
32-
from mmdzanata.fedora import get_fedora_rawhide_version, \
33-
get_tags_for_fedora_branch, KOJI_URL
27+
from ModulemdTranslationHelpers import get_module_catalog_from_tags
28+
from ModulemdTranslationHelpers import get_modulemd_translations
29+
from ModulemdTranslationHelpers.Fedora import KOJI_URL
30+
from ModulemdTranslationHelpers.Fedora import get_fedora_rawhide_version
31+
from ModulemdTranslationHelpers.Fedora import get_tags_for_fedora_branch
3432

3533
##############################################################################
3634
# Common options for all commands #
@@ -66,7 +64,7 @@ def cli(ctx, debug, branch, koji_url):
6664
##############################################################################
6765

6866
##############################################################################
69-
# `mmdzanata extract` #
67+
# `ModulemdTranslationHelpers extract` #
7068
##############################################################################
7169

7270

@@ -99,7 +97,7 @@ def extract(ctx, pot_file):
9997

10098

10199
##############################################################################
102-
# `mmdzanata generate_metadata` #
100+
# `ModulemdTranslationHelpers generate_metadata` #
103101
##############################################################################
104102

105103
@cli.command()
@@ -137,32 +135,5 @@ def generate_metadata(ctx, pofile_dir, yaml_file):
137135
print("Wrote modulemd-translations YAML to %s" % yaml_file.name)
138136

139137

140-
@cli.command()
141-
142-
@click.pass_context
143-
def experiment(ctx, pofile_dir):
144-
"""
145-
Experiment with Babel
146-
"""
147-
148-
# Process all .po files in the provided directory
149-
translation_files = [f for f in os.listdir(pofile_dir) if
150-
os.path.isfile((os.path.join(pofile_dir, f))) and
151-
f.endswith(".po")]
152-
153-
catalogs = dict()
154-
for f in translation_files:
155-
with open(f, 'r') as infile:
156-
catalog = pofile.read_po(infile)
157-
catalogs[catalog.locale_identifier] = catalog
158-
159-
translations = get_modulemd_translations_from_catalog_dict(
160-
catalogs)
161-
162-
if ctx.parent.obj['debug']:
163-
for translation in translations:
164-
print(translation.dumps())
165-
166-
167138
if __name__ == "__main__":
168139
cli(obj={})

setup.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/python3
22
# -*- coding: utf-8 -*-
3-
# This file is part of mmdzanata
3+
# This file is part of ModulemdTranslationHelpers
44
# Copyright (C) 2018 Stephen Gallagher
55
#
66
# Fedora-License-Identifier: MIT
@@ -18,25 +18,26 @@
1818
long_description = fh.read()
1919

2020
setup(
21-
name='mmdzanata',
22-
version='0.7',
23-
packages=['mmdzanata', 'mmdzanata.fedora'],
24-
url='https://github.com/sgallagher/modulemd-zanata',
21+
name='ModulemdTranslationHelpers',
22+
version='0.1',
23+
packages=['ModulemdTranslationHelpers'],
24+
url='https://github.com/sgallagher/ModulemdTranslationHelpers',
2525
license='MIT',
2626
author='Stephen Gallagher',
2727
author_email='sgallagh@redhat.com',
2828
description='Tools for working with translations of modulemd',
2929
long_description=long_description,
30-
# mmdzanata also requires koji, libmodulemd and zanata-client which are not
31-
# available on PyPI and must be installed separately. On Fedora, this is
32-
# done with `dnf install koji libmodulemd zanata-client`
30+
# ModulemdTranslationHelpers also requires koji and libmodulemd which
31+
# are not available on PyPI and must be installed separately. On Fedora,
32+
# this is done with `dnf install koji libmodulemd`
3333
install_requires=[
3434
'click',
3535
'requests',
3636
'babel',
3737
],
3838
entry_points={
39-
'console_scripts': ['mmdzanata=mmdzanata.cli:cli'],
39+
'console_scripts': [
40+
'ModulemdTranslationHelpers=ModulemdTranslationHelpers.cli:cli'],
4041
},
4142
classifiers=(
4243
"Programming Language :: Python :: 3",

0 commit comments

Comments
 (0)