GithubHelp home page GithubHelp logo

chaoss / grimoirelab-perceval-weblate Goto Github PK

View Code? Open in Web Editor NEW
4.0 9.0 38.0 328 KB

GrimoireLab: Bundle of Perceval backends for Weblate

License: GNU General Public License v3.0

Python 100.00%

grimoirelab-perceval-weblate's Introduction

perceval-weblate Build Status Coverage Status PyPI version

Bundle of Perceval backends for Weblate.

Backends

The backends currently managed by this package support the next repositories:

  • Weblate

Requirements

  • Python >= 3.8

You will also need some other libraries for running the tool, you can find the whole list of dependencies in pyproject.toml file.

Installation

There are several ways to install perceval-weblate on your system: packages or source code using Poetry or pip.

PyPI

perceval-weblate can be installed using pip, a tool for installing Python packages. To do it, run the next command:

$ pip install perceval-weblate

Source code

To install from the source code you will need to clone the repository first:

$ git clone https://github.com/chaoss/grimoirelab-perceval-weblate
$ cd grimoirelab-perceval-weblate

Then use pip or Poetry to install the package along with its dependencies.

Pip

To install the package from local directory run the following command:

$ pip install .

In case you are a developer, you should install perceval-weblate in editable mode:

$ pip install -e .

Poetry

We use poetry for dependency management and packaging. You can install it following its documentation. Once you have installed it, you can install perceval-weblate and the dependencies in a project isolated environment using:

$ poetry install

To spaw a new shell within the virtual environment use:

$ poetry shell

Examples

Weblate

$ perceval weblate

License

Licensed under GNU General Public License (GPL), version 3 or later.

grimoirelab-perceval-weblate's People

Contributors

evamillan avatar jjmerchante avatar sduenas avatar vchrombie avatar zhquan avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grimoirelab-perceval-weblate's Issues

Not working for the release weblate 4.7

Weblate releases version 4.7 (June 17th) and I got this error.

$ perceval weblate https://translate.mattermost.com/ -t xxx                       
[2021-06-18 17:40:28,383] - Sir Perceval is on his quest.
[2021-06-18 17:40:28,396] - Fetching changes items on 'https://translate.mattermost.com/' from '1970-01-01 00:00:00+00:00
Traceback (most recent call last):
  File "/home/quan/venvs/perceval_weblate/src/perceval/perceval/backend.py", line 618, in run
    for item in big.items:
  File "/home/quan/venvs/perceval_weblate/src/perceval/perceval/backend.py", line 794, in __fetch
    raise e
  File "/home/quan/venvs/perceval_weblate/src/perceval/perceval/backend.py", line 788, in __fetch
    for item in items:
  File "/home/quan/venvs/perceval_weblate/src/perceval/perceval/backend.py", line 226, in fetch
    for item in self.fetch_items(category, **kwargs):
  File "/home/quan/venvs/perceval_weblate/lib/python3.6/site-packages/perceval_weblate-0.1-py3.6.egg/perceval/backends/weblate/weblate.py", line 133, in fetch_items
    for changes in changes_groups:
  File "/home/quan/venvs/perceval_weblate/lib/python3.6/site-packages/perceval_weblate-0.1-py3.6.egg/perceval/backends/weblate/weblate.py", line 309, in fetch_items
    response = self.fetch(url_next, payload=payload)
  File "/home/quan/venvs/perceval_weblate/lib/python3.6/site-packages/perceval_weblate-0.1-py3.6.egg/perceval/backends/weblate/weblate.py", line 348, in fetch
    response = super().fetch(url, payload, headers, method, stream, auth)
  File "/home/quan/venvs/perceval_weblate/src/perceval/perceval/client.py", line 143, in fetch
    response = self._fetch_from_remote(url, payload, headers, method, stream, auth)
  File "/home/quan/venvs/perceval_weblate/src/perceval/perceval/client.py", line 186, in _fetch_from_remote
    raise e
  File "/home/quan/venvs/perceval_weblate/src/perceval/perceval/client.py", line 181, in _fetch_from_remote
    response.raise_for_status()
  File "/home/quan/venvs/perceval_weblate/lib/python3.6/site-packages/requests/models.py", line 941, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://translate.mattermost.com/api/changes?timestamp_after=1970-01-01T00%3A00%3A00%2B00%3A00

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/quan/venvs/perceval_weblate/bin/perceval", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/home/quan/venvs/perceval_weblate/src/perceval/bin/perceval", line 169, in <module>
    main()
  File "/home/quan/venvs/perceval_weblate/src/perceval/bin/perceval", line 115, in main
    cmd.run()
  File "/home/quan/venvs/perceval_weblate/src/perceval/perceval/backend.py", line 628, in run
    raise RuntimeError(str(e))
RuntimeError: 404 Client Error: Not Found for url: https://translate.mattermost.com/api/changes?timestamp_after=1970-01-01T00%3A00%3A00%2B00%3A00

The correct URL is https://translate.mattermost.com/api/changes/?timestamp_after=1970-01-01T00%3A00%3A00%2B00%3A00 instead of https://translate.mattermost.com/api/changes?timestamp_after=1970-01-01T00%3A00%3A00%2B00%3A00. .../api/changes/ must finish with /

Still works for weblate 4.6.2

$ perceval weblate https://translations.documentfoundation.org -t xxx --from-date 2020-01-01
[2021-06-21 11:39:18,037] - Sir Perceval is on his quest.
[2021-06-21 11:39:18,039] - Fetching changes items on 'https://translations.documentfoundation.org' from '2020-01-01 00:00:00+00:00
{
    "backend_name": "Weblate",
    "backend_version": "0.1.0",

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.