diff --git a/.gitignore b/.gitignore index 60074ed..6b9cc96 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ ChangeLog po/*.gmo po/*.po po/POTFILES +po/python-meh.pot build/ diff --git a/Makefile b/Makefile index 52ce0eb..e263c0d 100644 --- a/Makefile +++ b/Makefile @@ -3,16 +3,21 @@ VERSION=$(shell awk '/Version:/ { print $$2 }' $(PKGNAME).spec) RELEASE=$(shell awk '/Release:/ { print $$2 }' $(PKGNAME).spec | sed -e 's|%.*$$||g') TAG=$(PKGNAME)-$(VERSION) -PREFIX=/usr - PYTHON=python3 TESTSUITE:=tests/baseclass.py PYCHECKEROPTS=--no-argsused --no-miximport --maxargs 0 --no-local -\# 0 --only -Q -ZANATA_PULL_ARGS = --transdir po/ -ZANATA_PUSH_ARGS = --srcdir po/ --push-type source --force +# LOCALIZATION SETTINGS +L10N_REPOSITORY ?= https://github.com/rhinstaller/python-meh-l10n.git +L10N_REPOSITORY_RW ?= git@github.com:rhinstaller/python-meh-l10n.git + +# Branch used in localization repository. This should be master all the time. +GIT_L10N_BRANCH ?= master + +# Directory in localization repository specific for this branch. +L10N_DIR ?= master default: all @@ -54,7 +59,6 @@ archive: po-pull tar -rf $(PKGNAME)-$(VERSION).tar $(PKGNAME)-$(VERSION) gzip -9 $(PKGNAME)-$(VERSION).tar rm -rf $(PKGNAME)-$(VERSION) - git checkout -- po/$(PKGNAME).pot @echo "The archive is in $(PKGNAME)-$(VERSION).tar.gz" local: po-pull @@ -76,11 +80,43 @@ potfile: $(MAKE) -C po potfile po-pull: - rpm -q python2-zanata-client &>/dev/null || ( echo "need to run: dnf install zanata-python-client"; exit 1 ) - zanata pull $(ZANATA_PULL_ARGS) + TEMP_DIR=$$(mktemp --tmpdir -d $(PKGNAME)-localization-XXXXXXXXXX) && \ + git clone --depth 1 -b $(GIT_L10N_BRANCH) -- $(L10N_REPOSITORY) $$TEMP_DIR && \ + cp $$TEMP_DIR/$(L10N_DIR)/*.po ./po/ && \ + rm -rf $$TEMP_DIR + +po-push: potfile +# This algorithm will make these steps: +# - clone localization repository +# - copy pot file to this repository +# - check if pot file is changed (ignore the POT-Creation-Date otherwise it's always changed) +# - if not changed: +# - remove cloned repository +# - if changed: +# - add pot file +# - commit pot file +# - tell user to verify this file and push to the remote from the temp dir + TEMP_DIR=$$(mktemp --tmpdir -d $(PKGNAME)-localization-XXXXXXXXXX) || exit 1 ; \ + git clone --depth 1 -b $(GIT_L10N_BRANCH) -- $(L10N_REPOSITORY_RW) $$TEMP_DIR || exit 2 ; \ + cp ./po/$(PKGNAME).pot $$TEMP_DIR/$(L10N_DIR)/ || exit 3 ; \ + pushd $$TEMP_DIR/$(L10N_DIR) ; \ + git difftool --trust-exit-code -y -x "diff -u -I '^\"POT-Creation-Date: .*$$'" HEAD ./$(PKGNAME).pot &>/dev/null ; \ + if [ $$? -eq 0 ] ; then \ + popd ; \ + echo "Pot file is up to date" ; \ + rm -rf $$TEMP_DIR ; \ + else \ + git add ./$(PKGNAME).pot && \ + git commit -m "Update $(PKGNAME).pot" && \ + popd && \ + echo "Pot file updated for the localization repository $(L10N_REPOSITORY)" && \ + echo "Please confirm changes and push:" && \ + echo "$$TEMP_DIR" ; \ + fi ; + +bumpver: po-push + read -p "Please see the above message. Verify and push localization commit. Press anything to continue." -n 1 -r -bumpver: potfile - zanata push $(ZANATA_PUSH_ARGS) || ( echo "zanata push failed"; exit 1 ) @NEWSUBVER=$$((`echo $(VERSION) |cut -d . -f 2` + 1)) ; \ NEWVERSION=`echo $(VERSION).$$NEWSUBVER |cut -d . -f 1,3` ; \ DATELINE="* `LANG=c date "+%a %b %d %Y"` `git config user.name` <`git config user.email`> - $$NEWVERSION-1" ; \ diff --git a/README.md b/README.md new file mode 100644 index 0000000..9b0d407 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +[![Translation status](https://translate.fedoraproject.org/widgets/python-meh/-/rhel-8/svg-badge.svg)](https://translate.fedoraproject.org/engage/python-meh/?utm_source=widget) + +Python Meh +========== + +The python-meh package is a python library for handling, saving, and reporting exceptions. diff --git a/po/python-meh.pot b/po/python-meh.pot deleted file mode 100644 index 97ce44a..0000000 --- a/po/python-meh.pot +++ /dev/null @@ -1,116 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-12-10 20:38+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: ../meh/handler.py:195 -msgid "" -"Use 'continue' command to quit the debugger and get back to the main menu" -msgstr "" - -#: ../meh/handler.py:211 -msgid "Exit the shell to get back to the main menu" -msgstr "" - -#. short (one-char) answer meaning "yes" -#: ../meh/ui/text.py:75 -msgid "y" -msgstr "" - -#. short (one-char) answer meaning "no" -#: ../meh/ui/text.py:78 -msgid "n" -msgstr "" - -#: ../meh/ui/text.py:145 -msgid "Save exception" -msgstr "" - -#: ../meh/ui/text.py:158 tmp/exception-dialog.glade.h:1 -msgid "An unknown error has occurred" -msgstr "" - -#: ../meh/ui/text.py:161 -msgid "Report Bug" -msgstr "" - -#: ../meh/ui/text.py:162 -msgid "Run shell" -msgstr "" - -#: ../meh/ui/text.py:163 -msgid "Quit" -msgstr "" - -#: ../meh/ui/text.py:168 -msgid "Debug" -msgstr "" - -#: ../meh/ui/text.py:173 -msgid "What do you want to do now?" -msgstr "" - -#: ../meh/ui/text.py:181 -msgid "Please make your choice from above: " -msgstr "" - -#: ../meh/ui/text.py:199 -msgid "Hit ENTER to continue" -msgstr "" - -#: ../meh/ui/text.py:213 -#, python-format -msgid "Are you sure you want to exit? [%(yes)s/%(no)s]" -msgstr "" - -#: ../meh/ui/gui.py:176 -msgid "_Exit" -msgstr "" - -#: tmp/exception-dialog.glade.h:2 -msgid "" -"This program has encountered an unknown error. You may\n" -"report the bug below or quit the program." -msgstr "" - -#: tmp/exception-dialog.glade.h:4 -msgid "_Report Bug" -msgstr "" - -#: tmp/exception-dialog.glade.h:5 -msgid "_Quit" -msgstr "" - -#: tmp/exception-dialog.glade.h:6 -msgid "The output below may help determine the cause of the error:" -msgstr "" - -#: tmp/exception-dialog.glade.h:7 -msgid "'Debug' may take you to tty1." -msgstr "" - -#: tmp/exception-dialog.glade.h:8 -msgid "_Debug" -msgstr "" - -#: tmp/exception-dialog.glade.h:9 -msgid "More _info..." -msgstr "" - -#: tmp/exception-dialog.glade.h:10 -msgid "No additional info available." -msgstr "" diff --git a/zanata.xml b/zanata.xml deleted file mode 100644 index 696e525..0000000 --- a/zanata.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - https://fedora.zanata.org/ - python-meh - rhel-8 - gettext -