Some housekeeping.
+++ /dev/null
-[submodule "lib/librarian"]
- path = lib/librarian
- url = git://git.nowoczesnapolska.org.pl/librarian.git
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
+++ /dev/null
-Subproject commit 3cae7a60cf91b6e2b84628c5f3b4b2df77eda5d6
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
pytz
-django-honeypot==0.6.0
+django-honeypot==0.7.0
python-memcached
django-piwik
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
deprecated
httplib2
-Texml
django-ssify>=0.2.6,<0.3
raven
+++ /dev/null
-#!/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
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;
(
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
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
# 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
+++ /dev/null
-#!/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
ME=$0
ROOT=$(git rev-parse --show-toplevel)
-MANAGE=$ROOT/manage.py
+MANAGE=$ROOT/src/manage.py
LOCALIZED=$1
if [ ! -d "$LOCALIZED" ]; then
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
}
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
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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: models.py:15
+#: models.py:17
msgid "slug"
msgstr ""
" <a href=\"%(f)s\">%(f)s</a>.\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 <strong>%(user)s</"
+"strong>."
+msgstr "Bitte bestätigen Sie den Zugang zu Wolne Lektury <strong>%(user)s</strong>."
+
+#: templates/oauth/authorize_token.html:17
+msgid "Confirm"
+msgstr ""
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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: models.py:15
+#: models.py:17
msgid "slug"
msgstr ""
" <a href=\"%(f)s\">%(f)s</a>.\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 <strong>%(user)s</"
+"strong>."
+msgstr "Confirma para autorizar el acceso a Wolne Lektury como el usuario <strong>"
+"%(user)s</strong>."
+
+#: templates/oauth/authorize_token.html:17
+msgid "Confirm"
+msgstr ""
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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
-#: models.py:15
+#: models.py:17
msgid "slug"
msgstr ""
" <a href=\"%(f)s\">%(f)s</a>.\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 <strong>%(user)s</"
+"strong>."
+msgstr "Confirmez pour autoriser l'accès à Wolne Lektury comme l'utilisateur <strong>"
+"%(user)s</strong>."
+
+#: templates/oauth/authorize_token.html:17
+msgid "Confirm"
+msgstr ""
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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
-#: models.py:15
+#: models.py:17
msgid "slug"
msgstr ""
" <a href=\"%(f)s\">%(f)s</a>.\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 <strong>%(user)s</"
+"strong>."
+msgstr "Conferma l'accesso autorizzato a Wolne Lektury come utente <strong>%(user)s</"
+"strong>."
+
+#: templates/oauth/authorize_token.html:17
+msgid "Confirm"
+msgstr ""
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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"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 ""
" <a href=\"%(f)s\">%(f)s</a>.\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 <strong>%(user)s</"
+"strong>."
+msgstr ""
+"Patvirtinkite, kad leistute prieigą prie Wolne Lektury interneto svetainės "
+"kaip vartotojas <strong>%(user)s</strong>."
+
+#: templates/oauth/authorize_token.html:17
+msgid "Confirm"
+msgstr ""
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 <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"|| n%100>=20) ? 1 : 2);\n"
"X-Generator: Poedit 1.5.4\n"
-#: models.py:15
+#: models.py:17
msgid "slug"
msgstr "slug"
"\n"
"API serwisu WolneLektury.pl znajduje się pod adresem <code>%(u)s</code>.\n"
"Za jego pomocą można uzyskać informacje o utworach, ich fragmentach i "
-"metadanych.\n"
+"metadanych.\n "
#: templates/api/main.html:23
msgid ""
"wiki/JSON\">JSON</a>,\n"
"ale dostępny jest też format XML – wystarczy dodać parametr <code>?"
"format=xml</code>\n"
-"do każdego zapytania.\n"
+"do każdego zapytania.\n "
#: templates/api/main.html:32
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"
"\n"
"Każdy element na tych listach zawiera adres (w atrybucie „href”), pod którym "
"można znaleźć szczegółowe dane, np. <a href=\"%(e1)s\">%(e1)s</a> czy <a "
-"href=\"%(e2)s\">%(e2)s</a>.\n"
+"href=\"%(e2)s\">%(e2)s</a>.\n "
#: templates/api/main.html:72
#, python-format
msgstr ""
"\n"
"Można łączyć autorów, epoki, gatunki i rodzaje, aby wybrać tylko utwory "
-"odpowiadające zadanym kryteriom. Na przykład: <a href=\"%(e)s\">%(e)s</a>.\n"
+"odpowiadające zadanym kryteriom. Na przykład: <a href=\"%(e)s\">%(e)s</a>.\n "
#: templates/api/main.html:80
#, python-format
"\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.: <a href="
-"\"%(e)s\">%(e)s</a>.\n"
+"\"%(e)s\">%(e)s</a>.\n "
#: templates/api/main.html:88
#, python-format
"wyszukiwać fragmenty:<a href=\"%(e)s\">%(e)s</a>. \n"
"Każdy element uzyskanej listy w atrybucie „href” zawiera link do "
"szczegółowego opisu danego fragmentu, np.:\n"
-"<a href=\"%(f)s\">%(f)s</a>.\n"
+"<a href=\"%(f)s\">%(f)s</a>.\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 <strong>%(user)s</"
+"strong>."
+msgstr "Potwierdź dostęp do Wolnych Lektur jako użytkownik <strong>%(user)s</strong>."
+
+#: templates/oauth/authorize_token.html:17
+msgid "Confirm"
+msgstr "Potwierdź"
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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"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 ""
" <a href=\"%(f)s\">%(f)s</a>.\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 <strong>%(user)s</"
+"strong>."
+msgstr ""
+"Подтверждение для авторизации доступа к Wolne Lektury как пользователь "
+"<strong>%(user)s </strong>."
+
+#: templates/oauth/authorize_token.html:17
+msgid "Confirm"
+msgstr ""
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 <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"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 ""
" <a href=\"%(f)s\">%(f)s</a>.\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 <strong>%(user)s</"
+"strong>."
+msgstr ""
+"Підтвердити, щоб авторизувати доступ до Wolne Lektury від імені користувача "
+"<strong>%(user)s</strong>."
+
+#: templates/oauth/authorize_token.html:17
+msgid "Confirm"
+msgstr ""
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
# 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 = {}
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(
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')
# -*- 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")