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 class Settings(AppSettings):
11 """Default settings for catalogue app."""
12 DEFAULT_LANGUAGE = u'pol'
13 # PDF needs TeXML + XeLaTeX, MOBI needs Calibre.
14 DONT_BUILD = set(['pdf', 'mobi'])
16 'epub': 'wolnelektury_pl_epub',
17 'pdf': 'wolnelektury_pl_pdf',
18 'mobi': 'wolnelektury_pl_mobi',
19 'fb2': 'wolnelektury_pl_fb2',
22 REDAKCJA_URL = "http://redakcja.wolnelektury.pl"
23 GOOD_LICENSES = set([r'CC BY \d\.\d', r'CC BY-SA \d\.\d'])
25 def _more_DONT_BUILD(self, value):
26 for format_ in ['cover', 'pdf', 'epub', 'mobi', 'fb2', 'txt']:
27 attname = 'NO_BUILD_%s' % format_.upper()
28 if hasattr(settings, attname):
29 logging.warn("%s is deprecated, "
30 "use CATALOGUE_DONT_BUILD instead", attname)
31 if getattr(settings, attname):
37 def _more_FORMAT_ZIPS(self, value):
38 for format_ in ['epub', 'pdf', 'mobi', 'fb2']:
39 attname = 'ALL_%s_ZIP' % format_.upper()
40 if hasattr(settings, attname):
41 logging.warn("%s is deprecated, "
42 "use CATALOGUE_FORMAT_ZIPS[%s] instead",
44 value[format_] = getattr(settings, attname)
48 app_settings = Settings('CATALOGUE')