1 # -*- coding: utf-8 -*-
2 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
3 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
6 from django.conf import settings as settings
7 from catalogue.utils import AppSettings
10 default_app_config = 'catalogue.apps.CatalogueConfig'
13 class Settings(AppSettings):
14 """Default settings for catalogue app."""
15 DEFAULT_LANGUAGE = u'pol'
16 # PDF needs TeXML + XeLaTeX, MOBI needs Calibre.
17 DONT_BUILD = set(['pdf', 'mobi'])
19 'epub': 'wolnelektury_pl_epub',
20 'pdf': 'wolnelektury_pl_pdf',
21 'mobi': 'wolnelektury_pl_mobi',
22 'fb2': 'wolnelektury_pl_fb2',
25 REDAKCJA_URL = "http://redakcja.wolnelektury.pl"
26 GOOD_LICENSES = set([r'CC BY \d\.\d', r'CC BY-SA \d\.\d'])
28 def _more_DONT_BUILD(self, value):
29 for format_ in ['cover', 'pdf', 'epub', 'mobi', 'fb2', 'txt']:
30 attname = 'NO_BUILD_%s' % format_.upper()
31 if hasattr(settings, attname):
32 logging.warn("%s is deprecated, "
33 "use CATALOGUE_DONT_BUILD instead", attname)
34 if getattr(settings, attname):
40 def _more_FORMAT_ZIPS(self, value):
41 for format_ in ['epub', 'pdf', 'mobi', 'fb2']:
42 attname = 'ALL_%s_ZIP' % format_.upper()
43 if hasattr(settings, attname):
44 logging.warn("%s is deprecated, "
45 "use CATALOGUE_FORMAT_ZIPS[%s] instead",
47 value[format_] = getattr(settings, attname)
51 app_settings = Settings('CATALOGUE')