From: Radek Czajka Date: Fri, 1 Mar 2019 09:56:09 +0000 (+0100) Subject: Librarian in requirements. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/2b447a437065ce4bd982562f6fd0c2877074c2da Librarian in requirements. Some housekeeping. --- diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 004f6f379..000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "lib/librarian"] - path = lib/librarian - url = git://git.nowoczesnapolska.org.pl/librarian.git diff --git a/Makefile b/Makefile index 79fa8f6f5..1a602bad4 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,6 @@ deploy: src/wolnelektury/localsettings.py - git submodule update --init pip install -r requirements/requirements.txt src/manage.py migrate --noinput src/manage.py update_counters diff --git a/lib/librarian b/lib/librarian deleted file mode 160000 index 3cae7a60c..000000000 --- a/lib/librarian +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3cae7a60cf91b6e2b84628c5f3b4b2df77eda5d6 diff --git a/requirements/requirements.txt b/requirements/requirements.txt index ed0ee1605..fc6f6fb5e 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -12,7 +12,7 @@ django-picklefield>=1.0,<1.1 django-modeltranslation==0.12.1 django-allauth==0.38.0 django-extensions==1.7.8 -djangorestframework<3.7 +djangorestframework==3.9.1 djangorestframework-xml oauthlib>=3.0.1,<3.1 @@ -24,7 +24,7 @@ django-babel==0.6.1 pytz -django-honeypot==0.6.0 +django-honeypot==0.7.0 python-memcached django-piwik @@ -38,10 +38,7 @@ mutagen>=1.31 sorl-thumbnail>=12.3,<12.4 # home-brewed & dependencies -lxml>=2.2.2 -# -e git+git://github.com/fnp/librarian.git@d43d87400dcc19851442#egg=librarian - -# MySQL-python>=1.2,<2.0 +librarian==1.7 # celery tasks celery>=3.1.12,<3.2 @@ -60,7 +57,6 @@ django-getpaid==1.8.0 deprecated httplib2 -Texml django-ssify>=0.2.6,<0.3 raven diff --git a/scripts/drop-tables b/scripts/drop-tables deleted file mode 100755 index dba22eb62..000000000 --- a/scripts/drop-tables +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -DATABASE=$1 -USERNAME=$2 -PASSWORD=$3 -mysqldump -u$USERNAME -p$PASSWORD --add-drop-table --no-data $DATABASE | grep ^DROP | mysql -u$USERNAME -p$PASSWORD $DATABASE diff --git a/scripts/make-locale-pack b/scripts/make-locale-pack index 9c8e8a760..5ccd4543b 100755 --- a/scripts/make-locale-pack +++ b/scripts/make-locale-pack @@ -4,38 +4,38 @@ ME=$0 ROOT=$(git rev-parse --show-toplevel) DST=`mktemp -d`/wl-lokalizacja mkdir -p $DST -MANAGE=$ROOT/manage.py +MANAGE=$ROOT/src/manage.py export_po() { - for appdir in $ROOT/apps/*; do + for appdir in $ROOT/src/*/; do app=`basename $appdir` - if [ -d $ROOT/apps/$app/locale ]; then - for langdir in $ROOT/apps/$app/locale/*; do + if [ -d $ROOT/src/$app/locale ]; then + for langdir in $ROOT/src/$app/locale/*; do lang=`basename $langdir` mkdir -p $DST/$lang - cp -v ${ROOT}/apps/${app}/locale/${lang}/LC_MESSAGES/django.po $DST/${lang}/${app}.po + cp -v ${ROOT}/src/${app}/locale/${lang}/LC_MESSAGES/django.po $DST/${lang}/${app}.po done fi done - for langdir in $ROOT/wolnelektury/locale-contrib/*/; do - lang = `basename $langdir` + for langdir in $ROOT/src/wolnelektury/locale-contrib/*/; do + lang=`basename $langdir` mkdir -p "$DST/$lang" cp -v "${langdir}LC_MESSAGES/django.po" "${DST}/$lang/contrib.po" done - cp -v ${ROOT}/wolnelektury/static/js/locale.js $DST/locale.js.txt - cp -v ${ROOT}/apps/infopages/fixtures/infopages.json $DST/infopages.json + cp -v ${ROOT}/src/wolnelektury/static/js/locale.js $DST/locale.js.txt + cp -v ${ROOT}/src/infopages/fixtures/infopages.json $DST/infopages.json ${0}-json.py $DST/infopages.json } ( -cd $ROOT/apps -for i in *; do +cd $ROOT/src +for i in */; do if [ -e "$i/locale" ]; then echo "Generate po for app $i" ( cd $i; $MANAGE makemessages --all; @@ -48,10 +48,10 @@ done ( pybabel extract -F "$ROOT/babel.cfg" \ - -o "$ROOT/wolnelektury/locale-contrib/django.pot" \ + -o "$ROOT/src/wolnelektury/locale-contrib/django.pot" \ "`python -c 'import os,allauth; print os.path.dirname(allauth.__file__)'`" - pybabel update -D django -i "$ROOT/wolnelektury/locale-contrib/django.pot" \ - -d "$ROOT/wolnelektury/locale-contrib" + pybabel update -D django -i "$ROOT/src/wolnelektury/locale-contrib/django.pot" \ + -d "$ROOT/src/wolnelektury/locale-contrib" ) export_po diff --git a/scripts/make-tags b/scripts/make-tags index c6f81e861..b19c80664 100755 --- a/scripts/make-tags +++ b/scripts/make-tags @@ -9,5 +9,5 @@ else echo "No Virtual env enabled, will not add it to TAGS" fi -find $ROOT/apps/wolnelektury_core/static/css -name '*.css' |xargs etags -a -o ${ROOT}/TAGS -find $ROOT/apps/wolnelektury_core/static/js -name '*.js' |xargs etags -a -o ${ROOT}/TAGS +find $ROOT/src/wolnelektury/static/css -name '*.css' |xargs etags -a -o ${ROOT}/TAGS +find $ROOT/src/wolnelektury/static/js -name '*.js' |xargs etags -a -o ${ROOT}/TAGS diff --git a/scripts/make-xml-zip.py b/scripts/make-xml-zip.py index de579c3e2..6d6a329de 100755 --- a/scripts/make-xml-zip.py +++ b/scripts/make-xml-zip.py @@ -3,18 +3,15 @@ # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # -import sys -sys.path.insert(0, '../apps') -sys.path.insert(0, '../lib') -sys.path.insert(0, '../lib/librarian') -sys.path.insert(0, '..') - -from django.core.management import setup_environ -from wolnelektury import settings +import os +import django import sys import zipfile -setup_environ(settings) +sys.path.insert(0, os.path.join(os.path.dirname(__file__), '../src')) + +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wolnelektury.settings") +django.setup() from catalogue.models import Book diff --git a/scripts/remove_duplicates.py b/scripts/remove_duplicates.py deleted file mode 100755 index bea5cda27..000000000 --- a/scripts/remove_duplicates.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. -# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. -# -import sys - -from django.core.management import setup_environ -from wolnelektury import settings -try: - set -except AttributeError: - from set import Set as set - -setup_environ(settings) - -from catalogue import models - -fragment_identifiers = set() - -print -print 'Before: %d fragments' % models.Fragment.objects.count() -print - -for fragment in models.Fragment.objects.all(): - if (fragment.book_id, fragment.anchor) in fragment_identifiers: - fragment.delete() - sys.stderr.write('X') - else: - fragment_identifiers.add((fragment.book_id, fragment.anchor)) - sys.stderr.write('.') - -print -print 'After: %d fragments' % models.Fragment.objects.count() -print \ No newline at end of file diff --git a/scripts/save-locale-pack b/scripts/save-locale-pack index 69bc9e517..c1a0f0d12 100755 --- a/scripts/save-locale-pack +++ b/scripts/save-locale-pack @@ -2,7 +2,7 @@ ME=$0 ROOT=$(git rev-parse --show-toplevel) -MANAGE=$ROOT/manage.py +MANAGE=$ROOT/src/manage.py LOCALIZED=$1 if [ ! -d "$LOCALIZED" ]; then @@ -18,9 +18,9 @@ load_lang() app=`basename "$pofile" .po` echo $app if [ "$app" = "contrib" ]; then - cp -v "$pofile" "$ROOT/wolnelektury/locale-contrib/$L/LC_MESSAGES/django.po" + cp -v "$pofile" "$ROOT/src/wolnelektury/locale-contrib/$L/LC_MESSAGES/django.po" else - cp -v "$pofile" "$ROOT/apps/$app/locale/$L/LC_MESSAGES/django.po" + cp -v "$pofile" "$ROOT/src/$app/locale/$L/LC_MESSAGES/django.po" fi done } @@ -34,16 +34,16 @@ else done fi -cp -v ${ROOT}/apps/infopages/fixtures/infopages.json "$LOCALIZED/infopages.json" +cp -v ${ROOT}/src/infopages/fixtures/infopages.json "$LOCALIZED/infopages.json" ${0}-json.py "$LOCALIZED/infopages.json" $LNG if [ ! "$?" = 0 ]; then exit 1; fi -cp -v "$LOCALIZED/infopages.json" ${ROOT}/apps/infopages/fixtures/infopages.json -cp -v "$LOCALIZED/locale.js.txt" ${ROOT}/wolnelektury/static/js/locale.js +cp -v "$LOCALIZED/infopages.json" ${ROOT}/src/infopages/fixtures/infopages.json +cp -v "$LOCALIZED/locale.js.txt" ${ROOT}/src/wolnelektury/static/js/locale.js -for i in $ROOT/apps/*; do +for i in $ROOT/src/*/; do cd $i; env PYTHONPATH=$ROOT ${VIRTUAL_ENV}/bin/django-admin.py compilemessages --settings=wolnelektury.settings done -pybabel compile -D django -d $ROOT/wolnelektury/locale-contrib +pybabel compile -D django -d $ROOT/src/wolnelektury/locale-contrib diff --git a/src/api/locale/de/LC_MESSAGES/django.mo b/src/api/locale/de/LC_MESSAGES/django.mo index fbbbcbfe1..fd1539582 100644 Binary files a/src/api/locale/de/LC_MESSAGES/django.mo and b/src/api/locale/de/LC_MESSAGES/django.mo differ diff --git a/src/api/locale/de/LC_MESSAGES/django.po b/src/api/locale/de/LC_MESSAGES/django.po index fbe58ce3c..a4ce1b502 100644 --- a/src/api/locale/de/LC_MESSAGES/django.po +++ b/src/api/locale/de/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-09-14 12:34+0200\n" +"POT-Creation-Date: 2019-03-01 09:45+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: models.py:15 +#: models.py:17 msgid "slug" msgstr "" @@ -135,3 +135,19 @@ msgid "" " %(f)s.\n" " " msgstr "" + +#: templates/oauth/authorize_token.html:4 +#: templates/oauth/authorize_token.html:7 +msgid "Authorize access to Wolne Lektury" +msgstr "Den Zugang zu Wolne Lektury authorisieren" + +#: templates/oauth/authorize_token.html:11 +#, python-format +msgid "" +"Confirm to authorize access to Wolne Lektury as user %(user)s." +msgstr "Bitte bestätigen Sie den Zugang zu Wolne Lektury %(user)s." + +#: templates/oauth/authorize_token.html:17 +msgid "Confirm" +msgstr "" diff --git a/src/api/locale/es/LC_MESSAGES/django.mo b/src/api/locale/es/LC_MESSAGES/django.mo index fbbbcbfe1..5b458944f 100644 Binary files a/src/api/locale/es/LC_MESSAGES/django.mo and b/src/api/locale/es/LC_MESSAGES/django.mo differ diff --git a/src/api/locale/es/LC_MESSAGES/django.po b/src/api/locale/es/LC_MESSAGES/django.po index fbe58ce3c..cd723830b 100644 --- a/src/api/locale/es/LC_MESSAGES/django.po +++ b/src/api/locale/es/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-09-14 12:34+0200\n" +"POT-Creation-Date: 2019-03-01 09:45+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: models.py:15 +#: models.py:17 msgid "slug" msgstr "" @@ -135,3 +135,20 @@ msgid "" " %(f)s.\n" " " msgstr "" + +#: templates/oauth/authorize_token.html:4 +#: templates/oauth/authorize_token.html:7 +msgid "Authorize access to Wolne Lektury" +msgstr "Autoriza el acceso a Wolne Lektury" + +#: templates/oauth/authorize_token.html:11 +#, python-format +msgid "" +"Confirm to authorize access to Wolne Lektury as user %(user)s." +msgstr "Confirma para autorizar el acceso a Wolne Lektury como el usuario " +"%(user)s." + +#: templates/oauth/authorize_token.html:17 +msgid "Confirm" +msgstr "" diff --git a/src/api/locale/fr/LC_MESSAGES/django.mo b/src/api/locale/fr/LC_MESSAGES/django.mo index 5ab43e3c4..a9bbec41c 100644 Binary files a/src/api/locale/fr/LC_MESSAGES/django.mo and b/src/api/locale/fr/LC_MESSAGES/django.mo differ diff --git a/src/api/locale/fr/LC_MESSAGES/django.po b/src/api/locale/fr/LC_MESSAGES/django.po index 53929e13b..faf15d28a 100644 --- a/src/api/locale/fr/LC_MESSAGES/django.po +++ b/src/api/locale/fr/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-09-14 12:34+0200\n" +"POT-Creation-Date: 2019-03-01 09:45+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: models.py:15 +#: models.py:17 msgid "slug" msgstr "" @@ -135,3 +135,20 @@ msgid "" " %(f)s.\n" " " msgstr "" + +#: templates/oauth/authorize_token.html:4 +#: templates/oauth/authorize_token.html:7 +msgid "Authorize access to Wolne Lektury" +msgstr "Autorisez l'accès à Wolne Lektury" + +#: templates/oauth/authorize_token.html:11 +#, python-format +msgid "" +"Confirm to authorize access to Wolne Lektury as user %(user)s." +msgstr "Confirmez pour autoriser l'accès à Wolne Lektury comme l'utilisateur " +"%(user)s." + +#: templates/oauth/authorize_token.html:17 +msgid "Confirm" +msgstr "" diff --git a/src/api/locale/it/LC_MESSAGES/django.mo b/src/api/locale/it/LC_MESSAGES/django.mo index fbbbcbfe1..f0c98b335 100644 Binary files a/src/api/locale/it/LC_MESSAGES/django.mo and b/src/api/locale/it/LC_MESSAGES/django.mo differ diff --git a/src/api/locale/it/LC_MESSAGES/django.po b/src/api/locale/it/LC_MESSAGES/django.po index fbe58ce3c..089a329d7 100644 --- a/src/api/locale/it/LC_MESSAGES/django.po +++ b/src/api/locale/it/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-09-14 12:34+0200\n" +"POT-Creation-Date: 2019-03-01 09:45+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: models.py:15 +#: models.py:17 msgid "slug" msgstr "" @@ -135,3 +135,20 @@ msgid "" " %(f)s.\n" " " msgstr "" + +#: templates/oauth/authorize_token.html:4 +#: templates/oauth/authorize_token.html:7 +msgid "Authorize access to Wolne Lektury" +msgstr "Autorizza accesso a Wolne Lektury" + +#: templates/oauth/authorize_token.html:11 +#, python-format +msgid "" +"Confirm to authorize access to Wolne Lektury as user %(user)s." +msgstr "Conferma l'accesso autorizzato a Wolne Lektury come utente %(user)s." + +#: templates/oauth/authorize_token.html:17 +msgid "Confirm" +msgstr "" diff --git a/src/api/locale/lt/LC_MESSAGES/django.mo b/src/api/locale/lt/LC_MESSAGES/django.mo index a10298a69..4203c031f 100644 Binary files a/src/api/locale/lt/LC_MESSAGES/django.mo and b/src/api/locale/lt/LC_MESSAGES/django.mo differ diff --git a/src/api/locale/lt/LC_MESSAGES/django.po b/src/api/locale/lt/LC_MESSAGES/django.po index 8595f543a..d5e6ae132 100644 --- a/src/api/locale/lt/LC_MESSAGES/django.po +++ b/src/api/locale/lt/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-09-14 12:34+0200\n" +"POT-Creation-Date: 2019-03-01 09:45+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -19,7 +19,7 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n" "%100<10 || n%100>=20) ? 1 : 2);\n" -#: models.py:15 +#: models.py:17 msgid "slug" msgstr "" @@ -136,3 +136,21 @@ msgid "" " %(f)s.\n" " " msgstr "" + +#: templates/oauth/authorize_token.html:4 +#: templates/oauth/authorize_token.html:7 +msgid "Authorize access to Wolne Lektury" +msgstr "Leisti prieigą prie Wolne Lektury interneto svetainės" + +#: templates/oauth/authorize_token.html:11 +#, python-format +msgid "" +"Confirm to authorize access to Wolne Lektury as user %(user)s." +msgstr "" +"Patvirtinkite, kad leistute prieigą prie Wolne Lektury interneto svetainės " +"kaip vartotojas %(user)s." + +#: templates/oauth/authorize_token.html:17 +msgid "Confirm" +msgstr "" diff --git a/src/api/locale/pl/LC_MESSAGES/django.mo b/src/api/locale/pl/LC_MESSAGES/django.mo index fc5c10799..1cbdae7ae 100644 Binary files a/src/api/locale/pl/LC_MESSAGES/django.mo and b/src/api/locale/pl/LC_MESSAGES/django.mo differ diff --git a/src/api/locale/pl/LC_MESSAGES/django.po b/src/api/locale/pl/LC_MESSAGES/django.po index 5fef31cd0..b2e8fbaaa 100644 --- a/src/api/locale/pl/LC_MESSAGES/django.po +++ b/src/api/locale/pl/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-09-14 12:34+0200\n" +"POT-Creation-Date: 2019-03-01 09:45+0100\n" "PO-Revision-Date: 2013-06-14 11:45+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: LANGUAGE \n" @@ -19,7 +19,7 @@ msgstr "" "|| n%100>=20) ? 1 : 2);\n" "X-Generator: Poedit 1.5.4\n" -#: models.py:15 +#: models.py:17 msgid "slug" msgstr "slug" @@ -40,7 +40,7 @@ msgstr "" "\n" "API serwisu WolneLektury.pl znajduje się pod adresem %(u)s.\n" "Za jego pomocą można uzyskać informacje o utworach, ich fragmentach i " -"metadanych.\n" +"metadanych.\n " #: templates/api/main.html:23 msgid "" @@ -56,7 +56,7 @@ msgstr "" "wiki/JSON\">JSON,\n" "ale dostępny jest też format XML – wystarczy dodać parametr ?" "format=xml\n" -"do każdego zapytania.\n" +"do każdego zapytania.\n " #: templates/api/main.html:32 msgid "" @@ -64,8 +64,9 @@ msgid "" " The URLs in WolneLektury.pl API are:\n" " " msgstr "" + "\n" -"API Wolnych Lektur zawiera następujące adresy URL:\n" +"API Wolnych Lektur zawiera następujące adresy URL:\n " #: templates/api/main.html:39 msgid "All books" @@ -117,7 +118,7 @@ msgstr "" "\n" "Każdy element na tych listach zawiera adres (w atrybucie „href”), pod którym " "można znaleźć szczegółowe dane, np. %(e1)s czy %(e2)s.\n" +"href=\"%(e2)s\">%(e2)s.\n " #: templates/api/main.html:72 #, python-format @@ -131,7 +132,7 @@ msgid "" msgstr "" "\n" "Można łączyć autorów, epoki, gatunki i rodzaje, aby wybrać tylko utwory " -"odpowiadające zadanym kryteriom. Na przykład: %(e)s.\n" +"odpowiadające zadanym kryteriom. Na przykład: %(e)s.\n " #: templates/api/main.html:80 #, python-format @@ -145,7 +146,7 @@ msgstr "" "\n" "Aby spośród wszystkich pasujących wybrać tylko utwory najwyższego poziomu " "(pomijając ich podutwory), można użyć zapytania /parent_books/, np.: %(e)s.\n" +"\"%(e)s\">%(e)s.\n " #: templates/api/main.html:88 #, python-format @@ -164,4 +165,20 @@ msgstr "" "wyszukiwać fragmenty:%(e)s. \n" "Każdy element uzyskanej listy w atrybucie „href” zawiera link do " "szczegółowego opisu danego fragmentu, np.:\n" -"%(f)s.\n" +"%(f)s.\n " + +#: templates/oauth/authorize_token.html:4 +#: templates/oauth/authorize_token.html:7 +msgid "Authorize access to Wolne Lektury" +msgstr "Zezwól na dostęp do Wolnych Lektur" + +#: templates/oauth/authorize_token.html:11 +#, python-format +msgid "" +"Confirm to authorize access to Wolne Lektury as user %(user)s." +msgstr "Potwierdź dostęp do Wolnych Lektur jako użytkownik %(user)s." + +#: templates/oauth/authorize_token.html:17 +msgid "Confirm" +msgstr "Potwierdź" diff --git a/src/api/locale/ru/LC_MESSAGES/django.mo b/src/api/locale/ru/LC_MESSAGES/django.mo index 94888006c..20e404df1 100644 Binary files a/src/api/locale/ru/LC_MESSAGES/django.mo and b/src/api/locale/ru/LC_MESSAGES/django.mo differ diff --git a/src/api/locale/ru/LC_MESSAGES/django.po b/src/api/locale/ru/LC_MESSAGES/django.po index 59141676b..f3d7f9d72 100644 --- a/src/api/locale/ru/LC_MESSAGES/django.po +++ b/src/api/locale/ru/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-09-14 12:34+0200\n" +"POT-Creation-Date: 2019-03-01 09:45+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -19,7 +19,7 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -#: models.py:15 +#: models.py:17 msgid "slug" msgstr "" @@ -136,3 +136,21 @@ msgid "" " %(f)s.\n" " " msgstr "" + +#: templates/oauth/authorize_token.html:4 +#: templates/oauth/authorize_token.html:7 +msgid "Authorize access to Wolne Lektury" +msgstr "Авторизация доступа к Wolne Lektury" + +#: templates/oauth/authorize_token.html:11 +#, python-format +msgid "" +"Confirm to authorize access to Wolne Lektury as user %(user)s." +msgstr "" +"Подтверждение для авторизации доступа к Wolne Lektury как пользователь " +"%(user)s ." + +#: templates/oauth/authorize_token.html:17 +msgid "Confirm" +msgstr "" diff --git a/src/api/locale/uk/LC_MESSAGES/django.mo b/src/api/locale/uk/LC_MESSAGES/django.mo index 94888006c..a603c7591 100644 Binary files a/src/api/locale/uk/LC_MESSAGES/django.mo and b/src/api/locale/uk/LC_MESSAGES/django.mo differ diff --git a/src/api/locale/uk/LC_MESSAGES/django.po b/src/api/locale/uk/LC_MESSAGES/django.po index 59141676b..419e3dbb2 100644 --- a/src/api/locale/uk/LC_MESSAGES/django.po +++ b/src/api/locale/uk/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-09-14 12:34+0200\n" +"POT-Creation-Date: 2019-03-01 09:45+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -19,7 +19,7 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -#: models.py:15 +#: models.py:17 msgid "slug" msgstr "" @@ -136,3 +136,21 @@ msgid "" " %(f)s.\n" " " msgstr "" + +#: templates/oauth/authorize_token.html:4 +#: templates/oauth/authorize_token.html:7 +msgid "Authorize access to Wolne Lektury" +msgstr "Авторизувати доступ до Wolne Lektury" + +#: templates/oauth/authorize_token.html:11 +#, python-format +msgid "" +"Confirm to authorize access to Wolne Lektury as user %(user)s." +msgstr "" +"Підтвердити, щоб авторизувати доступ до Wolne Lektury від імені користувача " +"%(user)s." + +#: templates/oauth/authorize_token.html:17 +msgid "Confirm" +msgstr "" diff --git a/src/catalogue/fields.py b/src/catalogue/fields.py index 08ac454a0..ebe4df17e 100644 --- a/src/catalogue/fields.py +++ b/src/catalogue/fields.py @@ -184,7 +184,7 @@ class BuildHtml(BuildEbook): if lang not in [ln[0] for ln in settings.LANGUAGES]: lang = None - fieldfile.save(None, ContentFile(html_output.get_string()), save=False) + fieldfile.save(None, ContentFile(html_output.get_bytes()), save=False) self.set_file_permissions(fieldfile) type(book).objects.filter(pk=book.pk).update(**{ fieldfile.field.attname: fieldfile diff --git a/src/lesmianator/models.py b/src/lesmianator/models.py index 092a828fa..684d1c4bf 100644 --- a/src/lesmianator/models.py +++ b/src/lesmianator/models.py @@ -126,7 +126,7 @@ class Continuations(models.Model): # count from this book only output = StringIO() wldoc = book.wldocument(parse_dublincore=False) - output = wldoc.as_text(('raw-text',)).get_string() + output = wldoc.as_text(('raw-text',)).get_bytes() del wldoc conts = {} diff --git a/src/manage.py b/src/manage.py index d69b6e5f5..a29b48f38 100755 --- a/src/manage.py +++ b/src/manage.py @@ -2,10 +2,6 @@ import os import sys -ROOT = os.path.dirname(os.path.abspath(__file__)) -sys.path = [ - os.path.join(ROOT, '../lib/librarian'), -] + sys.path if __name__ == "__main__": os.environ.setdefault( diff --git a/src/wolnelektury/celery.py b/src/wolnelektury/celery.py index 85ecb4a17..d1e18d7d6 100644 --- a/src/wolnelektury/celery.py +++ b/src/wolnelektury/celery.py @@ -5,15 +5,9 @@ from __future__ import absolute_import import os -import sys - from celery import Celery from django.conf import settings -ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -sys.path = [ - os.path.join(ROOT, 'lib/librarian'), -] + sys.path os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'wolnelektury.settings') diff --git a/src/wolnelektury/wsgi.py b/src/wolnelektury/wsgi.py index 245e15ddd..fe72d395d 100644 --- a/src/wolnelektury/wsgi.py +++ b/src/wolnelektury/wsgi.py @@ -1,14 +1,5 @@ # -*- coding: utf-8 -*- import os -import sys - -ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - -# Add apps and lib directories to PYTHONPATH -sys.path = [ - os.path.join(ROOT, '../lib/librarian'), -] + sys.path - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wolnelektury.settings")