2020-06-07 17:41:34 +02:00
|
|
|
PYTHON = python
|
2020-06-11 01:06:30 +02:00
|
|
|
VENV = venv
|
|
|
|
|
|
|
|
XGETTEXT_FLAGS = --no-wrap --language='python' --keyword=_ --from-code='UTF-8' --msgid-bugs-address='rick@gnous.eu' --width=79 --package-name='Tuxbot-bot'
|
2020-06-07 18:29:55 +02:00
|
|
|
|
|
|
|
# Init
|
|
|
|
main:
|
|
|
|
$(PYTHON) -m venv --clear $(VENV)
|
|
|
|
$(VENV)/bin/pip install -U pip setuptools
|
|
|
|
install:
|
|
|
|
$(VENV)/bin/pip install .
|
2020-11-08 01:07:27 +01:00
|
|
|
install-dev:
|
|
|
|
$(VENV)/bin/pip install -r dev.requirements.txt
|
2020-06-07 18:29:55 +02:00
|
|
|
update:
|
2021-01-19 11:16:50 +01:00
|
|
|
$(VENV)/bin/pip install --upgrade --force-reinstall .
|
2021-01-19 11:40:49 +01:00
|
|
|
update_soft:
|
|
|
|
$(VENV)/bin/pip install --upgrade .
|
2020-06-07 17:41:34 +02:00
|
|
|
|
|
|
|
# Blackify code
|
|
|
|
reformat:
|
2020-10-20 23:49:46 +02:00
|
|
|
$(PYTHON) -m black `git ls-files "*.py"` --line-length=79 && $(PYTHON) -m pylint tuxbot
|
2020-06-11 01:06:30 +02:00
|
|
|
|
|
|
|
# Translations
|
|
|
|
xgettext:
|
|
|
|
for cog in tuxbot/cogs/*/; do \
|
|
|
|
xgettext `find $$cog -type f -name '*.py'` --output=$$cog/locales/messages.pot $(XGETTEXT_FLAGS); \
|
|
|
|
done
|
|
|
|
msginit:
|
|
|
|
for cog in tuxbot/cogs/*/; do \
|
|
|
|
msginit --input=$$cog/locales/messages.pot --output=$$cog/locales/fr-FR.po --locale=fr_FR.UTF-8 --no-translator; \
|
|
|
|
msginit --input=$$cog/locales/messages.pot --output=$$cog/locales/en-US.po --locale=en_US.UTF-8 --no-translator; \
|
|
|
|
done
|
|
|
|
msgmerge:
|
|
|
|
for cog in tuxbot/cogs/*/; do \
|
|
|
|
msgmerge --update $$cog/locales/fr-FR.po $$cog/locales/messages.pot; \
|
|
|
|
msgmerge --update $$cog/locales/en-US.po $$cog/locales/messages.pot; \
|
|
|
|
done
|