From 6d42bc478e3d1bd90eb294464748c21e4de0fc63 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 6 Aug 2019 11:38:11 +0200 Subject: [PATCH] Housekeeping. --- src/ajaxable/__init__.py | 1 - src/ajaxable/templatetags/ajaxable_tags.py | 5 +- src/api/admin.py | 3 + src/api/drf_auth.py | 1 - src/api/migrations/0001_initial.py | 3 + src/api/migrations/0002_auto_20151221_1225.py | 6 +- src/api/migrations/0003_bookuserdata.py | 3 + .../0004_bookuserdata_last_changed.py | 8 +- .../0005_consumer_nonce_resource_token.py | 7 +- src/api/models.py | 8 +- src/api/renderers.py | 3 + src/api/request_validator.py | 1 - src/api/serializers.py | 1 - src/api/settings.py | 12 - src/api/tests/tests.py | 4 +- src/api/urls.py | 1 - src/api/utils.py | 1 - src/api/views.py | 1 - src/catalogue/__init__.py | 3 +- src/catalogue/admin.py | 12 +- src/catalogue/api/helpers.py | 3 + src/catalogue/api/urls.py | 1 - src/catalogue/apps.py | 1 - src/catalogue/constants.py | 1 - src/catalogue/feeds.py | 6 +- src/catalogue/fields.py | 1 - src/catalogue/forms.py | 1 - src/catalogue/helpers.py | 1 - src/catalogue/import_utils.py | 1 - .../management/commands/load_abstracts.py | 1 - .../management/commands/update_popularity.py | 3 - .../commands/update_preview_status.py | 1 - src/catalogue/migrations/0001_initial.py | 3 + .../migrations/0002_book_ancestor.py | 6 +- .../migrations/0003_populate_ancestors.py | 6 +- ...0004_remove_booktags_count_related_info.py | 6 +- .../migrations/0005_auto_20141016_1337.py | 6 +- .../migrations/0006_auto_20141022_1059.py | 6 +- .../migrations/0007_auto_20151123_1529.py | 6 +- .../migrations/0008_auto_20151221_1225.py | 6 +- .../migrations/0009_auto_20160127_1019.py | 6 +- .../migrations/0010_bookpopularity.py | 3 + .../migrations/0011_auto_20160413_1152.py | 6 +- .../migrations/0012_auto_20161020_1407.py | 6 +- .../migrations/0013_book_print_on_demand.py | 6 +- .../migrations/0014_auto_20170627_1442.py | 6 +- .../migrations/0015_book_recommended.py | 6 +- .../migrations/0016_auto_20171031_1232.py | 3 + .../migrations/0017_auto_20171214_1746.py | 6 +- .../migrations/0018_auto_20171221_1106.py | 6 +- .../migrations/0019_auto_20171221_1107.py | 6 +- .../migrations/0020_book_cover_api_thumb.py | 6 +- .../migrations/0021_auto_20171222_1404.py | 6 +- .../migrations/0022_auto_20180226_1503.py | 6 +- .../migrations/0023_book_abstract.py | 6 +- .../migrations/0024_auto_20180510_1407.py | 6 +- .../migrations/0024_book_audio_length.py | 6 +- src/catalogue/migrations/0025_merge.py | 6 +- .../migrations/0026_book_preview_key.py | 7 +- src/catalogue/models/__init__.py | 1 - src/catalogue/models/book.py | 24 +- src/catalogue/models/source.py | 2 +- src/catalogue/models/tag.py | 4 +- src/catalogue/tasks.py | 1 - src/catalogue/templatetags/catalogue_tags.py | 24 +- src/catalogue/test_utils.py | 5 +- src/catalogue/tests/test_book_import.py | 39 ++- src/catalogue/tests/test_bookmedia.py | 7 +- src/catalogue/tests/test_cover.py | 1 - src/catalogue/tests/test_tags.py | 17 +- src/catalogue/tests/test_templatetags.py | 5 +- src/catalogue/tests/test_visit.py | 3 +- src/catalogue/urls.py | 1 - src/catalogue/utils.py | 3 +- src/chunks/admin.py | 1 - src/chunks/migrations/0001_initial.py | 6 +- .../migrations/0002_auto_20140911_1253.py | 6 +- .../migrations/0003_auto_20151221_1225.py | 6 +- src/chunks/templatetags/chunks.py | 3 + src/chunks/translation.py | 1 - src/club/admin.py | 3 + src/club/apps.py | 3 + src/club/forms.py | 3 + src/club/helpers.py | 3 + src/club/management/commands/prolong.py | 3 + src/club/migrations/0001_initial.py | 7 +- .../migrations/0002_auto_20190416_1024.py | 7 +- .../0003_remove_payuorder_amount.py | 7 +- .../migrations/0004_payucardtoken_pos_id.py | 7 +- .../migrations/0005_auto_20190416_1052.py | 7 +- .../migrations/0006_auto_20190416_1236.py | 7 +- .../migrations/0007_auto_20190416_1625.py | 7 +- src/club/migrations/0008_membership_name.py | 7 +- .../migrations/0009_auto_20190510_1510.py | 7 +- .../migrations/0010_auto_20190529_0946.py | 7 +- src/club/models.py | 5 +- src/club/payment_methods.py | 3 + src/club/payu/__init__.py | 3 + src/club/payu/forms.py | 3 + src/club/payu/models.py | 3 + src/club/payu/pos.py | 3 + src/club/payu/tests/integration.py | 3 + src/club/payu/tests/tests.py | 17 -- src/club/payu/views.py | 3 + src/club/permissions.py | 3 + src/club/templatetags/club.py | 3 + src/club/translation.py | 1 - src/club/urls.py | 3 + src/club/views.py | 3 + src/contact/__init__.py | 4 +- src/contact/admin.py | 6 +- src/contact/fields.py | 1 - src/contact/forms.py | 6 +- src/contact/mailing.py | 3 + src/contact/migrations/0001_initial.py | 3 + src/contact/models.py | 5 +- src/contact/templatetags/contact_tags.py | 4 +- src/contact/urls.py | 4 +- src/contact/views.py | 3 + src/contact/widgets.py | 3 +- src/dictionary/constants.py | 3 - src/dictionary/migrations/0001_initial.py | 3 + .../migrations/0002_auto_20141006_1422.py | 3 + .../migrations/0003_auto_20141023_1445.py | 6 +- .../migrations/0004_auto_20151221_1225.py | 6 +- src/dictionary/templatetags/set_get.py | 1 - src/dictionary/tests.py | 3 +- src/dictionary/urls.py | 1 - src/dictionary/views.py | 1 - src/funding/__init__.py | 3 +- src/funding/admin.py | 1 - src/funding/forms.py | 3 +- src/funding/migrations/0001_initial.py | 3 + .../migrations/0002_auto_20151221_1225.py | 6 +- .../migrations/0003_auto_20180416_1336.py | 6 +- .../migrations/0004_auto_20190729_1450.py | 7 +- src/funding/models.py | 8 +- src/funding/tests.py | 1 - src/funding/utils.py | 3 +- src/funding/widgets.py | 3 +- src/infopages/admin.py | 1 - src/infopages/migrations/0001_initial.py | 6 +- .../migrations/0002_auto_20151221_1225.py | 6 +- src/infopages/templatetags/infopages_tags.py | 1 - src/infopages/translation.py | 1 - src/infopages/urls.py | 1 - src/infopages/views.py | 1 - src/isbn/forms.py | 19 +- src/isbn/management/commands/eisbn_csv.py | 1 - src/isbn/management/commands/export_onix.py | 3 + src/isbn/management/commands/import_onix.py | 7 +- src/isbn/migrations/0001_initial.py | 3 + .../migrations/0002_auto_20180213_1617.py | 6 +- src/isbn/migrations/0003_isbnpool_purpose.py | 6 +- .../migrations/0004_auto_20180215_1042.py | 6 +- .../migrations/0005_auto_20190729_1450.py | 7 +- src/isbn/urls.py | 4 +- src/isbn/utils.py | 9 +- src/isbn/views.py | 3 + src/lesmianator/__init__.py | 1 - src/lesmianator/migrations/0001_initial.py | 3 + .../migrations/0002_auto_20151221_1225.py | 3 + .../migrations/0003_auto_20190729_1450.py | 7 +- src/lesmianator/models.py | 6 +- src/lesmianator/urls.py | 1 - src/libraries/admin.py | 1 - src/libraries/migrations/0001_initial.py | 6 +- .../migrations/0002_auto_20151221_1225.py | 6 +- src/libraries/urls.py | 1 - src/libraries/views.py | 1 - src/manage.py | 3 + src/newsletter/admin.py | 4 +- src/newsletter/forms.py | 22 +- src/newsletter/migrations/0001_initial.py | 6 +- .../migrations/0002_auto_20160914_1452.py | 6 +- src/newsletter/models.py | 6 +- src/newsletter/tests.py | 3 - src/newsletter/urls.py | 4 +- src/newsletter/views.py | 13 +- src/newtagging/admin.py | 71 ----- src/newtagging/managers.py | 4 +- src/newtagging/models.py | 4 +- src/oai/handlers.py | 5 +- src/oai/tests/test_oaipmhapi.py | 1 - src/oai/urls.py | 1 - src/oai/views.py | 1 - src/opds/tests/test_opds.py | 5 +- src/opds/urls.py | 1 - src/opds/views.py | 176 +++++------ src/paypal/forms.py | 1 - src/paypal/migrations/0001_initial.py | 3 + .../migrations/0002_billingagreement_token.py | 6 +- .../migrations/0003_auto_20190729_1450.py | 7 +- src/paypal/rest.py | 4 +- src/pdcounter/admin.py | 1 - src/pdcounter/migrations/0001_initial.py | 6 +- .../migrations/0002_auto_20151221_1225.py | 6 +- src/pdcounter/models.py | 2 +- src/pdcounter/templatetags/time_tags.py | 1 - src/pdcounter/views.py | 3 +- src/picture/admin.py | 1 - src/picture/api/urls.py | 1 - src/picture/api/views.py | 1 - src/picture/forms.py | 1 - src/picture/migrations/0001_initial.py | 3 + .../0002_remove_picture__related_info.py | 6 +- .../migrations/0003_auto_20140924_1559.py | 6 +- .../migrations/0004_auto_20141016_1337.py | 6 +- .../migrations/0005_auto_20141022_1001.py | 3 + .../migrations/0006_auto_20151221_1225.py | 3 + .../migrations/0007_auto_20160125_1709.py | 6 +- .../migrations/0008_auto_20160413_1152.py | 6 +- src/picture/models.py | 2 +- src/picture/tests/test_picture_import.py | 7 +- src/polls/admin.py | 1 - src/polls/forms.py | 25 +- src/polls/migrations/0001_initial.py | 3 + .../migrations/0002_auto_20151221_1225.py | 6 +- src/polls/templatetags/polls_tags.py | 1 - src/polls/urls.py | 1 - src/push/admin.py | 1 - src/push/forms.py | 3 +- src/push/migrations/0001_initial.py | 6 +- .../migrations/0002_auto_20180830_1627.py | 6 +- .../migrations/0003_auto_20180831_1135.py | 6 +- src/push/models.py | 7 +- src/push/urls.py | 1 - src/push/utils.py | 1 - src/reporting/models.py | 1 - src/reporting/templatetags/reporting_stats.py | 1 - src/reporting/urls.py | 1 - src/search/__init__.py | 4 - src/search/fields.py | 9 +- src/search/forms.py | 1 - src/search/index.py | 12 +- src/search/templatetags/search_tags.py | 4 +- src/search/tests/__init__.py | 1 - src/search/tests/index.py | 5 +- src/search/urls.py | 1 - src/search/views.py | 3 +- src/social/api/urls.py | 1 - src/social/api/views.py | 1 - src/social/migrations/0001_initial.py | 3 + .../migrations/0002_auto_20151221_1225.py | 6 +- src/social/migrations/0003_cite_banner.py | 6 +- .../migrations/0004_auto_20170725_1204.py | 6 +- .../migrations/0005_auto_20190318_1309.py | 7 +- src/social/migrations/0006_legacy_group.py | 3 + .../migrations/0007_auto_20190318_1339.py | 7 +- .../migrations/0008_auto_20190403_1510.py | 7 +- .../migrations/0009_auto_20190715_1405.py | 7 +- .../migrations/0010_cite_background_plain.py | 7 +- src/social/models.py | 9 +- src/sortify.py | 3 + src/sponsors/__init__.py | 3 +- src/sponsors/migrations/0001_initial.py | 3 + .../migrations/0002_auto_20151221_1225.py | 6 +- src/sponsors/widgets.py | 8 +- src/stats/tasks.py | 3 +- src/suggest/admin.py | 1 - src/suggest/forms.py | 16 +- src/suggest/migrations/0001_initial.py | 3 + .../migrations/0002_auto_20151221_1225.py | 6 +- .../migrations/0003_auto_20190729_1450.py | 7 +- src/suggest/urls.py | 1 - src/waiter/__init__.py | 1 - src/waiter/migrations/0001_initial.py | 6 +- src/waiter/settings.py | 1 - src/waiter/tasks.py | 1 - src/waiter/urls.py | 1 - src/waiter/utils.py | 1 - src/waiter/views.py | 1 - src/wolnelektury/__init__.py | 1 - src/wolnelektury/apps.py | 1 - src/wolnelektury/celery.py | 3 - src/wolnelektury/contact_forms.py | 273 +++++++++--------- src/wolnelektury/context_processors.py | 1 - src/wolnelektury/forms.py | 8 +- .../commands/clean_social_accounts.py | 1 - src/wolnelektury/management/profile.py | 1 - .../migrations/getpaid/0001_initial.py | 3 + .../getpaid/0002_auto_20151221_1225.py | 6 +- src/wolnelektury/settings/__init__.py | 4 +- src/wolnelektury/settings/auth.py | 1 - src/wolnelektury/settings/contrib.py | 1 - src/wolnelektury/settings/custom.py | 1 - src/wolnelektury/settings/locale.py | 21 +- src/wolnelektury/settings/paths.py | 1 - src/wolnelektury/settings/static.py | 1 - src/wolnelektury/settings/test.py | 3 + src/wolnelektury/signals.py | 1 - src/wolnelektury/templatetags/blog.py | 3 + src/wolnelektury/templatetags/switch_tag.py | 1 - src/wolnelektury/test_utils.py | 3 + src/wolnelektury/utils.py | 4 +- src/wolnelektury/wsgi.py | 4 +- 296 files changed, 884 insertions(+), 944 deletions(-) delete mode 100644 src/club/payu/tests/tests.py delete mode 100644 src/newsletter/tests.py delete mode 100644 src/newtagging/admin.py diff --git a/src/ajaxable/__init__.py b/src/ajaxable/__init__.py index ffa37881b..46cda3d05 100644 --- a/src/ajaxable/__init__.py +++ b/src/ajaxable/__init__.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/ajaxable/templatetags/ajaxable_tags.py b/src/ajaxable/templatetags/ajaxable_tags.py index d327e2eb6..940648143 100644 --- a/src/ajaxable/templatetags/ajaxable_tags.py +++ b/src/ajaxable/templatetags/ajaxable_tags.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -23,7 +22,7 @@ def placeholdized_ul(form): @register.filter def pretty_field(field, template=None): if template is None: - template = u''' + template = '''
  • %(errors)s @@ -39,7 +38,7 @@ def pretty_field(field, template=None): @register.filter def pretty_checkbox(field): - return pretty_field(field, template=u''' + return pretty_field(field, template='''
  • %(errors)s diff --git a/src/api/admin.py b/src/api/admin.py index c931db060..98574986c 100644 --- a/src/api/admin.py +++ b/src/api/admin.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.contrib import admin from . import models diff --git a/src/api/drf_auth.py b/src/api/drf_auth.py index 893f06610..fa57b41bf 100644 --- a/src/api/drf_auth.py +++ b/src/api/drf_auth.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/api/migrations/0001_initial.py b/src/api/migrations/0001_initial.py index a4a8a8486..4c3af2f34 100644 --- a/src/api/migrations/0001_initial.py +++ b/src/api/migrations/0001_initial.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations import django.db.models.deletion diff --git a/src/api/migrations/0002_auto_20151221_1225.py b/src/api/migrations/0002_auto_20151221_1225.py index 339068ac5..4245868dd 100644 --- a/src/api/migrations/0002_auto_20151221_1225.py +++ b/src/api/migrations/0002_auto_20151221_1225.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/api/migrations/0003_bookuserdata.py b/src/api/migrations/0003_bookuserdata.py index 2a70fb5f5..f8b45e7e2 100644 --- a/src/api/migrations/0003_bookuserdata.py +++ b/src/api/migrations/0003_bookuserdata.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models import django.db.models.deletion from django.conf import settings diff --git a/src/api/migrations/0004_bookuserdata_last_changed.py b/src/api/migrations/0004_bookuserdata_last_changed.py index f42c4054e..d00ac8bd6 100644 --- a/src/api/migrations/0004_bookuserdata_last_changed.py +++ b/src/api/migrations/0004_bookuserdata_last_changed.py @@ -1,8 +1,8 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import datetime +from django.db import migrations, models from django.utils.timezone import utc diff --git a/src/api/migrations/0005_consumer_nonce_resource_token.py b/src/api/migrations/0005_consumer_nonce_resource_token.py index ebbf81da6..9b706a4ad 100644 --- a/src/api/migrations/0005_consumer_nonce_resource_token.py +++ b/src/api/migrations/0005_consumer_nonce_resource_token.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-02-28 22:38 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.conf import settings from django.db import migrations, models import django.db.models.deletion diff --git a/src/api/models.py b/src/api/models.py index 1e25c36db..e72aaff20 100644 --- a/src/api/models.py +++ b/src/api/models.py @@ -76,7 +76,7 @@ class Nonce(models.Model): key = models.CharField(max_length=255) def __str__(self): - return u"Nonce %s for %s" % (self.key, self.consumer_key) + return "Nonce %s for %s" % (self.key, self.consumer_key) class Consumer(models.Model): @@ -88,13 +88,13 @@ class Consumer(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, models.CASCADE, null=True, blank=True, related_name='consumers') def __str__(self): - return u"Consumer %s with key %s" % (self.name, self.key) + return "Consumer %s with key %s" % (self.name, self.key) class Token(models.Model): REQUEST = 1 ACCESS = 2 - TOKEN_TYPES = ((REQUEST, u'Request'), (ACCESS, u'Access')) + TOKEN_TYPES = ((REQUEST, 'Request'), (ACCESS, 'Access')) key = models.CharField(max_length=KEY_SIZE) secret = models.CharField(max_length=SECRET_SIZE) @@ -105,4 +105,4 @@ class Token(models.Model): consumer = models.ForeignKey(Consumer, models.CASCADE) def __str__(self): - return u"%s Token %s for %s" % (self.get_token_type_display(), self.key, self.consumer) + return "%s Token %s for %s" % (self.get_token_type_display(), self.key, self.consumer) diff --git a/src/api/renderers.py b/src/api/renderers.py index b5b63c6fd..57edec3fb 100644 --- a/src/api/renderers.py +++ b/src/api/renderers.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from rest_framework_xml.renderers import XMLRenderer diff --git a/src/api/request_validator.py b/src/api/request_validator.py index 2c16691f8..690d3e9bf 100644 --- a/src/api/request_validator.py +++ b/src/api/request_validator.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/api/serializers.py b/src/api/serializers.py index fb013e417..237a155c3 100644 --- a/src/api/serializers.py +++ b/src/api/serializers.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/api/settings.py b/src/api/settings.py index 0802c5453..e69de29bb 100644 --- a/src/api/settings.py +++ b/src/api/settings.py @@ -1,12 +0,0 @@ -# -*- 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 os.path -from django.conf import settings - - -try: - MOBILE_INIT_DB = settings.API_MOBILE_INIT_DB -except AttributeError: - MOBILE_INIT_DB = os.path.abspath(os.path.join(settings.MEDIA_ROOT, 'api/mobile/initial/')) diff --git a/src/api/tests/tests.py b/src/api/tests/tests.py index 993a52409..e17db29c7 100644 --- a/src/api/tests/tests.py +++ b/src/api/tests/tests.py @@ -302,8 +302,8 @@ class OAuth1Tests(ApiTest): ).digest() h = b64encode(h).rstrip(b'\n') sign = quote(h) - query = u"{}&oauth_signature={}".format(base_query, sign) - response = self.client.get(u'/api/oauth/access_token/?' + query) + query = "{}&oauth_signature={}".format(base_query, sign) + response = self.client.get('/api/oauth/access_token/?' + query) access_token_data = parse_qs(response.content.decode('latin1')) access_token = access_token_data['oauth_token'][0] diff --git a/src/api/urls.py b/src/api/urls.py index cb890da3d..536d3fe49 100644 --- a/src/api/urls.py +++ b/src/api/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/api/utils.py b/src/api/utils.py index a3a1f893a..3674838db 100644 --- a/src/api/utils.py +++ b/src/api/utils.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/api/views.py b/src/api/views.py index 99c8df182..69f9b8b03 100644 --- a/src/api/views.py +++ b/src/api/views.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/catalogue/__init__.py b/src/catalogue/__init__.py index 612517b92..1290f81d6 100644 --- a/src/catalogue/__init__.py +++ b/src/catalogue/__init__.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -13,7 +12,7 @@ default_app_config = 'catalogue.apps.CatalogueConfig' class Settings(AppSettings): """Default settings for catalogue app.""" - DEFAULT_LANGUAGE = u'pol' + DEFAULT_LANGUAGE = 'pol' # PDF needs TeXML + XeLaTeX, MOBI needs Calibre. DONT_BUILD = {'pdf', 'mobi'} FORMAT_ZIPS = { diff --git a/src/catalogue/admin.py b/src/catalogue/admin.py index 44b6fb76f..9008df14a 100644 --- a/src/catalogue/admin.py +++ b/src/catalogue/admin.py @@ -4,7 +4,6 @@ from django.contrib import admin from django import forms -from newtagging.admin import TaggableModelAdmin, TaggableModelForm from catalogue.models import Tag, Book, Fragment, BookMedia, Collection, Source @@ -17,7 +16,7 @@ class TagAdmin(admin.ModelAdmin): def occurrences(self, tag): return tag.items.count() - occurrences.short_description = u'Wystąpienia' + occurrences.short_description = 'Wystąpienia' prepopulated_fields = {'slug': ('name',), 'sort_key': ('name',)} radio_fields = {'category': admin.HORIZONTAL} @@ -29,12 +28,7 @@ class MediaInline(admin.TabularInline): extra = 0 -#FIXME: Taggable admin is broken. -#class BookAdmin(TaggableModelAdmin): class BookAdmin(admin.ModelAdmin): - #tag_model = Tag - #form = TaggableModelForm - list_display = ('title', 'slug', 'created_at', 'has_epub_file', 'has_html_file', 'has_description',) search_fields = ('title',) ordering = ('title',) @@ -42,11 +36,7 @@ class BookAdmin(admin.ModelAdmin): inlines = [MediaInline] -#FIXME: Taggable admin is broken. -#class FragmentAdmin(TaggableModelAdmin): class FragmentAdmin(admin.ModelAdmin): - #tag_model = Tag - list_display = ('book', 'anchor',) ordering = ('book', 'anchor',) diff --git a/src/catalogue/api/helpers.py b/src/catalogue/api/helpers.py index d872dde17..6813e03d4 100644 --- a/src/catalogue/api/helpers.py +++ b/src/catalogue/api/helpers.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db.models import Q from catalogue.models import Book diff --git a/src/catalogue/api/urls.py b/src/catalogue/api/urls.py index d70338a53..0f2343df9 100644 --- a/src/catalogue/api/urls.py +++ b/src/catalogue/api/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/catalogue/apps.py b/src/catalogue/apps.py index 5dbc8b37a..36c6b8419 100644 --- a/src/catalogue/apps.py +++ b/src/catalogue/apps.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/catalogue/constants.py b/src/catalogue/constants.py index 1a655f428..2a00ac247 100644 --- a/src/catalogue/constants.py +++ b/src/catalogue/constants.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/catalogue/feeds.py b/src/catalogue/feeds.py index 82b0a75fd..d33b79963 100644 --- a/src/catalogue/feeds.py +++ b/src/catalogue/feeds.py @@ -58,11 +58,11 @@ class AudiobookFeed(Feed): extra_info = item.get_extra_info_json() artist = extra_info.get('artist_name', None) if artist is not None: - lines.append(u'Czyta: %s' % artist) + lines.append('Czyta: %s' % artist) director = extra_info.get('director_name', None) if director is not None: - lines.append(u'Reżyseria: %s' % director) - return u'
    \n'.join(lines) + lines.append('Reżyseria: %s' % director) + return '
    \n'.join(lines) def item_link(self, item): return item.book.get_absolute_url() diff --git a/src/catalogue/fields.py b/src/catalogue/fields.py index 8f6bc7aa4..46cde2379 100644 --- a/src/catalogue/fields.py +++ b/src/catalogue/fields.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/catalogue/forms.py b/src/catalogue/forms.py index 94df6cdd9..53d69c15f 100644 --- a/src/catalogue/forms.py +++ b/src/catalogue/forms.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/catalogue/helpers.py b/src/catalogue/helpers.py index 0330e692c..796ed0483 100644 --- a/src/catalogue/helpers.py +++ b/src/catalogue/helpers.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/catalogue/import_utils.py b/src/catalogue/import_utils.py index 65b71167f..587e05be3 100644 --- a/src/catalogue/import_utils.py +++ b/src/catalogue/import_utils.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/catalogue/management/commands/load_abstracts.py b/src/catalogue/management/commands/load_abstracts.py index 19ff8c437..587f9436b 100644 --- a/src/catalogue/management/commands/load_abstracts.py +++ b/src/catalogue/management/commands/load_abstracts.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/catalogue/management/commands/update_popularity.py b/src/catalogue/management/commands/update_popularity.py index df9dedf49..d2af0d4e9 100644 --- a/src/catalogue/management/commands/update_popularity.py +++ b/src/catalogue/management/commands/update_popularity.py @@ -1,9 +1,6 @@ -# -*- 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. # -from __future__ import print_function, unicode_literals - from django.core.management.base import BaseCommand from django.db.models import Count diff --git a/src/catalogue/management/commands/update_preview_status.py b/src/catalogue/management/commands/update_preview_status.py index cd2e8d8f2..dc3631efa 100644 --- a/src/catalogue/management/commands/update_preview_status.py +++ b/src/catalogue/management/commands/update_preview_status.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/catalogue/migrations/0001_initial.py b/src/catalogue/migrations/0001_initial.py index 3acfad969..ac8f9d738 100644 --- a/src/catalogue/migrations/0001_initial.py +++ b/src/catalogue/migrations/0001_initial.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations import django.db.models.deletion import fnpdjango.storage diff --git a/src/catalogue/migrations/0002_book_ancestor.py b/src/catalogue/migrations/0002_book_ancestor.py index 114a6c2a3..49dd6f08c 100644 --- a/src/catalogue/migrations/0002_book_ancestor.py +++ b/src/catalogue/migrations/0002_book_ancestor.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations diff --git a/src/catalogue/migrations/0003_populate_ancestors.py b/src/catalogue/migrations/0003_populate_ancestors.py index b6117570b..c36aee1d4 100644 --- a/src/catalogue/migrations/0003_populate_ancestors.py +++ b/src/catalogue/migrations/0003_populate_ancestors.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations diff --git a/src/catalogue/migrations/0004_remove_booktags_count_related_info.py b/src/catalogue/migrations/0004_remove_booktags_count_related_info.py index 48c936fff..e474f1b24 100644 --- a/src/catalogue/migrations/0004_remove_booktags_count_related_info.py +++ b/src/catalogue/migrations/0004_remove_booktags_count_related_info.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations diff --git a/src/catalogue/migrations/0005_auto_20141016_1337.py b/src/catalogue/migrations/0005_auto_20141016_1337.py index 6de315722..202e51921 100644 --- a/src/catalogue/migrations/0005_auto_20141016_1337.py +++ b/src/catalogue/migrations/0005_auto_20141016_1337.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations diff --git a/src/catalogue/migrations/0006_auto_20141022_1059.py b/src/catalogue/migrations/0006_auto_20141022_1059.py index f36eb0742..7f12f6d20 100644 --- a/src/catalogue/migrations/0006_auto_20141022_1059.py +++ b/src/catalogue/migrations/0006_auto_20141022_1059.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations diff --git a/src/catalogue/migrations/0007_auto_20151123_1529.py b/src/catalogue/migrations/0007_auto_20151123_1529.py index 86afa9889..3bd9b9cc8 100644 --- a/src/catalogue/migrations/0007_auto_20151123_1529.py +++ b/src/catalogue/migrations/0007_auto_20151123_1529.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations diff --git a/src/catalogue/migrations/0008_auto_20151221_1225.py b/src/catalogue/migrations/0008_auto_20151221_1225.py index d8e9af1cf..04e79c38e 100644 --- a/src/catalogue/migrations/0008_auto_20151221_1225.py +++ b/src/catalogue/migrations/0008_auto_20151221_1225.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models import catalogue.fields import catalogue.models.bookmedia diff --git a/src/catalogue/migrations/0009_auto_20160127_1019.py b/src/catalogue/migrations/0009_auto_20160127_1019.py index eebb58bb1..9def7ad28 100644 --- a/src/catalogue/migrations/0009_auto_20160127_1019.py +++ b/src/catalogue/migrations/0009_auto_20160127_1019.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models from sortify import sortify diff --git a/src/catalogue/migrations/0010_bookpopularity.py b/src/catalogue/migrations/0010_bookpopularity.py index 608af9ce1..81834f932 100644 --- a/src/catalogue/migrations/0010_bookpopularity.py +++ b/src/catalogue/migrations/0010_bookpopularity.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models import django.db.models.deletion diff --git a/src/catalogue/migrations/0011_auto_20160413_1152.py b/src/catalogue/migrations/0011_auto_20160413_1152.py index b344660cd..43ac38532 100644 --- a/src/catalogue/migrations/0011_auto_20160413_1152.py +++ b/src/catalogue/migrations/0011_auto_20160413_1152.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/catalogue/migrations/0012_auto_20161020_1407.py b/src/catalogue/migrations/0012_auto_20161020_1407.py index 4ce2c19a7..34c700ce2 100644 --- a/src/catalogue/migrations/0012_auto_20161020_1407.py +++ b/src/catalogue/migrations/0012_auto_20161020_1407.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/catalogue/migrations/0013_book_print_on_demand.py b/src/catalogue/migrations/0013_book_print_on_demand.py index c2ceaeadf..d6addf77b 100644 --- a/src/catalogue/migrations/0013_book_print_on_demand.py +++ b/src/catalogue/migrations/0013_book_print_on_demand.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/catalogue/migrations/0014_auto_20170627_1442.py b/src/catalogue/migrations/0014_auto_20170627_1442.py index 5a95bba7e..0affd0a19 100644 --- a/src/catalogue/migrations/0014_auto_20170627_1442.py +++ b/src/catalogue/migrations/0014_auto_20170627_1442.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models import catalogue.fields import catalogue.models.bookmedia diff --git a/src/catalogue/migrations/0015_book_recommended.py b/src/catalogue/migrations/0015_book_recommended.py index 6e04500cd..d92d45884 100644 --- a/src/catalogue/migrations/0015_book_recommended.py +++ b/src/catalogue/migrations/0015_book_recommended.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/catalogue/migrations/0016_auto_20171031_1232.py b/src/catalogue/migrations/0016_auto_20171031_1232.py index f606c13d9..8e0080e50 100644 --- a/src/catalogue/migrations/0016_auto_20171031_1232.py +++ b/src/catalogue/migrations/0016_auto_20171031_1232.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/catalogue/migrations/0017_auto_20171214_1746.py b/src/catalogue/migrations/0017_auto_20171214_1746.py index 9095cb0ec..0d5b36e40 100644 --- a/src/catalogue/migrations/0017_auto_20171214_1746.py +++ b/src/catalogue/migrations/0017_auto_20171214_1746.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/catalogue/migrations/0018_auto_20171221_1106.py b/src/catalogue/migrations/0018_auto_20171221_1106.py index 581f109aa..9a2aee3c9 100644 --- a/src/catalogue/migrations/0018_auto_20171221_1106.py +++ b/src/catalogue/migrations/0018_auto_20171221_1106.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/catalogue/migrations/0019_auto_20171221_1107.py b/src/catalogue/migrations/0019_auto_20171221_1107.py index 751e707d8..17f7db110 100644 --- a/src/catalogue/migrations/0019_auto_20171221_1107.py +++ b/src/catalogue/migrations/0019_auto_20171221_1107.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/catalogue/migrations/0020_book_cover_api_thumb.py b/src/catalogue/migrations/0020_book_cover_api_thumb.py index 1b0960e9f..2d73807c7 100644 --- a/src/catalogue/migrations/0020_book_cover_api_thumb.py +++ b/src/catalogue/migrations/0020_book_cover_api_thumb.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models import catalogue.fields import catalogue.models.book diff --git a/src/catalogue/migrations/0021_auto_20171222_1404.py b/src/catalogue/migrations/0021_auto_20171222_1404.py index 8bf9a60dc..8f4e4f23a 100644 --- a/src/catalogue/migrations/0021_auto_20171222_1404.py +++ b/src/catalogue/migrations/0021_auto_20171222_1404.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models import catalogue.fields import catalogue.models.book diff --git a/src/catalogue/migrations/0022_auto_20180226_1503.py b/src/catalogue/migrations/0022_auto_20180226_1503.py index a673f42e3..fef3abb02 100644 --- a/src/catalogue/migrations/0022_auto_20180226_1503.py +++ b/src/catalogue/migrations/0022_auto_20180226_1503.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/catalogue/migrations/0023_book_abstract.py b/src/catalogue/migrations/0023_book_abstract.py index 6fed3562a..2959bd552 100644 --- a/src/catalogue/migrations/0023_book_abstract.py +++ b/src/catalogue/migrations/0023_book_abstract.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/catalogue/migrations/0024_auto_20180510_1407.py b/src/catalogue/migrations/0024_auto_20180510_1407.py index 819bf26ec..620723a2a 100644 --- a/src/catalogue/migrations/0024_auto_20180510_1407.py +++ b/src/catalogue/migrations/0024_auto_20180510_1407.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/catalogue/migrations/0024_book_audio_length.py b/src/catalogue/migrations/0024_book_audio_length.py index 89e38affa..6d2d87210 100644 --- a/src/catalogue/migrations/0024_book_audio_length.py +++ b/src/catalogue/migrations/0024_book_audio_length.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/catalogue/migrations/0025_merge.py b/src/catalogue/migrations/0025_merge.py index 66c8c8f4d..b43ede851 100644 --- a/src/catalogue/migrations/0025_merge.py +++ b/src/catalogue/migrations/0025_merge.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/catalogue/migrations/0026_book_preview_key.py b/src/catalogue/migrations/0026_book_preview_key.py index 9e0335af5..e5ab008ca 100644 --- a/src/catalogue/migrations/0026_book_preview_key.py +++ b/src/catalogue/migrations/0026_book_preview_key.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-06-26 08:33 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/catalogue/models/__init__.py b/src/catalogue/models/__init__.py index 7aebc3175..0881cb793 100644 --- a/src/catalogue/models/__init__.py +++ b/src/catalogue/models/__init__.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/catalogue/models/book.py b/src/catalogue/models/book.py index 033febf34..9116a4657 100644 --- a/src/catalogue/models/book.py +++ b/src/catalogue/models/book.py @@ -56,7 +56,7 @@ class Book(models.Model): title = models.CharField(_('title'), max_length=32767) sort_key = models.CharField(_('sort key'), max_length=120, db_index=True, editable=False) sort_key_author = models.CharField( - _('sort key by author'), max_length=120, db_index=True, editable=False, default=u'') + _('sort key by author'), max_length=120, db_index=True, editable=False, default='') slug = models.SlugField(_('slug'), max_length=120, db_index=True, unique=True) common_slug = models.SlugField(_('slug'), max_length=120, db_index=True) language = models.CharField(_('language code'), max_length=3, db_index=True, default=app_settings.DEFAULT_LANGUAGE) @@ -180,7 +180,7 @@ class Book(models.Model): others = ' i inni' else: others = '' - return ', '.join(u'\xa0'.join(reversed(translator.split(', ', 1))) for translator in translators) + others + return ', '.join('\xa0'.join(reversed(translator.split(', ', 1))) for translator in translators) + others def cover_source(self): return self.get_extra_info_json().get('cover_source', self.parent.cover_source() if self.parent else '') @@ -194,7 +194,7 @@ class Book(models.Model): try: author = self.authors().first().sort_key except AttributeError: - author = u'' + author = '' self.sort_key_author = author self.cached_author = self.tag_unicode('author') @@ -347,7 +347,7 @@ class Book(models.Model): project = meta.get('project') if not project: # temporary fallback - project = u'CzytamySłuchając' + project = 'CzytamySłuchając' projects.add((project, meta.get('funded_by', ''))) @@ -716,14 +716,14 @@ class Book(models.Model): return books_by_author, orphans, books_by_parent _audiences_pl = { - "SP": (1, u"szkoła podstawowa"), - "SP1": (1, u"szkoła podstawowa"), - "SP2": (1, u"szkoła podstawowa"), - "SP3": (1, u"szkoła podstawowa"), - "P": (1, u"szkoła podstawowa"), - "G": (2, u"gimnazjum"), - "L": (3, u"liceum"), - "LP": (3, u"liceum"), + "SP": (1, "szkoła podstawowa"), + "SP1": (1, "szkoła podstawowa"), + "SP2": (1, "szkoła podstawowa"), + "SP3": (1, "szkoła podstawowa"), + "P": (1, "szkoła podstawowa"), + "G": (2, "gimnazjum"), + "L": (3, "liceum"), + "LP": (3, "liceum"), } def audiences_pl(self): diff --git a/src/catalogue/models/source.py b/src/catalogue/models/source.py index 08cac0cce..77b1a677b 100644 --- a/src/catalogue/models/source.py +++ b/src/catalogue/models/source.py @@ -25,7 +25,7 @@ class Source(models.Model): str(self.pk) old_self = type(self).objects.get(pk=self) except type(self).DoesNotExist: - old_name = u'' + old_name = '' old_netloc = self.netloc else: old_name = old_self.name diff --git a/src/catalogue/models/tag.py b/src/catalogue/models/tag.py index db7267e1b..6aaa97c8e 100644 --- a/src/catalogue/models/tag.py +++ b/src/catalogue/models/tag.py @@ -43,9 +43,9 @@ class TagRelation(models.Model): def __str__(self): try: - return u'%s [%s]' % (self.content_type.get_object_for_this_type(pk=self.object_id), self.tag) + return '%s [%s]' % (self.content_type.get_object_for_this_type(pk=self.object_id), self.tag) except ObjectDoesNotExist: - return u' [%s]' % self.tag + return ' [%s]' % self.tag class Tag(models.Model): diff --git a/src/catalogue/tasks.py b/src/catalogue/tasks.py index a7b67aec9..781dd6e3c 100644 --- a/src/catalogue/tasks.py +++ b/src/catalogue/tasks.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/catalogue/templatetags/catalogue_tags.py b/src/catalogue/templatetags/catalogue_tags.py index 39f044a3a..69ff8d358 100644 --- a/src/catalogue/templatetags/catalogue_tags.py +++ b/src/catalogue/templatetags/catalogue_tags.py @@ -81,48 +81,48 @@ def title_from_tags(tags): self = split_tags(tags) - title = u'' + title = '' # Specjalny przypadek oglądania wszystkich lektur na danej półce if len(self) == 1 and 'set' in self: - return u'Półka %s' % self['set'] + return 'Półka %s' % self['set'] # Specjalny przypadek "Twórczość w pozytywizmie", wtedy gdy tylko epoka # jest wybrana przez użytkownika if 'epoch' in self and len(self) == 1: - text = u'Twórczość w %s' % flection.get_case(str(self['epoch']), u'miejscownik') + text = 'Twórczość w %s' % flection.get_case(str(self['epoch']), 'miejscownik') return capfirst(text) # Specjalny przypadek "Dramat w twórczości Sofoklesa", wtedy gdy podane # są tylko rodzaj literacki i autor if 'kind' in self and 'author' in self and len(self) == 2: - text = u'%s w twórczości %s' % ( - str(self['kind']), flection.get_case(str(self['author']), u'dopełniacz')) + text = '%s w twórczości %s' % ( + str(self['kind']), flection.get_case(str(self['author']), 'dopełniacz')) return capfirst(text) # Przypadki ogólniejsze if 'theme' in self: - title += u'Motyw %s' % str(self['theme']) + title += 'Motyw %s' % str(self['theme']) if 'genre' in self: if 'theme' in self: - title += u' w %s' % flection.get_case(str(self['genre']), u'miejscownik') + title += ' w %s' % flection.get_case(str(self['genre']), 'miejscownik') else: title += str(self['genre']) if 'kind' in self or 'author' in self or 'epoch' in self: if 'genre' in self or 'theme' in self: if 'kind' in self: - title += u' w %s ' % flection.get_case(str(self['kind']), u'miejscownik') + title += ' w %s ' % flection.get_case(str(self['kind']), 'miejscownik') else: - title += u' w twórczości ' + title += ' w twórczości ' else: - title += u'%s ' % str(self.get('kind', u'twórczość')) + title += '%s ' % str(self.get('kind', 'twórczość')) if 'author' in self: - title += flection.get_case(str(self['author']), u'dopełniacz') + title += flection.get_case(str(self['author']), 'dopełniacz') elif 'epoch' in self: - title += flection.get_case(str(self['epoch']), u'dopełniacz') + title += flection.get_case(str(self['epoch']), 'dopełniacz') return capfirst(title) diff --git a/src/catalogue/test_utils.py b/src/catalogue/test_utils.py index ad3e49199..a6e69db74 100644 --- a/src/catalogue/test_utils.py +++ b/src/catalogue/test_utils.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -73,11 +72,11 @@ def info_args(title, language=None): """ generate some keywords for comfortable BookInfoCreation """ slug = str(slugify(title)) if language is None: - language = u'pol' + language = 'pol' return { 'title': str(title), 'url': WLURI.from_slug(slug), - 'about': u"http://wolnelektury.pl/example/URI/%s" % slug, + 'about': "http://wolnelektury.pl/example/URI/%s" % slug, 'language': language, } diff --git a/src/catalogue/tests/test_book_import.py b/src/catalogue/tests/test_book_import.py index 9fdb29889..d3699249a 100644 --- a/src/catalogue/tests/test_book_import.py +++ b/src/catalogue/tests/test_book_import.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -15,14 +14,14 @@ class BookImportLogicTests(WLTestCase): def setUp(self): WLTestCase.setUp(self) self.book_info = BookInfoStub( - url=WLURI.from_slug(u"default-book"), - about=u"http://wolnelektury.pl/example/URI/default_book", - title=u"Default Book", + url=WLURI.from_slug("default-book"), + about="http://wolnelektury.pl/example/URI/default_book", + title="Default Book", author=PersonStub(("Jim",), "Lazy"), kind="X-Kind", genre="X-Genre", epoch="X-Epoch", - language=u"pol", + language="pol", ) self.expected_tags = [ @@ -84,7 +83,7 @@ class BookImportLogicTests(WLTestCase): self.assertTrue(book.has_html_file()) self.assertEqual(book.fragments.count(), 1) - self.assertEqual(book.fragments.all()[0].text, u'

    Ala ma kota

    \n') + self.assertEqual(book.fragments.all()[0].text, '

    Ala ma kota

    \n') self.assert_(('theme', 'love') in [(tag.category, tag.slug) for tag in book.fragments.all()[0].tags]) @@ -116,7 +115,7 @@ class BookImportLogicTests(WLTestCase): def test_book_with_invalid_slug(self): """ Book with invalid characters in slug shouldn't be imported """ - self.book_info.url = WLURI.from_slug(u"default_book") + self.book_info.url = WLURI.from_slug("default_book") book_text = "" with self.assertRaises(ValueError): models.Book.from_text_and_meta(ContentFile(book_text), self.book_info) @@ -124,7 +123,7 @@ class BookImportLogicTests(WLTestCase): def test_book_replace_title(self): book_text = """""" models.Book.from_text_and_meta(ContentFile(book_text), self.book_info) - self.book_info.title = u"Extraordinary" + self.book_info.title = "Extraordinary" book = models.Book.from_text_and_meta(ContentFile(book_text), self.book_info, overwrite=True) tags = [(tag.category, tag.slug) for tag in book.tags] @@ -290,14 +289,14 @@ class TreeImportTest(WLTestCase): self.assertEqual( list(self.client.get('/katalog/gatunek/x-genre/').context['object_list']), [self.parent], - u"There should be only parent on common tag page." + "There should be only parent on common tag page." ) # pies = models.Tag.objects.get(slug='pies') themes = self.parent.related_themes() - self.assertEqual(len(themes), 1, u"There should be child theme in parent theme counter.") + self.assertEqual(len(themes), 1, "There should be child theme in parent theme counter.") # TODO: book_count is deprecated, update here. # epoch = models.Tag.objects.get(slug='x-epoch') - # self.assertEqual(epoch.book_count, 1, u"There should be only parent in common tag's counter.") + # self.assertEqual(epoch.book_count, 1, "There should be only parent in common tag's counter.") def test_child_republish(self): child_text = """ @@ -311,15 +310,15 @@ class TreeImportTest(WLTestCase): self.assertEqual( list(self.client.get('/katalog/gatunek/x-genre/').context['object_list']), [self.parent], - u"There should only be parent on common tag page." + "There should only be parent on common tag page." ) # pies = models.Tag.objects.get(slug='pies') # kot = models.Tag.objects.get(slug='kot') self.assertEqual(len(self.parent.related_themes()), 2, - u"There should be child themes in parent theme counter.") + "There should be child themes in parent theme counter.") # TODO: book_count is deprecated, update here. # epoch = models.Tag.objects.get(slug='x-epoch') - # self.assertEqual(epoch.book_count, 1, u"There should only be parent in common tag's counter.") + # self.assertEqual(epoch.book_count, 1, "There should only be parent in common tag's counter.") def test_book_change_child(self): second_child_info = BookInfoStub( @@ -346,24 +345,24 @@ class TreeImportTest(WLTestCase): self.assertEqual( set(self.client.get('/katalog/gatunek/x-genre/').context['object_list']), {self.parent, self.child}, - u"There should be parent and old child on common tag page." + "There should be parent and old child on common tag page." ) # kot = models.Tag.objects.get(slug='kot') self.assertEqual(len(self.parent.related_themes()), 1, - u"There should only be new child themes in parent theme counter.") + "There should only be new child themes in parent theme counter.") # # book_count deprecated, update test. # epoch = models.Tag.objects.get(slug='x-epoch') # self.assertEqual(epoch.book_count, 2, - # u"There should be parent and old child in common tag's counter.") + # "There should be parent and old child in common tag's counter.") self.assertEqual( list(self.client.get('/katalog/lektura/parent/motyw/kot/').context['fragments']), [second_child.fragments.all()[0]], - u"There should be new child's fragments on parent's theme page." + "There should be new child's fragments on parent's theme page." ) self.assertEqual( list(self.client.get('/katalog/lektura/parent/motyw/pies/').context['fragments']), [], - u"There should be no old child's fragments on parent's theme page." + "There should be no old child's fragments on parent's theme page." ) @@ -378,7 +377,7 @@ class MultilingualBookImportTest(WLTestCase): kind='X-Kind', author=PersonStub(("Joe",), "Doe"), variant_of=common_uri, - **info_args(u"Książka") + **info_args("Książka") ) self.eng_info = BookInfoStub( diff --git a/src/catalogue/tests/test_bookmedia.py b/src/catalogue/tests/test_bookmedia.py index b744f963f..6bc6aa32c 100644 --- a/src/catalogue/tests/test_bookmedia.py +++ b/src/catalogue/tests/test_bookmedia.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -24,7 +23,7 @@ class BookMediaTests(WLTestCase): self.book.save() def test_diacritics(self): - bm = models.BookMedia(book=self.book, type="ogg", name=u"Zażółć gęślą jaźń") + bm = models.BookMedia(book=self.book, type="ogg", name="Zażółć gęślą jaźń") self.set_title(bm.name) bm.file.save(None, self.file) self.assertEqual(basename(bm.file.name), 'zazolc-gesla-jazn.ogg') @@ -59,10 +58,10 @@ class BookMediaTests(WLTestCase): File save doesn't clobber some other media with similar name. """ - bm = models.BookMedia(book=self.book, type='ogg', name=u"Tytul") + bm = models.BookMedia(book=self.book, type='ogg', name="Tytul") self.set_title(bm.name) bm.file.save(None, self.file) - bm2 = models.BookMedia(book=self.book, type='ogg', name=u"Tytuł") + bm2 = models.BookMedia(book=self.book, type='ogg', name="Tytuł") self.set_title(bm2.name) bm2.file.save(None, self.file2) self.assertEqual(basename(bm.file.name), 'tytul.ogg') diff --git a/src/catalogue/tests/test_cover.py b/src/catalogue/tests/test_cover.py index 59a05edc9..9b2b01126 100644 --- a/src/catalogue/tests/test_cover.py +++ b/src/catalogue/tests/test_cover.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/catalogue/tests/test_tags.py b/src/catalogue/tests/test_tags.py index 771778246..29acd4aa1 100644 --- a/src/catalogue/tests/test_tags.py +++ b/src/catalogue/tests/test_tags.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -78,15 +77,15 @@ class TagRelatedTagsTests(WLTestCase): author = PersonStub(("Common",), "Man") gchild_info = BookInfoStub(author=author, genre="GchildGenre", epoch='Epoch', kind="Kind", - **info_args(u"GChild")) + **info_args("GChild")) child1_info = BookInfoStub(author=author, genre="ChildGenre", epoch='Epoch', kind="ChildKind", parts=[gchild_info.url], - **info_args(u"Child1")) + **info_args("Child1")) child2_info = BookInfoStub(author=author, genre="ChildGenre", epoch='Epoch', kind="ChildKind", - **info_args(u"Child2")) + **info_args("Child2")) parent_info = BookInfoStub(author=author, genre="Genre", epoch='Epoch', kind="Kind", parts=[child1_info.url, child2_info.url], - **info_args(u"Parent")) + **info_args("Parent")) for info in gchild_info, child1_info, child2_info, parent_info: book_text = """ @@ -183,7 +182,7 @@ class CleanTagRelationTests(WLTestCase): WLTestCase.setUp(self) author = PersonStub(("Common",), "Man") - book_info = BookInfoStub(author=author, genre="G", epoch='E', kind="K", **info_args(u"Book")) + book_info = BookInfoStub(author=author, genre="G", epoch='E', kind="K", **info_args("Book")) book_text = """ ThemeAla ma kota @@ -220,7 +219,7 @@ class TestIdenticalTag(WLTestCase): WLTestCase.setUp(self) author = PersonStub((), "Tag") - self.book_info = BookInfoStub(author=author, genre="tag", epoch='tag', kind="tag", **info_args(u"tag")) + self.book_info = BookInfoStub(author=author, genre="tag", epoch='tag', kind="tag", **info_args("tag")) self.book_text = """ @@ -263,10 +262,10 @@ class BookTagsTests(WLTestCase): author2 = PersonStub(("Jim",), "Lazy") child_info = BookInfoStub(authors=(author1, author2), genre="ChildGenre", epoch='Epoch', kind="ChildKind", - **info_args(u"Child")) + **info_args("Child")) parent_info = BookInfoStub(author=author1, genre="Genre", epoch='Epoch', kind="Kind", parts=[child_info.url], - **info_args(u"Parent")) + **info_args("Parent")) for info in child_info, parent_info: book_text = """ diff --git a/src/catalogue/tests/test_templatetags.py b/src/catalogue/tests/test_templatetags.py index c69472fac..a53897692 100644 --- a/src/catalogue/tests/test_templatetags.py +++ b/src/catalogue/tests/test_templatetags.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -16,10 +15,10 @@ class BookDescTests(WLTestCase): authors = PersonStub(("Common",), "Man"), PersonStub(("Jane",), "Doe") child_info = BookInfoStub(authors=authors, genre="Genre", epoch='Epoch', kind="Kind", - **info_args(u"Child")) + **info_args("Child")) parent_info = BookInfoStub(authors=authors, genre="Genre", epoch='Epoch', kind="Kind", parts=[child_info.url], - **info_args(u"Parent")) + **info_args("Parent")) self.child = models.Book.from_text_and_meta(ContentFile(''), child_info) models.Book.from_text_and_meta(ContentFile(''), parent_info) diff --git a/src/catalogue/tests/test_visit.py b/src/catalogue/tests/test_visit.py index 29011fa38..83d5e0bdc 100644 --- a/src/catalogue/tests/test_visit.py +++ b/src/catalogue/tests/test_visit.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -14,7 +13,7 @@ class VisitTest(WLTestCase): WLTestCase.setUp(self) author = PersonStub(("Jane",), "Doe") book_info = BookInfoStub(author=author, genre="Sielanka", - epoch='Epoch', kind="Kind", **info_args(u"A book")) + epoch='Epoch', kind="Kind", **info_args("A book")) self.book = models.Book.from_text_and_meta(ContentFile(''' diff --git a/src/catalogue/urls.py b/src/catalogue/urls.py index 0fc51a6b5..ac551b99c 100644 --- a/src/catalogue/urls.py +++ b/src/catalogue/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/catalogue/utils.py b/src/catalogue/utils.py index ec938eabb..7f337418b 100644 --- a/src/catalogue/utils.py +++ b/src/catalogue/utils.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -249,7 +248,7 @@ def truncate_html_words(s, num, end_text='...'): s = force_text(s) length = int(num) if length <= 0: - return u'' + return '' html4_singlets = ('br', 'col', 'link', 'base', 'img', 'param', 'area', 'hr', 'input') # Set up regular expressions re_words = re.compile(r'&.*?;|<.*?>|(\w[\w-]*)', re.U) diff --git a/src/chunks/admin.py b/src/chunks/admin.py index 6da19ec2b..38ac2b284 100644 --- a/src/chunks/admin.py +++ b/src/chunks/admin.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/chunks/migrations/0001_initial.py b/src/chunks/migrations/0001_initial.py index 94ed3dae6..cf0ccccc8 100644 --- a/src/chunks/migrations/0001_initial.py +++ b/src/chunks/migrations/0001_initial.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations diff --git a/src/chunks/migrations/0002_auto_20140911_1253.py b/src/chunks/migrations/0002_auto_20140911_1253.py index 09d541cd4..baeec0670 100644 --- a/src/chunks/migrations/0002_auto_20140911_1253.py +++ b/src/chunks/migrations/0002_auto_20140911_1253.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations diff --git a/src/chunks/migrations/0003_auto_20151221_1225.py b/src/chunks/migrations/0003_auto_20151221_1225.py index a7d7ca33b..fd1c0bb97 100644 --- a/src/chunks/migrations/0003_auto_20151221_1225.py +++ b/src/chunks/migrations/0003_auto_20151221_1225.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/chunks/templatetags/chunks.py b/src/chunks/templatetags/chunks.py index 200002b8e..e86288ef7 100644 --- a/src/chunks/templatetags/chunks.py +++ b/src/chunks/templatetags/chunks.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django import template from django.core.cache import cache from django.utils.safestring import mark_safe diff --git a/src/chunks/translation.py b/src/chunks/translation.py index 1b7e83028..4338699ae 100644 --- a/src/chunks/translation.py +++ b/src/chunks/translation.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/club/admin.py b/src/club/admin.py index 85b85201f..64218f169 100644 --- a/src/club/admin.py +++ b/src/club/admin.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.contrib import admin from modeltranslation.admin import TranslationAdmin from . import models diff --git a/src/club/apps.py b/src/club/apps.py index ee2584957..84813598a 100644 --- a/src/club/apps.py +++ b/src/club/apps.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.apps import AppConfig class ClubConfig(AppConfig): diff --git a/src/club/forms.py b/src/club/forms.py index b818d1c12..1906bc9fe 100644 --- a/src/club/forms.py +++ b/src/club/forms.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from decimal import Decimal from django import forms from . import models diff --git a/src/club/helpers.py b/src/club/helpers.py index 4ece5f9ab..b4ef0dd7d 100644 --- a/src/club/helpers.py +++ b/src/club/helpers.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.utils.timezone import now from .models import Schedule diff --git a/src/club/management/commands/prolong.py b/src/club/management/commands/prolong.py index 9bc5e68cb..3c8b36cb1 100644 --- a/src/club/management/commands/prolong.py +++ b/src/club/management/commands/prolong.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from datetime import timedelta from django.core.management.base import BaseCommand, CommandError from django.utils.timezone import now diff --git a/src/club/migrations/0001_initial.py b/src/club/migrations/0001_initial.py index 3480e3f14..1dbbcc136 100644 --- a/src/club/migrations/0001_initial.py +++ b/src/club/migrations/0001_initial.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-03-04 20:50 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.conf import settings from django.db import migrations, models import django.db.models.deletion diff --git a/src/club/migrations/0002_auto_20190416_1024.py b/src/club/migrations/0002_auto_20190416_1024.py index 9c876ad2a..2e5ba7eaf 100644 --- a/src/club/migrations/0002_auto_20190416_1024.py +++ b/src/club/migrations/0002_auto_20190416_1024.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-04-16 08:24 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models import django.db.models.deletion diff --git a/src/club/migrations/0003_remove_payuorder_amount.py b/src/club/migrations/0003_remove_payuorder_amount.py index 0b3996401..3adcf2ae0 100644 --- a/src/club/migrations/0003_remove_payuorder_amount.py +++ b/src/club/migrations/0003_remove_payuorder_amount.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-04-16 08:45 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations diff --git a/src/club/migrations/0004_payucardtoken_pos_id.py b/src/club/migrations/0004_payucardtoken_pos_id.py index f432a0a2e..6d4018358 100644 --- a/src/club/migrations/0004_payucardtoken_pos_id.py +++ b/src/club/migrations/0004_payucardtoken_pos_id.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-04-16 08:50 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/club/migrations/0005_auto_20190416_1052.py b/src/club/migrations/0005_auto_20190416_1052.py index 111e93ce0..19c5c7fe8 100644 --- a/src/club/migrations/0005_auto_20190416_1052.py +++ b/src/club/migrations/0005_auto_20190416_1052.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-04-16 08:52 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/club/migrations/0006_auto_20190416_1236.py b/src/club/migrations/0006_auto_20190416_1236.py index c5eaca569..817a9bf3a 100644 --- a/src/club/migrations/0006_auto_20190416_1236.py +++ b/src/club/migrations/0006_auto_20190416_1236.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-04-16 10:36 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations diff --git a/src/club/migrations/0007_auto_20190416_1625.py b/src/club/migrations/0007_auto_20190416_1625.py index 9730d441e..97ead12d5 100644 --- a/src/club/migrations/0007_auto_20190416_1625.py +++ b/src/club/migrations/0007_auto_20190416_1625.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-04-16 14:25 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models import django.db.models.deletion diff --git a/src/club/migrations/0008_membership_name.py b/src/club/migrations/0008_membership_name.py index ce30b25a1..1e8bc9ffa 100644 --- a/src/club/migrations/0008_membership_name.py +++ b/src/club/migrations/0008_membership_name.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-04-17 13:39 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/club/migrations/0009_auto_20190510_1510.py b/src/club/migrations/0009_auto_20190510_1510.py index 57a110fa1..a823e64bc 100644 --- a/src/club/migrations/0009_auto_20190510_1510.py +++ b/src/club/migrations/0009_auto_20190510_1510.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-05-10 13:10 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/club/migrations/0010_auto_20190529_0946.py b/src/club/migrations/0010_auto_20190529_0946.py index 77f13dea4..ca5ee4d33 100644 --- a/src/club/migrations/0010_auto_20190529_0946.py +++ b/src/club/migrations/0010_auto_20190529_0946.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-05-29 07:46 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/club/models.py b/src/club/models.py index 1f47d587b..c49b888f4 100644 --- a/src/club/models.py +++ b/src/club/models.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from datetime import datetime, timedelta from django.conf import settings from django.contrib.sites.models import Site @@ -126,7 +129,7 @@ class Membership(models.Model): verbose_name_plural = _('memberships') def __str__(self): - return u'tow. ' + str(self.user) + return str(self.user) @classmethod def is_active_for(cls, user): diff --git a/src/club/payment_methods.py b/src/club/payment_methods.py index a71a67b9a..99694ef47 100644 --- a/src/club/payment_methods.py +++ b/src/club/payment_methods.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.conf import settings from django.urls import reverse diff --git a/src/club/payu/__init__.py b/src/club/payu/__init__.py index b59b58ef4..e5bfbdb0d 100644 --- a/src/club/payu/__init__.py +++ b/src/club/payu/__init__.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.conf import settings from .pos import POS diff --git a/src/club/payu/forms.py b/src/club/payu/forms.py index 24c24a0ad..bdcdf566d 100644 --- a/src/club/payu/forms.py +++ b/src/club/payu/forms.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django import forms diff --git a/src/club/payu/models.py b/src/club/payu/models.py index 4fe4d94a5..1cd689dde 100644 --- a/src/club/payu/models.py +++ b/src/club/payu/models.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import json from urllib.parse import urlencode from urllib.request import HTTPError diff --git a/src/club/payu/pos.py b/src/club/payu/pos.py index c9dca99e7..db03d4334 100644 --- a/src/club/payu/pos.py +++ b/src/club/payu/pos.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import requests diff --git a/src/club/payu/tests/integration.py b/src/club/payu/tests/integration.py index 3619b9083..3cef8ae41 100644 --- a/src/club/payu/tests/integration.py +++ b/src/club/payu/tests/integration.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.contrib.staticfiles.testing import StaticLiveServerTestCase from selenium.webdriver.firefox.webdriver import WebDriver diff --git a/src/club/payu/tests/tests.py b/src/club/payu/tests/tests.py deleted file mode 100644 index bcfd95158..000000000 --- a/src/club/payu/tests/tests.py +++ /dev/null @@ -1,17 +0,0 @@ -# 1. idziemy do płatności, wyświetlamy widget, klikamy w wydżet - -# (pierwsza płatność) OrderCreateRequest z tokenem jednorazowym -# < możliwa odpowiedź: WARNING_CONTINUE_3DS ([status]status_co -# < token wielorazowy -# < błąd http -# < nieczytelna odpowiedź - -# OrderCreateRequest z tokenem wielorazowym - - - -# integration tests: - -# (run on payu sandbox) -# open browser, display widget, input data, run widget, fetch token -# diff --git a/src/club/payu/views.py b/src/club/payu/views.py index f84bf7656..3f06b3773 100644 --- a/src/club/payu/views.py +++ b/src/club/payu/views.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from hashlib import md5, sha256 from django.conf import settings from django import http diff --git a/src/club/permissions.py b/src/club/permissions.py index a08880db1..646df6c83 100644 --- a/src/club/permissions.py +++ b/src/club/permissions.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from rest_framework.permissions import BasePermission from .models import Membership diff --git a/src/club/templatetags/club.py b/src/club/templatetags/club.py index 1a3416971..65dcd6847 100644 --- a/src/club/templatetags/club.py +++ b/src/club/templatetags/club.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django import template from ..helpers import get_active_schedule diff --git a/src/club/translation.py b/src/club/translation.py index 38772a70b..cb8d02c9b 100644 --- a/src/club/translation.py +++ b/src/club/translation.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/club/urls.py b/src/club/urls.py index 844359b9c..3e0391b40 100644 --- a/src/club/urls.py +++ b/src/club/urls.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.conf.urls import url from . import views diff --git a/src/club/views.py b/src/club/views.py index e80acaa94..e469345fc 100644 --- a/src/club/views.py +++ b/src/club/views.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.conf import settings from django.contrib.auth.decorators import login_required from django.http import HttpResponseRedirect diff --git a/src/contact/__init__.py b/src/contact/__init__.py index 3bce2e392..bbf0f3d80 100644 --- a/src/contact/__init__.py +++ b/src/contact/__init__.py @@ -1,4 +1,6 @@ -# -*- 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. +# """ Generic app for creating contact forms. diff --git a/src/contact/admin.py b/src/contact/admin.py index 32d12ec27..cf8d06cd0 100644 --- a/src/contact/admin.py +++ b/src/contact/admin.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import csv import json @@ -19,8 +22,7 @@ class ContactAdminMeta(admin.ModelAdmin.__class__): raise AttributeError(name) -class ContactAdmin(admin.ModelAdmin): - __metaclass__ = ContactAdminMeta +class ContactAdmin(admin.ModelAdmin, metaclass=ContactAdminMeta): date_hierarchy = 'created_at' list_display = ['created_at', 'contact', 'form_tag'] + \ ["admin_list_%d" % i for i in range(admin_list_width)] diff --git a/src/contact/fields.py b/src/contact/fields.py index c2c97b307..578776aa7 100644 --- a/src/contact/fields.py +++ b/src/contact/fields.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/contact/forms.py b/src/contact/forms.py index ee44e4b19..ecdc47d54 100644 --- a/src/contact/forms.py +++ b/src/contact/forms.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import json from django.contrib.sites.models import Site from django.core.exceptions import ValidationError @@ -26,9 +29,8 @@ class ContactFormMeta(forms.Form.__class__): return model -class ContactForm(forms.Form): +class ContactForm(forms.Form, metaclass=ContactFormMeta): """Subclass and define some fields.""" - __metaclass__ = ContactFormMeta form_tag = None form_title = _('Contact form') diff --git a/src/contact/mailing.py b/src/contact/mailing.py index baacf3def..4dee9c5a7 100644 --- a/src/contact/mailing.py +++ b/src/contact/mailing.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from hashlib import md5 from django.conf import settings diff --git a/src/contact/migrations/0001_initial.py b/src/contact/migrations/0001_initial.py index 682a097b6..08f688fc9 100644 --- a/src/contact/migrations/0001_initial.py +++ b/src/contact/migrations/0001_initial.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models import django.db.models.deletion diff --git a/src/contact/models.py b/src/contact/models.py index b173b4d21..929106eaa 100644 --- a/src/contact/models.py +++ b/src/contact/models.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import json import yaml from hashlib import sha1 @@ -20,7 +23,7 @@ class Contact(models.Model): if type(value) in (tuple, list, dict): value = yaml.safe_dump(value, allow_unicode=True, default_flow_style=False) if for_html: - value = smart_text(value).replace(u" ", unichr(160)) + value = smart_text(value).replace(" ", unichr(160)) return value class Meta: diff --git a/src/contact/templatetags/contact_tags.py b/src/contact/templatetags/contact_tags.py index aadba16e1..4e07846f4 100755 --- a/src/contact/templatetags/contact_tags.py +++ b/src/contact/templatetags/contact_tags.py @@ -1,4 +1,6 @@ -# -*- 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. +# from django.template import Library from contact.models import Contact diff --git a/src/contact/urls.py b/src/contact/urls.py index c475cd429..9fbce2fce 100644 --- a/src/contact/urls.py +++ b/src/contact/urls.py @@ -1,4 +1,6 @@ -# -*- 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. +# from django.conf.urls import url from . import views diff --git a/src/contact/views.py b/src/contact/views.py index 0f8aad9a5..6f6205204 100644 --- a/src/contact/views.py +++ b/src/contact/views.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from urllib.parse import unquote from datetime import datetime diff --git a/src/contact/widgets.py b/src/contact/widgets.py index 62a4976d5..fd2a49e36 100644 --- a/src/contact/widgets.py +++ b/src/contact/widgets.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -8,6 +7,6 @@ from django.utils.html import format_html class HeaderWidget(forms.widgets.Widget): - def render(self, name, value, attrs=None): + def render(self, name, value, attrs=None, renderer=None): attrs.update(self.attrs) return format_html('', flatatt(attrs)) diff --git a/src/dictionary/constants.py b/src/dictionary/constants.py index e99dc3ff0..51fc67b11 100644 --- a/src/dictionary/constants.py +++ b/src/dictionary/constants.py @@ -1,9 +1,6 @@ -# -*- 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. # -from __future__ import unicode_literals - from django.utils.translation import ugettext_lazy as _ diff --git a/src/dictionary/migrations/0001_initial.py b/src/dictionary/migrations/0001_initial.py index 60ea4b684..58fb7aaf3 100644 --- a/src/dictionary/migrations/0001_initial.py +++ b/src/dictionary/migrations/0001_initial.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations import django.db.models.deletion diff --git a/src/dictionary/migrations/0002_auto_20141006_1422.py b/src/dictionary/migrations/0002_auto_20141006_1422.py index f51e83f00..d763e9a49 100644 --- a/src/dictionary/migrations/0002_auto_20141006_1422.py +++ b/src/dictionary/migrations/0002_auto_20141006_1422.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations import django.db.models.deletion diff --git a/src/dictionary/migrations/0003_auto_20141023_1445.py b/src/dictionary/migrations/0003_auto_20141023_1445.py index ee4beeebe..77aea8ade 100644 --- a/src/dictionary/migrations/0003_auto_20141023_1445.py +++ b/src/dictionary/migrations/0003_auto_20141023_1445.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations diff --git a/src/dictionary/migrations/0004_auto_20151221_1225.py b/src/dictionary/migrations/0004_auto_20151221_1225.py index ee7252ce0..c0a1454bd 100644 --- a/src/dictionary/migrations/0004_auto_20151221_1225.py +++ b/src/dictionary/migrations/0004_auto_20151221_1225.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/dictionary/templatetags/set_get.py b/src/dictionary/templatetags/set_get.py index 9afe3e87f..7baa5da8f 100644 --- a/src/dictionary/templatetags/set_get.py +++ b/src/dictionary/templatetags/set_get.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/dictionary/tests.py b/src/dictionary/tests.py index 6c48cee67..0b5924bb0 100755 --- a/src/dictionary/tests.py +++ b/src/dictionary/tests.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -16,7 +15,7 @@ class DictionaryTests(WLTestCase): kind="X-Kind", genre="X-Genre", epoch="X-Epoch", - **info_args(u"Default Book") + **info_args("Default Book") ) def test_book_with_footnote(self): diff --git a/src/dictionary/urls.py b/src/dictionary/urls.py index a5582a17a..2baf62852 100755 --- a/src/dictionary/urls.py +++ b/src/dictionary/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/dictionary/views.py b/src/dictionary/views.py index f9c103512..719568adf 100755 --- a/src/dictionary/views.py +++ b/src/dictionary/views.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/funding/__init__.py b/src/funding/__init__.py index 9e81e9ec3..d17c68d05 100644 --- a/src/funding/__init__.py +++ b/src/funding/__init__.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -8,7 +7,7 @@ from catalogue.utils import AppSettings class Settings(AppSettings): """Default settings for funding app.""" - DEFAULT_LANGUAGE = u'pl' + DEFAULT_LANGUAGE = 'pl' DEFAULT_AMOUNT = 20 MIN_AMOUNT = 1 DAYS_NEAR = 2 diff --git a/src/funding/admin.py b/src/funding/admin.py index 5f552c45d..a59704dbd 100644 --- a/src/funding/admin.py +++ b/src/funding/admin.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/funding/forms.py b/src/funding/forms.py index 1c8513549..915e2aa09 100644 --- a/src/funding/forms.py +++ b/src/funding/forms.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -26,7 +25,7 @@ class FundingForm(NewsletterForm): "and to send you updates about your payment and the fundraiser status (which you can always turn off).
    " "Your e-mail won't be publicised.")), required=False) - data_processing_part2 = u'''\ + data_processing_part2 = '''\ W przypadku podania danych zostaną one wykorzystane w sposób podany powyżej, a w przypadku wyrażenia dodatkowej zgody adres e-mail zostanie wykorzystany także w celu przesyłania newslettera Wolnych Lektur.''' diff --git a/src/funding/migrations/0001_initial.py b/src/funding/migrations/0001_initial.py index cd46551e6..6b511dadc 100644 --- a/src/funding/migrations/0001_initial.py +++ b/src/funding/migrations/0001_initial.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations import django.db.models.deletion diff --git a/src/funding/migrations/0002_auto_20151221_1225.py b/src/funding/migrations/0002_auto_20151221_1225.py index 3224eb006..a85ea1ba9 100644 --- a/src/funding/migrations/0002_auto_20151221_1225.py +++ b/src/funding/migrations/0002_auto_20151221_1225.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/funding/migrations/0003_auto_20180416_1336.py b/src/funding/migrations/0003_auto_20180416_1336.py index 94485d732..b368eef0f 100644 --- a/src/funding/migrations/0003_auto_20180416_1336.py +++ b/src/funding/migrations/0003_auto_20180416_1336.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/funding/migrations/0004_auto_20190729_1450.py b/src/funding/migrations/0004_auto_20190729_1450.py index 17822eed2..345c6f5e4 100644 --- a/src/funding/migrations/0004_auto_20190729_1450.py +++ b/src/funding/migrations/0004_auto_20190729_1450.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-07-29 12:50 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models import django.db.models.deletion diff --git a/src/funding/models.py b/src/funding/models.py index b439ebf94..79385a20d 100644 --- a/src/funding/models.py +++ b/src/funding/models.py @@ -38,7 +38,7 @@ class Offer(models.Model): notified_end = models.DateTimeField(_('End notifications sent'), blank=True, null=True) def cover_img_tag(self): - return u'' % self.cover.url + return '' % self.cover.url cover_img_tag.short_description = _('Cover preview') cover_img_tag.allow_tags = True @@ -48,7 +48,7 @@ class Offer(models.Model): ordering = ['-end'] def __str__(self): - return u"%s - %s" % (self.author, self.title) + return "%s - %s" % (self.author, self.title) def get_absolute_url(self): return reverse('funding_offer', args=[self.slug]) @@ -258,7 +258,7 @@ class Perk(models.Model): ordering = ['-price'] def __str__(self): - return "%s (%s%s)" % (self.name, self.price, u" for %s" % self.offer if self.offer else "") + return "%s (%s%s)" % (self.name, self.price, " for %s" % self.offer if self.offer else "") class Funding(models.Model): @@ -358,7 +358,7 @@ class Spent(models.Model): ordering = ['-timestamp'] def __str__(self): - return u"Spent: %s" % str(self.book) + return "Spent: %s" % str(self.book) @receiver(getpaid.signals.new_payment_query) diff --git a/src/funding/tests.py b/src/funding/tests.py index ccbf08f9b..d06280985 100644 --- a/src/funding/tests.py +++ b/src/funding/tests.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/funding/utils.py b/src/funding/utils.py index e93d8161d..afebd8a74 100644 --- a/src/funding/utils.py +++ b/src/funding/utils.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -12,7 +11,7 @@ from fnpdjango.utils.text import char_map sane_in_payu_title = re.escape( string.ascii_uppercase + string.ascii_lowercase + - u'ąćęłńóśźżĄĆĘŁŃÓŚŹŻ' + + 'ąćęłńóśźżĄĆĘŁŃÓŚŹŻ' + string.digits + ' ' + "".join(set(string.punctuation) - set('\\')) diff --git a/src/funding/widgets.py b/src/funding/widgets.py index f66cde341..3eacb136f 100644 --- a/src/funding/widgets.py +++ b/src/funding/widgets.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -12,7 +11,7 @@ class PerksAmountWidget(forms.Textarea): def perks_input_name(name): return "_%s_perk" % name - def render(self, name, value, attrs=None): + def render(self, name, value, attrs=None, renderer=None): try: value = Decimal(value) except DecimalException: diff --git a/src/infopages/admin.py b/src/infopages/admin.py index 67960ae09..d2f5fb071 100644 --- a/src/infopages/admin.py +++ b/src/infopages/admin.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/infopages/migrations/0001_initial.py b/src/infopages/migrations/0001_initial.py index 2c3f4f07a..f9978c764 100644 --- a/src/infopages/migrations/0001_initial.py +++ b/src/infopages/migrations/0001_initial.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations diff --git a/src/infopages/migrations/0002_auto_20151221_1225.py b/src/infopages/migrations/0002_auto_20151221_1225.py index d5755e7ef..530f2bbf0 100644 --- a/src/infopages/migrations/0002_auto_20151221_1225.py +++ b/src/infopages/migrations/0002_auto_20151221_1225.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/infopages/templatetags/infopages_tags.py b/src/infopages/templatetags/infopages_tags.py index d7c93ca8f..3c3cfdff6 100755 --- a/src/infopages/templatetags/infopages_tags.py +++ b/src/infopages/templatetags/infopages_tags.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/infopages/translation.py b/src/infopages/translation.py index caf94e306..cf5caf4e1 100644 --- a/src/infopages/translation.py +++ b/src/infopages/translation.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/infopages/urls.py b/src/infopages/urls.py index ffae43966..9d8233541 100755 --- a/src/infopages/urls.py +++ b/src/infopages/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/infopages/views.py b/src/infopages/views.py index fe2db8432..23ae502fb 100644 --- a/src/infopages/views.py +++ b/src/infopages/views.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/isbn/forms.py b/src/isbn/forms.py index 5f2940c2f..7d47fb5be 100644 --- a/src/isbn/forms.py +++ b/src/isbn/forms.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from datetime import date import json from urllib.request import urlopen @@ -13,8 +16,8 @@ from librarian.parser import WLDocument class WLISBNForm(forms.Form): - platform_url = forms.URLField(label=u'Adres na platformie') - publishing_date = forms.DateField(label=u'Data publikacji', initial=date.today) + platform_url = forms.URLField(label='Adres na platformie') + publishing_date = forms.DateField(label='Data publikacji', initial=date.today) def prepare_data(self): platform_url = self.cleaned_data['platform_url'] @@ -63,20 +66,20 @@ class FNPISBNForm(forms.Form): ('SOFT', _('Soft cover book')), ) LANGUAGE_CHOICES = ( - ('pol', u'polski'), - ('eng', u'angielski'), - ('ger', u'niemiecki'), - ('fre', u'francuski'), + ('pol', 'polski'), + ('eng', 'angielski'), + ('ger', 'niemiecki'), + ('fre', 'francuski'), ) title = forms.CharField() - authors = forms.CharField(help_text=u'wartości oddzielone przecinkami lub „Wielu autorów”') + authors = forms.CharField(help_text='wartości oddzielone przecinkami lub „Wielu autorów”') formats = forms.MultipleChoiceField(choices=FORMAT_CHOICES) language = forms.ChoiceField(choices=LANGUAGE_CHOICES) publishing_date = forms.DateField() def prepare_author(self, name): - if name == u'Wielu autorów': + if name == 'Wielu autorów': return {'role': 'A01', 'unnamed': '04'} if ' ' in name: first_name, last_name = [s.strip() for s in name.rsplit(' ', 1)] diff --git a/src/isbn/management/commands/eisbn_csv.py b/src/isbn/management/commands/eisbn_csv.py index 9d9d83b84..af64e35cd 100644 --- a/src/isbn/management/commands/eisbn_csv.py +++ b/src/isbn/management/commands/eisbn_csv.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/isbn/management/commands/export_onix.py b/src/isbn/management/commands/export_onix.py index 860bc7985..73cb8db4b 100644 --- a/src/isbn/management/commands/export_onix.py +++ b/src/isbn/management/commands/export_onix.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import json from django.core.management.base import BaseCommand from django.utils import timezone diff --git a/src/isbn/management/commands/import_onix.py b/src/isbn/management/commands/import_onix.py index 85d54eca7..1a1fe9e34 100644 --- a/src/isbn/management/commands/import_onix.py +++ b/src/isbn/management/commands/import_onix.py @@ -1,4 +1,6 @@ -# -*- 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. +# from datetime import date from lxml import etree from django.core.management.base import BaseCommand @@ -6,6 +8,7 @@ from django.core.management.base import BaseCommand from isbn.models import ISBNPool, ONIXRecord from librarian import XMLNamespace + ONIXNS = XMLNamespace('http://ns.editeur.org/onix/3.0/reference') DIRECT_FIELDS = { @@ -19,7 +22,7 @@ DIRECT_FIELDS = { 'imprint': 'ImprintName', } -UNKNOWN = u'Autor nieznany' +UNKNOWN = 'Autor nieznany' def parse_date(date_str): diff --git a/src/isbn/migrations/0001_initial.py b/src/isbn/migrations/0001_initial.py index 78a45b9f0..f55eef07b 100644 --- a/src/isbn/migrations/0001_initial.py +++ b/src/isbn/migrations/0001_initial.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models import django.db.models.deletion diff --git a/src/isbn/migrations/0002_auto_20180213_1617.py b/src/isbn/migrations/0002_auto_20180213_1617.py index 3cf11a4df..45a40c9ab 100644 --- a/src/isbn/migrations/0002_auto_20180213_1617.py +++ b/src/isbn/migrations/0002_auto_20180213_1617.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/isbn/migrations/0003_isbnpool_purpose.py b/src/isbn/migrations/0003_isbnpool_purpose.py index 6e4dc09bd..59a70eb81 100644 --- a/src/isbn/migrations/0003_isbnpool_purpose.py +++ b/src/isbn/migrations/0003_isbnpool_purpose.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/isbn/migrations/0004_auto_20180215_1042.py b/src/isbn/migrations/0004_auto_20180215_1042.py index 2015dc2fe..8193d227e 100644 --- a/src/isbn/migrations/0004_auto_20180215_1042.py +++ b/src/isbn/migrations/0004_auto_20180215_1042.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/isbn/migrations/0005_auto_20190729_1450.py b/src/isbn/migrations/0005_auto_20190729_1450.py index fc43a3662..3f9455610 100644 --- a/src/isbn/migrations/0005_auto_20190729_1450.py +++ b/src/isbn/migrations/0005_auto_20190729_1450.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-07-29 12:50 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models import django.db.models.deletion diff --git a/src/isbn/urls.py b/src/isbn/urls.py index dae6719ad..2a977e530 100644 --- a/src/isbn/urls.py +++ b/src/isbn/urls.py @@ -1,4 +1,6 @@ -# -*- 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. +# from django.conf.urls import url from . import views diff --git a/src/isbn/utils.py b/src/isbn/utils.py index da81c843c..3e29e8608 100644 --- a/src/isbn/utils.py +++ b/src/isbn/utils.py @@ -1,6 +1,9 @@ -# -*- 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. +# from librarian import RDFNS, DCNS + FORMATS = ('PDF', 'HTML', 'TXT', 'EPUB', 'MOBI') FORMATS_WITH_CHILDREN = ('PDF', 'EPUB', 'MOBI') @@ -30,11 +33,11 @@ PRODUCT_FORMATS = { 'E127': ('mobi', 'application/x-mobipocket-ebook'), } -VOLUME_SEPARATORS = (u'. część ', u', część ', u', tom ', u'. der tragödie ') +VOLUME_SEPARATORS = ('. część ', ', część ', ', tom ', '. der tragödie ') def is_institution(name): - return name.startswith(u'Zgromadzenie Ogólne') + return name.startswith('Zgromadzenie Ogólne') def get_volume(title): diff --git a/src/isbn/views.py b/src/isbn/views.py index 399a25dad..09c3466b2 100644 --- a/src/isbn/views.py +++ b/src/isbn/views.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.contrib.auth.decorators import permission_required from django.http.response import HttpResponseRedirect from django.shortcuts import render diff --git a/src/lesmianator/__init__.py b/src/lesmianator/__init__.py index 54eee5b94..d38129a36 100644 --- a/src/lesmianator/__init__.py +++ b/src/lesmianator/__init__.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/lesmianator/migrations/0001_initial.py b/src/lesmianator/migrations/0001_initial.py index 3199bf04d..d490d6e48 100644 --- a/src/lesmianator/migrations/0001_initial.py +++ b/src/lesmianator/migrations/0001_initial.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations import django.db.models.deletion from django.conf import settings diff --git a/src/lesmianator/migrations/0002_auto_20151221_1225.py b/src/lesmianator/migrations/0002_auto_20151221_1225.py index 94d653721..d855ff6a7 100644 --- a/src/lesmianator/migrations/0002_auto_20151221_1225.py +++ b/src/lesmianator/migrations/0002_auto_20151221_1225.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/lesmianator/migrations/0003_auto_20190729_1450.py b/src/lesmianator/migrations/0003_auto_20190729_1450.py index d43a9c77d..45eb6deb2 100644 --- a/src/lesmianator/migrations/0003_auto_20190729_1450.py +++ b/src/lesmianator/migrations/0003_auto_20190729_1450.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-07-29 12:50 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.conf import settings from django.db import migrations, models import django.db.models.deletion diff --git a/src/lesmianator/models.py b/src/lesmianator/models.py index 00440a1fa..9e2f1669e 100644 --- a/src/lesmianator/models.py +++ b/src/lesmianator/models.py @@ -47,7 +47,7 @@ class Poem(models.Model): @staticmethod def choose_letter(word, continuations): if word not in continuations: - return u'\n' + return '\n' choices = sum((continuations[word][letter] for letter in continuations[word])) @@ -66,7 +66,7 @@ class Poem(models.Model): return '' letters = [] - word = u'' + word = '' finished_stanza_verses = 0 current_stanza_verses = 0 @@ -82,7 +82,7 @@ class Poem(models.Model): word = word[-length + 1:] + letter char_count += 1 - if letter == u'\n': + if letter == '\n': if verse_start: finished_stanza_verses += current_stanza_verses current_stanza_verses = 0 diff --git a/src/lesmianator/urls.py b/src/lesmianator/urls.py index 2685e83e2..15d6f252d 100644 --- a/src/lesmianator/urls.py +++ b/src/lesmianator/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/libraries/admin.py b/src/libraries/admin.py index 5629e93a0..6644dd6df 100644 --- a/src/libraries/admin.py +++ b/src/libraries/admin.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/libraries/migrations/0001_initial.py b/src/libraries/migrations/0001_initial.py index 91c10e5e6..c12ad3c6c 100644 --- a/src/libraries/migrations/0001_initial.py +++ b/src/libraries/migrations/0001_initial.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations import django.db.models.deletion diff --git a/src/libraries/migrations/0002_auto_20151221_1225.py b/src/libraries/migrations/0002_auto_20151221_1225.py index 123580d91..a0b7c5327 100644 --- a/src/libraries/migrations/0002_auto_20151221_1225.py +++ b/src/libraries/migrations/0002_auto_20151221_1225.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/libraries/urls.py b/src/libraries/urls.py index 897da151f..3e3d78e76 100644 --- a/src/libraries/urls.py +++ b/src/libraries/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/libraries/views.py b/src/libraries/views.py index 98b36340b..1d15797ce 100644 --- a/src/libraries/views.py +++ b/src/libraries/views.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/manage.py b/src/manage.py index a29b48f38..fd2fbfb57 100755 --- a/src/manage.py +++ b/src/manage.py @@ -1,4 +1,7 @@ #!/usr/bin/env python +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import os import sys diff --git a/src/newsletter/admin.py b/src/newsletter/admin.py index 9fe387d4e..530eeca85 100644 --- a/src/newsletter/admin.py +++ b/src/newsletter/admin.py @@ -1,4 +1,6 @@ -# -*- 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. +# from django.conf.urls import url from django.contrib import admin from django.http.response import HttpResponse diff --git a/src/newsletter/forms.py b/src/newsletter/forms.py index d473cf3a8..1091ed8c2 100644 --- a/src/newsletter/forms.py +++ b/src/newsletter/forms.py @@ -1,4 +1,6 @@ -# -*- 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. +# from django.core.exceptions import ValidationError from django.core.validators import validate_email from django.forms import Form, BooleanField, MultipleChoiceField @@ -16,15 +18,15 @@ from wolnelektury.utils import send_noreply_mail class NewsletterForm(Form): email_field = 'email' agree_newsletter = BooleanField( - required=False, initial=False, label=_(u'I want to receive Wolne Lektury\'s newsletter.')) + required=False, initial=False, label=_('I want to receive Wolne Lektury\'s newsletter.')) mailing = False mailing_field = 'agree_newsletter' - data_processing_part1 = u'''\ + data_processing_part1 = '''\ Administratorem danych osobowych jest Fundacja Nowoczesna Polska (ul. Marszałkowska 84/92 lok. 125, 00-514 Warszawa). Podanie danych osobowych jest dobrowolne.''' - data_processing_part2 = u'''Dane są przetwarzane w zakresie niezbędnym do wysyłania newslettera odbiorcom.''' - data_processing_part3 = u'''\ + data_processing_part2 = '''Dane są przetwarzane w zakresie niezbędnym do wysyłania newslettera odbiorcom.''' + data_processing_part3 = '''\ Osobom, których dane są zbierane, przysługuje prawo dostępu do treści swoich danych oraz ich poprawiania. Więcej informacji w polityce prywatności.''' @@ -48,7 +50,7 @@ Więcej informacji w polityce prywatności.''' else: # subscription, created = Subscription.objects.get_or_create(email=email, defaults={'active': False}) # send_noreply_mail( - # ugettext(u'Confirm your subscription to Wolne Lektury newsletter'), + # ugettext('Confirm your subscription to Wolne Lektury newsletter'), # render_to_string('newsletter/subscribe_email.html', {'subscription': subscription}), [email]) mailing.subscribe(email, mailing_lists=self.cleaned_data.get('mailing_lists')) @@ -60,8 +62,8 @@ class SubscribeForm(NewsletterForm): email = EmailField(label=_('email address')) mailing_lists = MultipleChoiceField( widget=CheckboxSelectMultiple, - choices=(('general', _(u'general newsletter')), ('contest', _(u'about the contest'))), - label=_(u'mailing list')) + choices=(('general', _('general newsletter')), ('contest', _('about the contest'))), + label=_('mailing list')) def __init__(self, *args, **kwargs): super(SubscribeForm, self).__init__(*args, **kwargs) @@ -75,7 +77,7 @@ class UnsubscribeForm(Form): try: subscription = Subscription.objects.get(email=email) except Subscription.DoesNotExist: - raise ValidationError(ugettext(u'Email address not found.')) + raise ValidationError(ugettext('Email address not found.')) self.cleaned_data['subscription'] = subscription def save(self): @@ -87,6 +89,6 @@ class UnsubscribeForm(Form): context = {'subscription': subscription} # refactor to send_noreply_mail send_noreply_mail( - ugettext(u'Unsubscribe from Wolne Lektury\'s newsletter.'), + ugettext('Unsubscribe from Wolne Lektury\'s newsletter.'), render_to_string('newsletter/unsubscribe_email.html', context), [subscription.email], fail_silently=True) diff --git a/src/newsletter/migrations/0001_initial.py b/src/newsletter/migrations/0001_initial.py index 6897278b2..0826679c7 100644 --- a/src/newsletter/migrations/0001_initial.py +++ b/src/newsletter/migrations/0001_initial.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/newsletter/migrations/0002_auto_20160914_1452.py b/src/newsletter/migrations/0002_auto_20160914_1452.py index 60d6feff7..f3b7c7648 100644 --- a/src/newsletter/migrations/0002_auto_20160914_1452.py +++ b/src/newsletter/migrations/0002_auto_20160914_1452.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/newsletter/models.py b/src/newsletter/models.py index 0cbf867be..38faf342d 100644 --- a/src/newsletter/models.py +++ b/src/newsletter/models.py @@ -1,4 +1,6 @@ -# -*- 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 hashlib from django.db.models import Model, EmailField, DateTimeField, BooleanField @@ -8,7 +10,7 @@ from django.conf import settings class Subscription(Model): email = EmailField(verbose_name=_('email address'), unique=True) - active = BooleanField(default=True, verbose_name=_(u'active')) + active = BooleanField(default=True, verbose_name=_('active')) created_at = DateTimeField(auto_now_add=True) last_modified = DateTimeField(auto_now=True) diff --git a/src/newsletter/tests.py b/src/newsletter/tests.py deleted file mode 100644 index 7ce503c2d..000000000 --- a/src/newsletter/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/src/newsletter/urls.py b/src/newsletter/urls.py index a34d98c41..c99b47a43 100644 --- a/src/newsletter/urls.py +++ b/src/newsletter/urls.py @@ -1,4 +1,6 @@ -# -*- 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. +# from django.conf.urls import url from . import views diff --git a/src/newsletter/views.py b/src/newsletter/views.py index 7fd67b278..4c57a251d 100644 --- a/src/newsletter/views.py +++ b/src/newsletter/views.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.http import Http404 from django.http.response import HttpResponseRedirect from django.shortcuts import render, get_object_or_404 @@ -17,14 +20,14 @@ def subscribe_form(request): else: form = SubscribeForm() return render(request, 'newsletter/subscribe_form.html', { - 'page_title': _(u'Subscribe To Newsletter'), + 'page_title': _('Subscribe To Newsletter'), 'form': form, }) def subscribed(request): return render(request, 'newsletter/subscribed.html', { - 'page_title': _(u'Subscribed'), + 'page_title': _('Subscribed'), }) @@ -39,7 +42,7 @@ def confirm_subscription(request, subscription_id, hashcode): subscription.active = True subscription.save() return render(request, 'newsletter/confirm_subscription.html', { - 'page_title': _(u'Subscription confirmed') + 'page_title': _('Subscription confirmed') }) @@ -52,12 +55,12 @@ def unsubscribe_form(request): else: form = UnsubscribeForm() return render(request, 'newsletter/unsubscribe_form.html', { - 'page_title': _(u'Unsubscribe'), + 'page_title': _('Unsubscribe'), 'form': form, }) def unsubscribed(request): return render(request, 'newsletter/unsubscribed.html', { - 'page_title': _(u'Unsubscribed'), + 'page_title': _('Unsubscribed'), }) diff --git a/src/newtagging/admin.py b/src/newtagging/admin.py deleted file mode 100644 index 569982dde..000000000 --- a/src/newtagging/admin.py +++ /dev/null @@ -1,71 +0,0 @@ -# -*- coding: utf-8 -*- -from django.contrib import admin -from django import forms -from django.utils.safestring import mark_safe -from django.utils.translation import ugettext_lazy as _ - - -class FilteredSelectMultiple(forms.SelectMultiple): - """ - A SelectMultiple with a JavaScript filter interface. - - Note that the resulting JavaScript assumes that the SelectFilter2.js - library and its dependencies have been loaded in the HTML page. - """ - def _media(self): - from django.conf import settings - js = ['js/SelectBox.js', 'js/SelectFilter2.js'] - return forms.Media(js=['%sadmin/%s' % (settings.STATIC_URL, url) for url in js]) - media = property(_media) - - def __init__(self, verbose_name, is_stacked, attrs=None, choices=()): - self.verbose_name = verbose_name - self.is_stacked = is_stacked - super(FilteredSelectMultiple, self).__init__(attrs, choices) - - def render(self, name, value, attrs=None, choices=()): - from django.conf import settings - output = [ - super(FilteredSelectMultiple, self).render(name, value, attrs, choices), - u'\n' % ( - name, self.verbose_name.replace('"', '\\"'), - int(self.is_stacked), settings.STATIC_URL + "admin/") - ] - # TODO: "id_" is hard-coded here. This should instead use the correct - # API to determine the ID dynamically. - return mark_safe(u''.join(output)) - - -class TaggableModelForm(forms.ModelForm): - tags = forms.MultipleChoiceField( - label=_('tags').capitalize(), required=False, - widget=FilteredSelectMultiple(_('tags'), is_stacked=False)) - - def __init__(self, *args, **kwargs): - if 'instance' in kwargs: - if 'initial' not in kwargs: - kwargs['initial'] = {} - kwargs['initial']['tags'] = [tag.id for tag in self.tag_model.objects.get_for_object(kwargs['instance'])] - super(TaggableModelForm, self).__init__(*args, **kwargs) - self.fields['tags'].choices = [(tag.id, tag.name) for tag in self.tag_model.objects.all()] - - def save(self, commit): - obj = super(TaggableModelForm, self).save() - tag_ids = self.cleaned_data['tags'] - tags = self.tag_model.objects.filter(pk__in=tag_ids) - self.tag_model.objects.update_tags(obj, tags) - return obj - - def save_m2m(self): - # TODO: Shouldn't be needed - pass - - -class TaggableModelAdmin(admin.ModelAdmin): - form = TaggableModelForm - - def get_form(self, request, obj=None): - form = super(TaggableModelAdmin, self).get_form(request, obj) - form.tag_model = self.tag_model - return form diff --git a/src/newtagging/managers.py b/src/newtagging/managers.py index 7de7fe735..b9a754378 100644 --- a/src/newtagging/managers.py +++ b/src/newtagging/managers.py @@ -1,4 +1,6 @@ -# -*- 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. +# """ Custom managers for Django models registered with the tagging application. diff --git a/src/newtagging/models.py b/src/newtagging/models.py index 800cd0028..e3e8f3c0a 100644 --- a/src/newtagging/models.py +++ b/src/newtagging/models.py @@ -1,4 +1,6 @@ -# -*- 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. +# """ Models and managers for generic tagging. """ diff --git a/src/oai/handlers.py b/src/oai/handlers.py index 16d760911..356f51b57 100644 --- a/src/oai/handlers.py +++ b/src/oai/handlers.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -75,7 +74,7 @@ class Catalogue(common.ResumptionOAIPMH): try: earliest_delete = \ - Deleted.objects.exclude(slug__exact=u'').order_by('deleted_at')[0].deleted_at + Deleted.objects.exclude(slug__exact='').order_by('deleted_at')[0].deleted_at except IndexError: earliest_delete = year_zero @@ -134,7 +133,7 @@ class Catalogue(common.ResumptionOAIPMH): # books = Book.tagged.with_all([tag]) else: books = Book.objects.filter(preview=False) - deleted = Deleted.objects.exclude(slug__exact=u'') + deleted = Deleted.objects.exclude(slug__exact='') books = books.order_by('changed_at') deleted = deleted.order_by('deleted_at') diff --git a/src/oai/tests/test_oaipmhapi.py b/src/oai/tests/test_oaipmhapi.py index 938624b86..214a1c61a 100644 --- a/src/oai/tests/test_oaipmhapi.py +++ b/src/oai/tests/test_oaipmhapi.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/oai/urls.py b/src/oai/urls.py index 205d5e6c9..2088a8aad 100644 --- a/src/oai/urls.py +++ b/src/oai/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/oai/views.py b/src/oai/views.py index 5bb902508..25455fb2f 100644 --- a/src/oai/views.py +++ b/src/oai/views.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/opds/tests/test_opds.py b/src/opds/tests/test_opds.py index 339bfaa37..2c37bd46c 100644 --- a/src/opds/tests/test_opds.py +++ b/src/opds/tests/test_opds.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -14,7 +13,7 @@ from search.index import Index AtomNS = XMLNamespace("http://www.w3.org/2005/Atom") -@skipIf(getattr(settings, 'NO_SEARCH_INDEX', False), u'Requires search server and NO_SEARCH_INDEX=False.') +@skipIf(getattr(settings, 'NO_SEARCH_INDEX', False), 'Requires search server and NO_SEARCH_INDEX=False.') class OpdsSearchTests(WLTestCase): """Tests search feed in OPDS..""" def setUp(self): @@ -34,7 +33,7 @@ class OpdsSearchTests(WLTestCase): self.client.get('/opds/search/?%s' % query).content) elem_ids = tree.findall('.//%s/%s' % (AtomNS('entry'), AtomNS('id'))) slugs = [WLURI(elem.text).slug for elem in elem_ids] - self.assertEqual(set(slugs), set(b.slug for b in books), u"OPDS search '%s' failed." % query) + self.assertEqual(set(slugs), set(b.slug for b in books), "OPDS search '%s' failed." % query) def test_opds_search_simple(self): """Do a simple q= test, also emulate dumb OPDS clients.""" diff --git a/src/opds/urls.py b/src/opds/urls.py index 8f1059f1e..213c55af8 100644 --- a/src/opds/urls.py +++ b/src/opds/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/opds/views.py b/src/opds/views.py index c71822fa8..6d04c6c2a 100644 --- a/src/opds/views.py +++ b/src/opds/views.py @@ -28,39 +28,39 @@ log = logging.getLogger('opds') _root_feeds = ( { - u"category": u"", - u"link": u"opds_user", - u"link_args": [], - u"title": u"Moje półki", - u"description": u"Półki użytkownika dostępne po zalogowaniu" + "category": "", + "link": "opds_user", + "link_args": [], + "title": "Moje półki", + "description": "Półki użytkownika dostępne po zalogowaniu" }, { - u"category": u"author", - u"link": u"opds_by_category", - u"link_args": [u"author"], - u"title": u"Autorzy", - u"description": u"Utwory wg autorów" + "category": "author", + "link": "opds_by_category", + "link_args": ["author"], + "title": "Autorzy", + "description": "Utwory wg autorów" }, { - u"category": u"kind", - u"link": u"opds_by_category", - u"link_args": [u"kind"], - u"title": u"Rodzaje", - u"description": u"Utwory wg rodzajów" + "category": "kind", + "link": "opds_by_category", + "link_args": ["kind"], + "title": "Rodzaje", + "description": "Utwory wg rodzajów" }, { - u"category": u"genre", - u"link": u"opds_by_category", - u"link_args": [u"genre"], - u"title": u"Gatunki", - u"description": u"Utwory wg gatunków" + "category": "genre", + "link": "opds_by_category", + "link_args": ["genre"], + "title": "Gatunki", + "description": "Utwory wg gatunków" }, { - u"category": u"epoch", - u"link": u"opds_by_category", - u"link_args": [u"epoch"], - u"title": u"Epoki", - u"description": u"Utwory wg epok" + "category": "epoch", + "link": "opds_by_category", + "link_args": ["epoch"], + "title": "Epoki", + "description": "Utwory wg epok" }, ) @@ -73,8 +73,8 @@ def full_url(url): class OPDSFeed(Atom1Feed): - link_rel = u"subsection" - link_type = u"application/atom+xml" + link_rel = "subsection" + link_type = "application/atom+xml" _book_parent_img = lazy(lambda: full_url(os.path.join(settings.STATIC_URL, "img/book-parent.png")), str)() try: @@ -90,45 +90,45 @@ class OPDSFeed(Atom1Feed): def add_root_elements(self, handler): super(OPDSFeed, self).add_root_elements(handler) - handler.addQuickElement(u"link", None, - {u"href": reverse("opds_authors"), - u"rel": u"start", - u"type": u"application/atom+xml"}) - handler.addQuickElement(u"link", None, - {u"href": full_url(os.path.join(settings.STATIC_URL, "opensearch.xml")), - u"rel": u"search", - u"type": u"application/opensearchdescription+xml"}) + handler.addQuickElement("link", None, + {"href": reverse("opds_authors"), + "rel": "start", + "type": "application/atom+xml"}) + handler.addQuickElement("link", None, + {"href": full_url(os.path.join(settings.STATIC_URL, "opensearch.xml")), + "rel": "search", + "type": "application/opensearchdescription+xml"}) def add_item_elements(self, handler, item): """ modified from Atom1Feed.add_item_elements """ - handler.addQuickElement(u"title", item['title']) + handler.addQuickElement("title", item['title']) # add a OPDS Navigation link if there's no enclosure if not item.get('enclosures') is None: handler.addQuickElement( - u"link", u"", {u"href": item['link'], u"rel": u"subsection", u"type": u"application/atom+xml"}) + "link", "", {"href": item['link'], "rel": "subsection", "type": "application/atom+xml"}) # add a "green book" icon handler.addQuickElement( - u"link", '', + "link", '', { - u"rel": u"http://opds-spec.org/thumbnail", - u"href": self._book_parent_img, - u"length": self._book_parent_img_size, - u"type": u"image/png", + "rel": "http://opds-spec.org/thumbnail", + "href": self._book_parent_img, + "length": self._book_parent_img_size, + "type": "image/png", }) if item['pubdate'] is not None: # FIXME: rfc3339_date is undefined, is this ever run? - handler.addQuickElement(u"updated", rfc3339_date(item['pubdate']).decode('utf-8')) + handler.addQuickElement("updated", rfc3339_date(item['pubdate']).decode('utf-8')) # Author information. if item['author_name'] is not None: - handler.startElement(u"author", {}) - handler.addQuickElement(u"name", item['author_name']) + handler.startElement("author", {}) + handler.addQuickElement("name", item['author_name']) if item['author_email'] is not None: - handler.addQuickElement(u"email", item['author_email']) + handler.addQuickElement("email", item['author_email']) if item['author_link'] is not None: - handler.addQuickElement(u"uri", item['author_link']) - handler.endElement(u"author") + handler.addQuickElement("uri", item['author_link']) + handler.endElement("author") # Unique ID. if item['unique_id'] is not None: @@ -136,54 +136,54 @@ class OPDSFeed(Atom1Feed): else: # FIXME: get_tag_uri is undefined, is this ever run? unique_id = get_tag_uri(item['link'], item['pubdate']) - handler.addQuickElement(u"id", unique_id) + handler.addQuickElement("id", unique_id) # Summary. # OPDS needs type=text if item['description'] is not None: - handler.addQuickElement(u"summary", item['description'], {u"type": u"text"}) + handler.addQuickElement("summary", item['description'], {"type": "text"}) # Enclosure as OPDS Acquisition Link for enc in item.get('enclosures', []): handler.addQuickElement( - u"link", '', + "link", '', { - u"rel": u"http://opds-spec.org/acquisition", - u"href": enc.url, - u"length": enc.length, - u"type": enc.mime_type, + "rel": "http://opds-spec.org/acquisition", + "href": enc.url, + "length": enc.length, + "type": enc.mime_type, }) # add a "red book" icon handler.addQuickElement( - u"link", '', + "link", '', { - u"rel": u"http://opds-spec.org/thumbnail", - u"href": self._book_img, - u"length": self._book_img_size, - u"type": u"image/png", + "rel": "http://opds-spec.org/thumbnail", + "href": self._book_img, + "length": self._book_img_size, + "type": "image/png", }) # Categories. for cat in item['categories']: - handler.addQuickElement(u"category", u"", {u"term": cat}) + handler.addQuickElement("category", "", {"term": cat}) # Rights. if item['item_copyright'] is not None: - handler.addQuickElement(u"rights", item['item_copyright']) + handler.addQuickElement("rights", item['item_copyright']) class AcquisitionFeed(Feed): feed_type = OPDSFeed - link = u'http://www.wolnelektury.pl/' + link = 'http://www.wolnelektury.pl/' item_enclosure_mime_type = "application/epub+zip" - author_name = u"Wolne Lektury" - author_link = u"http://www.wolnelektury.pl/" + author_name = "Wolne Lektury" + author_link = "http://www.wolnelektury.pl/" def item_title(self, book): return book.title def item_description(self): - return u'' + return '' def item_link(self, book): return book.get_absolute_url() @@ -192,13 +192,13 @@ class AcquisitionFeed(Feed): try: return book.authors().first().name except AttributeError: - return u'' + return '' def item_author_link(self, book): try: return book.authors().first().get_absolute_url() except AttributeError: - return u'' + return '' def item_enclosure_url(self, book): return full_url(book.epub_url()) if book.epub_file else None @@ -210,11 +210,11 @@ class AcquisitionFeed(Feed): @piwik_track class RootFeed(Feed): feed_type = OPDSFeed - title = u'Wolne Lektury' - link = u'http://wolnelektury.pl/' - description = u"Spis utworów na stronie http://WolneLektury.pl" - author_name = u"Wolne Lektury" - author_link = u"http://wolnelektury.pl/" + title = 'Wolne Lektury' + link = 'http://wolnelektury.pl/' + description = "Spis utworów na stronie http://WolneLektury.pl" + author_name = "Wolne Lektury" + author_link = "http://wolnelektury.pl/" def items(self): return _root_feeds @@ -232,10 +232,10 @@ class RootFeed(Feed): @piwik_track class ByCategoryFeed(Feed): feed_type = OPDSFeed - link = u'http://wolnelektury.pl/' - description = u"Spis utworów na stronie http://WolneLektury.pl" - author_name = u"Wolne Lektury" - author_link = u"http://wolnelektury.pl/" + link = 'http://wolnelektury.pl/' + description = "Spis utworów na stronie http://WolneLektury.pl" + author_name = "Wolne Lektury" + author_link = "http://wolnelektury.pl/" def get_object(self, request, category): feed = [feed for feed in _root_feeds if feed['category'] == category] @@ -259,7 +259,7 @@ class ByCategoryFeed(Feed): return reverse("opds_by_tag", args=[item.category, item.slug]) def item_description(self): - return u'' + return '' @piwik_track @@ -271,7 +271,7 @@ class ByTagFeed(AcquisitionFeed): return tag.name def description(self, tag): - return u"Spis utworów na stronie http://WolneLektury.pl" + return "Spis utworów na stronie http://WolneLektury.pl" def get_object(self, request, category, slug): return get_object_or_404(Tag, category=category, slug=slug) @@ -284,16 +284,16 @@ class ByTagFeed(AcquisitionFeed): @piwik_track class UserFeed(Feed): feed_type = OPDSFeed - link = u'http://www.wolnelektury.pl/' - description = u"Półki użytkownika na stronie http://WolneLektury.pl" - author_name = u"Wolne Lektury" - author_link = u"http://wolnelektury.pl/" + link = 'http://www.wolnelektury.pl/' + description = "Półki użytkownika na stronie http://WolneLektury.pl" + author_name = "Wolne Lektury" + author_link = "http://wolnelektury.pl/" def get_object(self, request): return request.user def title(self, user): - return u"Półki użytkownika %s" % user.username + return "Półki użytkownika %s" % user.username def items(self, user): return Tag.objects.filter(category='set', user=user).exclude(items=None) @@ -305,7 +305,7 @@ class UserFeed(Feed): return reverse("opds_user_set", args=[item.slug]) def item_description(self): - return u'' + return '' @factory_decorator(logged_in_or_basicauth()) @@ -318,7 +318,7 @@ class UserSetFeed(AcquisitionFeed): return tag.name def description(self, tag): - return u"Spis utworów na stronie http://WolneLektury.pl" + return "Spis utworów na stronie http://WolneLektury.pl" def get_object(self, request, slug): return get_object_or_404(Tag, category='set', slug=slug, user=request.user) @@ -329,8 +329,8 @@ class UserSetFeed(AcquisitionFeed): @piwik_track class SearchFeed(AcquisitionFeed): - description = u"Wyniki wyszukiwania na stronie WolneLektury.pl" - title = u"Wyniki wyszukiwania" + description = "Wyniki wyszukiwania na stronie WolneLektury.pl" + title = "Wyniki wyszukiwania" QUOTE_OR_NOT = r'(?:(?=["])"([^"]+)"|([^ ]+))' INLINE_QUERY_RE = re.compile( diff --git a/src/paypal/forms.py b/src/paypal/forms.py index 4cc76608c..f35219aa8 100644 --- a/src/paypal/forms.py +++ b/src/paypal/forms.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/paypal/migrations/0001_initial.py b/src/paypal/migrations/0001_initial.py index 6380c0faf..785080003 100644 --- a/src/paypal/migrations/0001_initial.py +++ b/src/paypal/migrations/0001_initial.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models import django.db.models.deletion from django.conf import settings diff --git a/src/paypal/migrations/0002_billingagreement_token.py b/src/paypal/migrations/0002_billingagreement_token.py index 7a45e87a0..83c0fc097 100644 --- a/src/paypal/migrations/0002_billingagreement_token.py +++ b/src/paypal/migrations/0002_billingagreement_token.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/paypal/migrations/0003_auto_20190729_1450.py b/src/paypal/migrations/0003_auto_20190729_1450.py index 4c47ec75f..1e7b2f838 100644 --- a/src/paypal/migrations/0003_auto_20190729_1450.py +++ b/src/paypal/migrations/0003_auto_20190729_1450.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-07-29 12:50 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.conf import settings from django.db import migrations, models import django.db.models.deletion diff --git a/src/paypal/rest.py b/src/paypal/rest.py index 57c150b18..92752b70f 100644 --- a/src/paypal/rest.py +++ b/src/paypal/rest.py @@ -72,8 +72,8 @@ def create_agreement(amount, app=False): plan_id = plan.plan_id start = (timezone.now() + timedelta(0, 3600*24)).astimezone(pytz.utc).strftime('%Y-%m-%dT%H:%M:%SZ') billing_agreement = paypalrestsdk.BillingAgreement({ - "name": u"Subskrypcja klubu WL", - "description": u"Stałe wsparcie Wolnych Lektur kwotą %s złotych" % amount, + "name": "Subskrypcja klubu WL", + "description": "Stałe wsparcie Wolnych Lektur kwotą %s złotych" % amount, "start_date": start, "plan": { "id": plan_id, diff --git a/src/pdcounter/admin.py b/src/pdcounter/admin.py index b83756baa..5f1e77aad 100644 --- a/src/pdcounter/admin.py +++ b/src/pdcounter/admin.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/pdcounter/migrations/0001_initial.py b/src/pdcounter/migrations/0001_initial.py index fdd0a8e9b..f6d5ed164 100644 --- a/src/pdcounter/migrations/0001_initial.py +++ b/src/pdcounter/migrations/0001_initial.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations diff --git a/src/pdcounter/migrations/0002_auto_20151221_1225.py b/src/pdcounter/migrations/0002_auto_20151221_1225.py index 6447cc1d4..e02d5ce1c 100644 --- a/src/pdcounter/migrations/0002_auto_20151221_1225.py +++ b/src/pdcounter/migrations/0002_auto_20151221_1225.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/pdcounter/models.py b/src/pdcounter/models.py index 7d6181d60..40bf3e69a 100644 --- a/src/pdcounter/models.py +++ b/src/pdcounter/models.py @@ -14,7 +14,7 @@ class Author(models.Model): slug = models.SlugField(_('slug'), max_length=120, db_index=True, unique=True) sort_key = models.CharField(_('sort key'), max_length=120, db_index=True) description = models.TextField(_('description'), blank=True) - death = models.IntegerField(_(u'year of death'), blank=True, null=True) + death = models.IntegerField(_('year of death'), blank=True, null=True) gazeta_link = models.CharField(blank=True, max_length=240) wiki_link = models.CharField(blank=True, max_length=240) diff --git a/src/pdcounter/templatetags/time_tags.py b/src/pdcounter/templatetags/time_tags.py index 42427fb60..98d516c4b 100755 --- a/src/pdcounter/templatetags/time_tags.py +++ b/src/pdcounter/templatetags/time_tags.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/pdcounter/views.py b/src/pdcounter/views.py index 3be24c0a6..5e3f3be7c 100644 --- a/src/pdcounter/views.py +++ b/src/pdcounter/views.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -17,7 +16,7 @@ def book_stub_detail(request, slug): else: pd_counter = None - form = PublishingSuggestForm(initial={"books": u"%s — %s, \n" % (book.author, book.title)}) + form = PublishingSuggestForm(initial={"books": "%s — %s, \n" % (book.author, book.title)}) return render(request, 'pdcounter/book_stub_detail.html', { 'book': book, diff --git a/src/picture/admin.py b/src/picture/admin.py index debe11a81..1020f49af 100644 --- a/src/picture/admin.py +++ b/src/picture/admin.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/picture/api/urls.py b/src/picture/api/urls.py index e8dc14618..cb457f501 100644 --- a/src/picture/api/urls.py +++ b/src/picture/api/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/picture/api/views.py b/src/picture/api/views.py index fddc86c17..4ca98b965 100644 --- a/src/picture/api/views.py +++ b/src/picture/api/views.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/picture/forms.py b/src/picture/forms.py index 14706d9da..47156e8f8 100644 --- a/src/picture/forms.py +++ b/src/picture/forms.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/picture/migrations/0001_initial.py b/src/picture/migrations/0001_initial.py index 22611bb7b..08f66d684 100644 --- a/src/picture/migrations/0001_initial.py +++ b/src/picture/migrations/0001_initial.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from os.path import join from django.conf import settings from django.db import models, migrations diff --git a/src/picture/migrations/0002_remove_picture__related_info.py b/src/picture/migrations/0002_remove_picture__related_info.py index 10542c85b..d19e2c2e8 100644 --- a/src/picture/migrations/0002_remove_picture__related_info.py +++ b/src/picture/migrations/0002_remove_picture__related_info.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations diff --git a/src/picture/migrations/0003_auto_20140924_1559.py b/src/picture/migrations/0003_auto_20140924_1559.py index 4e257d809..6c714257e 100644 --- a/src/picture/migrations/0003_auto_20140924_1559.py +++ b/src/picture/migrations/0003_auto_20140924_1559.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations diff --git a/src/picture/migrations/0004_auto_20141016_1337.py b/src/picture/migrations/0004_auto_20141016_1337.py index 88d124934..432702fb1 100644 --- a/src/picture/migrations/0004_auto_20141016_1337.py +++ b/src/picture/migrations/0004_auto_20141016_1337.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations diff --git a/src/picture/migrations/0005_auto_20141022_1001.py b/src/picture/migrations/0005_auto_20141022_1001.py index 9ece9d7df..2d8f7b166 100644 --- a/src/picture/migrations/0005_auto_20141022_1001.py +++ b/src/picture/migrations/0005_auto_20141022_1001.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import json from django.core.files.base import ContentFile from django.db import models, migrations diff --git a/src/picture/migrations/0006_auto_20151221_1225.py b/src/picture/migrations/0006_auto_20151221_1225.py index 50f97b50e..ccead197f 100644 --- a/src/picture/migrations/0006_auto_20151221_1225.py +++ b/src/picture/migrations/0006_auto_20151221_1225.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/picture/migrations/0007_auto_20160125_1709.py b/src/picture/migrations/0007_auto_20160125_1709.py index 1f70f40e1..90e943b8e 100644 --- a/src/picture/migrations/0007_auto_20160125_1709.py +++ b/src/picture/migrations/0007_auto_20160125_1709.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from os.path import join import sorl.thumbnail.fields from django.conf import settings diff --git a/src/picture/migrations/0008_auto_20160413_1152.py b/src/picture/migrations/0008_auto_20160413_1152.py index 92db5c514..6d2c09318 100644 --- a/src/picture/migrations/0008_auto_20160413_1152.py +++ b/src/picture/migrations/0008_auto_20160413_1152.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/picture/models.py b/src/picture/models.py index 1ad09e2d8..875ebcc9c 100644 --- a/src/picture/models.py +++ b/src/picture/models.py @@ -118,7 +118,7 @@ class Picture(models.Model): try: author = self.authors().first().sort_key except AttributeError: - author = u'' + author = '' self.sort_key_author = author ret = super(Picture, self).save(force_insert, force_update) diff --git a/src/picture/tests/test_picture_import.py b/src/picture/tests/test_picture_import.py index 022b33c62..8ff125172 100644 --- a/src/picture/tests/test_picture_import.py +++ b/src/picture/tests/test_picture_import.py @@ -1,9 +1,6 @@ -# -*- 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. # -from __future__ import with_statement - from os import path from picture.models import Picture from catalogue.test_utils import WLTestCase @@ -18,8 +15,8 @@ class PictureTest(WLTestCase): for area in picture.areas.all(): themes.update([ (tag.category, tag.name) - for tag in area.tags if tag.category in (u'theme', u'thing')]) - assert themes == {(u'theme', u'nieporządek'), (u'thing', u'Kosmos')}, \ + for tag in area.tags if tag.category in ('theme', 'thing')]) + assert themes == {('theme', 'nieporządek'), ('thing', 'Kosmos')}, \ 'Bad themes on Picture areas: %s' % themes pic_themes = set([tag.name for tag in picture.tags if tag.category in ('theme', 'thing')]) diff --git a/src/polls/admin.py b/src/polls/admin.py index 235e8f3c2..69416947b 100644 --- a/src/polls/admin.py +++ b/src/polls/admin.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/polls/forms.py b/src/polls/forms.py index 20d53fe33..ac97354b4 100644 --- a/src/polls/forms.py +++ b/src/polls/forms.py @@ -1,14 +1,13 @@ -# -*- 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. -# -from django import forms - - -class PollForm(forms.Form): - vote = forms.ChoiceField(widget=forms.RadioSelect) - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from django import forms + + +class PollForm(forms.Form): + vote = forms.ChoiceField(widget=forms.RadioSelect) + def __init__(self, *args, **kwargs): - poll = kwargs.pop('poll', None) - super(PollForm, self).__init__(*args, **kwargs) - self.fields['vote'].choices = [(item.id, item.content) for item in poll.items.all()] + poll = kwargs.pop('poll', None) + super(PollForm, self).__init__(*args, **kwargs) + self.fields['vote'].choices = [(item.id, item.content) for item in poll.items.all()] diff --git a/src/polls/migrations/0001_initial.py b/src/polls/migrations/0001_initial.py index 79592e9f4..58b9d8dd4 100644 --- a/src/polls/migrations/0001_initial.py +++ b/src/polls/migrations/0001_initial.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations import django.db.models.deletion diff --git a/src/polls/migrations/0002_auto_20151221_1225.py b/src/polls/migrations/0002_auto_20151221_1225.py index e75948893..5edd0ff9a 100644 --- a/src/polls/migrations/0002_auto_20151221_1225.py +++ b/src/polls/migrations/0002_auto_20151221_1225.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/polls/templatetags/polls_tags.py b/src/polls/templatetags/polls_tags.py index 7124b8603..e6e3f8a9a 100644 --- a/src/polls/templatetags/polls_tags.py +++ b/src/polls/templatetags/polls_tags.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/polls/urls.py b/src/polls/urls.py index 8a5f62136..897686b8a 100644 --- a/src/polls/urls.py +++ b/src/polls/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/push/admin.py b/src/push/admin.py index 339e2e780..1843dbbb0 100644 --- a/src/push/admin.py +++ b/src/push/admin.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/push/forms.py b/src/push/forms.py index f3c832b9d..afe12d107 100644 --- a/src/push/forms.py +++ b/src/push/forms.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -17,7 +16,7 @@ class NotificationForm(forms.ModelForm): def save(self, commit=True): notification = super(NotificationForm, self).save(commit=commit) - wl_base = u'https://' + Site.objects.get_current().domain + wl_base = 'https://' + Site.objects.get_current().domain if notification.image: image_url = wl_base + notification.image.url else: diff --git a/src/push/migrations/0001_initial.py b/src/push/migrations/0001_initial.py index 86a33dc00..cbe1c264e 100644 --- a/src/push/migrations/0001_initial.py +++ b/src/push/migrations/0001_initial.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/push/migrations/0002_auto_20180830_1627.py b/src/push/migrations/0002_auto_20180830_1627.py index 3cf282c81..592da397b 100644 --- a/src/push/migrations/0002_auto_20180830_1627.py +++ b/src/push/migrations/0002_auto_20180830_1627.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/push/migrations/0003_auto_20180831_1135.py b/src/push/migrations/0003_auto_20180831_1135.py index e90a81476..7a6abd020 100644 --- a/src/push/migrations/0003_auto_20180831_1135.py +++ b/src/push/migrations/0003_auto_20180831_1135.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/push/models.py b/src/push/models.py index bb84b992f..b149ed760 100644 --- a/src/push/models.py +++ b/src/push/models.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -8,9 +7,9 @@ from django.utils.translation import ugettext_lazy as _ class Notification(models.Model): timestamp = models.DateTimeField(auto_now_add=True) - title = models.CharField(max_length=256, verbose_name=_(u'title')) - body = models.CharField(max_length=2048, verbose_name=_(u'content')) - image = models.ImageField(verbose_name=_(u'image'), blank=True, upload_to='push/img') + title = models.CharField(max_length=256, verbose_name=_('title')) + body = models.CharField(max_length=2048, verbose_name=_('content')) + image = models.ImageField(verbose_name=_('image'), blank=True, upload_to='push/img') message_id = models.CharField(max_length=2048) class Meta: diff --git a/src/push/urls.py b/src/push/urls.py index 173b2dd18..c7f64d966 100644 --- a/src/push/urls.py +++ b/src/push/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/push/utils.py b/src/push/utils.py index 684531588..eb1198453 100644 --- a/src/push/utils.py +++ b/src/push/utils.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/reporting/models.py b/src/reporting/models.py index 740b9276e..df7df2eb4 100644 --- a/src/reporting/models.py +++ b/src/reporting/models.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/reporting/templatetags/reporting_stats.py b/src/reporting/templatetags/reporting_stats.py index 7a2080425..ef91aed31 100755 --- a/src/reporting/templatetags/reporting_stats.py +++ b/src/reporting/templatetags/reporting_stats.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/reporting/urls.py b/src/reporting/urls.py index f4a65f44b..fa7ceb28d 100755 --- a/src/reporting/urls.py +++ b/src/reporting/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/search/__init__.py b/src/search/__init__.py index d38412449..e69de29bb 100644 --- a/src/search/__init__.py +++ b/src/search/__init__.py @@ -1,4 +0,0 @@ -# -*- 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. -# diff --git a/src/search/fields.py b/src/search/fields.py index c27cce166..10afd5914 100755 --- a/src/search/fields.py +++ b/src/search/fields.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -15,9 +14,9 @@ class JQueryAutoCompleteWidget(forms.TextInput): super(JQueryAutoCompleteWidget, self).__init__(*args, **kwargs) def render_js(self, field_id, options): - return u'$(\'#%s\').autocomplete(%s).result(autocomplete_result_handler);' % (field_id, options) + return '$(\'#%s\').autocomplete(%s).result(autocomplete_result_handler);' % (field_id, options) - def render(self, name, value=None, attrs=None): + def render(self, name, value=None, attrs=None, renderer=None): final_attrs = self.build_attrs(self.attrs, attrs) final_attrs["name"] = name if value: @@ -26,7 +25,7 @@ class JQueryAutoCompleteWidget(forms.TextInput): if 'id' not in self.attrs: final_attrs['id'] = 'id_%s' % name - html = u''' + html = ''' ''' % { @@ -42,7 +41,7 @@ class JQueryAutoCompleteSearchWidget(JQueryAutoCompleteWidget): super(JQueryAutoCompleteSearchWidget, self).__init__(*args, **kwargs) def render_js(self, field_id, options): - return u"" + return "" class JQueryAutoCompleteField(forms.CharField): diff --git a/src/search/forms.py b/src/search/forms.py index b67ae7773..d62ab6457 100755 --- a/src/search/forms.py +++ b/src/search/forms.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/search/index.py b/src/search/index.py index bd31a2acf..e471cd642 100644 --- a/src/search/index.py +++ b/src/search/index.py @@ -390,16 +390,16 @@ class Index(SolrIndex): return def fix_format(text): - # separator = [u" ", u"\t", u".", u";", u","] + # separator = [" ", "\t", ".", ";", ","] if isinstance(text, list): # need to join it first text = filter(lambda s: s is not None, content) - text = u' '.join(text) + text = ' '.join(text) # for i in range(len(text)): # if i > 0: # if text[i][0] not in separator\ # and text[i - 1][-1] not in separator: - # text.insert(i, u" ") + # text.insert(i, " ") return re.sub("(?m)/$", "", text) @@ -463,7 +463,7 @@ class Index(SolrIndex): elif end is not None and footnote is not [] and end.tag in self.footnote_tags: handle_text.pop() doc = add_part(snippets, header_index=position, header_type=header.tag, - text=u''.join(footnote), + text=''.join(footnote), is_footnote=True) self.index.add(doc) footnote = [] @@ -613,7 +613,7 @@ class SearchResult(object): return result def __str__(self): - return u"" % \ + return "" % \ (self.book_id, len(self._hits), len(self._processed_hits) if self._processed_hits else -1, self._score, len(self.snippets)) @@ -802,7 +802,7 @@ class PictureResult(object): self._hits.append(hit) def __str__(self): - return u"" % (self.picture_id, self._score) + return "" % (self.picture_id, self._score) def __repr__(self): return str(self) diff --git a/src/search/templatetags/search_tags.py b/src/search/templatetags/search_tags.py index 05c504ce9..8d0b74be8 100644 --- a/src/search/templatetags/search_tags.py +++ b/src/search/templatetags/search_tags.py @@ -23,8 +23,8 @@ def book_searched(context, result): continue snip = result.snippets[idx] # fix some formattting - snip = re.sub(r"[ \t\n]*\n[ \t\n]*", u"\n", snip) - snip = re.sub(r"(^[ \t\n]+|[ \t\n]+$)", u"", snip) + snip = re.sub(r"[ \t\n]*\n[ \t\n]*", "\n", snip) + snip = re.sub(r"(^[ \t\n]+|[ \t\n]+$)", "", snip) snip = snip.replace("\n", "
    ").replace('---', '—') hit['snippet'] = snip diff --git a/src/search/tests/__init__.py b/src/search/tests/__init__.py index 80c974e58..6cf7afe41 100644 --- a/src/search/tests/__init__.py +++ b/src/search/tests/__init__.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/search/tests/index.py b/src/search/tests/index.py index 2af1d3030..34d958603 100644 --- a/src/search/tests/index.py +++ b/src/search/tests/index.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -15,7 +14,7 @@ import opds @override_settings(SEARCH_INDEX=tempfile.mkdtemp(prefix='djangotest_search_')) @skipIf(getattr(settings, 'NO_SEARCH_INDEX', False), - u'Requires search server and NO_SEARCH_INDEX=False.') + 'Requires search server and NO_SEARCH_INDEX=False.') class BookSearchTests(WLTestCase): def setUp(self): WLTestCase.setUp(self) @@ -32,7 +31,7 @@ class BookSearchTests(WLTestCase): # TODO: Add slop option to sunburnt # def test_search_perfect_parts(self): - # books = self.search.search_phrase(u"Jakoż hamować") + # books = self.search.search_phrase("Jakoż hamować") # assert len(books) == 2 # for b in books: # b.book_id == self.book.id diff --git a/src/search/urls.py b/src/search/urls.py index 46914d6d2..980f5e865 100644 --- a/src/search/urls.py +++ b/src/search/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/search/views.py b/src/search/views.py index 3bbe720b0..2fe94f431 100644 --- a/src/search/views.py +++ b/src/search/views.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -119,7 +118,7 @@ def main(request): pd_authors = search_pd_authors(query) books = search_books(query) pictures = search_pictures(query) - suggestion = u'' + suggestion = '' if not (books or pictures or pd_authors): form = PublishingSuggestForm(initial={"books": query + ", "}) diff --git a/src/social/api/urls.py b/src/social/api/urls.py index 5c633d805..2ed2d66d1 100644 --- a/src/social/api/urls.py +++ b/src/social/api/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/social/api/views.py b/src/social/api/views.py index 1be521044..ff6a08f32 100644 --- a/src/social/api/views.py +++ b/src/social/api/views.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/social/migrations/0001_initial.py b/src/social/migrations/0001_initial.py index 056918bee..a0e3bae7e 100644 --- a/src/social/migrations/0001_initial.py +++ b/src/social/migrations/0001_initial.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations import django.db.models.deletion diff --git a/src/social/migrations/0002_auto_20151221_1225.py b/src/social/migrations/0002_auto_20151221_1225.py index f26e4f8fc..eac8e6aad 100644 --- a/src/social/migrations/0002_auto_20151221_1225.py +++ b/src/social/migrations/0002_auto_20151221_1225.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/social/migrations/0003_cite_banner.py b/src/social/migrations/0003_cite_banner.py index 0aaea6dc3..76f00bdaf 100644 --- a/src/social/migrations/0003_cite_banner.py +++ b/src/social/migrations/0003_cite_banner.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/social/migrations/0004_auto_20170725_1204.py b/src/social/migrations/0004_auto_20170725_1204.py index fb79d8a44..2ff02d284 100644 --- a/src/social/migrations/0004_auto_20170725_1204.py +++ b/src/social/migrations/0004_auto_20170725_1204.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/social/migrations/0005_auto_20190318_1309.py b/src/social/migrations/0005_auto_20190318_1309.py index 3391fabe5..a4167e1e0 100644 --- a/src/social/migrations/0005_auto_20190318_1309.py +++ b/src/social/migrations/0005_auto_20190318_1309.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-03-18 12:09 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models import django.db.models.deletion diff --git a/src/social/migrations/0006_legacy_group.py b/src/social/migrations/0006_legacy_group.py index f6881a322..cc7d8d103 100644 --- a/src/social/migrations/0006_legacy_group.py +++ b/src/social/migrations/0006_legacy_group.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations diff --git a/src/social/migrations/0007_auto_20190318_1339.py b/src/social/migrations/0007_auto_20190318_1339.py index 0f3fdae31..973294ea2 100644 --- a/src/social/migrations/0007_auto_20190318_1339.py +++ b/src/social/migrations/0007_auto_20190318_1339.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-03-18 12:39 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models import django.db.models.deletion diff --git a/src/social/migrations/0008_auto_20190403_1510.py b/src/social/migrations/0008_auto_20190403_1510.py index 639831672..ea7fefab6 100644 --- a/src/social/migrations/0008_auto_20190403_1510.py +++ b/src/social/migrations/0008_auto_20190403_1510.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-04-03 13:10 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations diff --git a/src/social/migrations/0009_auto_20190715_1405.py b/src/social/migrations/0009_auto_20190715_1405.py index f8c140044..ebc2ccde8 100644 --- a/src/social/migrations/0009_auto_20190715_1405.py +++ b/src/social/migrations/0009_auto_20190715_1405.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-07-15 12:05 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/social/migrations/0010_cite_background_plain.py b/src/social/migrations/0010_cite_background_plain.py index 54715ab81..2d1f5255d 100644 --- a/src/social/migrations/0010_cite_background_plain.py +++ b/src/social/migrations/0010_cite_background_plain.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-07-15 12:12 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/social/models.py b/src/social/models.py index b8f50abba..29029ee6b 100644 --- a/src/social/models.py +++ b/src/social/models.py @@ -6,7 +6,7 @@ from django.db import models from django.conf import settings from django.core.exceptions import ValidationError from django.urls import reverse -from django.utils.translation import ugettext_lazy as _, string_concat +from django.utils.translation import ugettext_lazy as _ from catalogue.models import Book from wolnelektury.utils import cached_render, clear_cached_renders @@ -53,7 +53,9 @@ class Cite(models.Model): sticky = models.BooleanField(_('sticky'), default=False, db_index=True, help_text=_('Sticky cites will take precedense.')) - banner = models.BooleanField(_('banner'), default=False, help_text=string_concat(_('Adjust size to image, ignore the text'), '
    (Przestarzałe; użyj funkcji "Obraz" w sekcji "Media box")')) + banner = models.BooleanField(_('banner'), default=False, help_text= + 'Dostosuj wielkość do obrazu tła, zignoruj tekst.' + '
    (Przestarzałe; użyj funkcji "Obraz" w sekcji "Media box")') background_plain = models.BooleanField(_('plain background'), default=False) background_color = models.CharField(_('background color'), max_length=32, blank=True) @@ -62,7 +64,8 @@ class Cite(models.Model): help_text=_('Best image is exactly 975px wide and weights under 100kB.')) image_shift = models.IntegerField( _('shift'), null=True, blank=True, - help_text=string_concat(_('Vertical shift, in percents. 0 means top, 100 is bottom. Default is 50%.'), '
    (Przestarzałe; użyj obrazka o właściwych proporcjach;)')) + help_text='Przesunięcie w pionie, w procentach. 0 to wyrównanie do górnej krawędzi, 100 do dolnej. Domyślne jest 50%.' + '
    (Przestarzałe; użyj obrazka o właściwych proporcjach;)') image_title = models.CharField(_('title'), max_length=255, null=True, blank=True) image_author = models.CharField(_('author'), max_length=255, blank=True, null=True) image_link = models.URLField(_('link'), blank=True, null=True) diff --git a/src/sortify.py b/src/sortify.py index 58807bb01..027860186 100644 --- a/src/sortify.py +++ b/src/sortify.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import re from fnpdjango.utils.text import char_map diff --git a/src/sponsors/__init__.py b/src/sponsors/__init__.py index f6a851dc5..c583e6eed 100644 --- a/src/sponsors/__init__.py +++ b/src/sponsors/__init__.py @@ -1,6 +1,5 @@ -# -*- 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. # -__author__ = u'Marek Stępniowski, ' +__author__ = 'Marek Stępniowski, ' __version__ = '0.1' diff --git a/src/sponsors/migrations/0001_initial.py b/src/sponsors/migrations/0001_initial.py index 5f4b523f1..4f5e46847 100644 --- a/src/sponsors/migrations/0001_initial.py +++ b/src/sponsors/migrations/0001_initial.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations diff --git a/src/sponsors/migrations/0002_auto_20151221_1225.py b/src/sponsors/migrations/0002_auto_20151221_1225.py index 0110a8896..f0cf69686 100644 --- a/src/sponsors/migrations/0002_auto_20151221_1225.py +++ b/src/sponsors/migrations/0002_auto_20151221_1225.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/sponsors/widgets.py b/src/sponsors/widgets.py index 7d537996e..3e2dc7832 100644 --- a/src/sponsors/widgets.py +++ b/src/sponsors/widgets.py @@ -20,12 +20,12 @@ class SponsorPageWidget(forms.Textarea): 'all': (settings.STATIC_URL + 'sponsors/css/footer_admin.css',), } - def render(self, name, value, attrs=None): - output = [super(SponsorPageWidget, self).render(name, value, attrs)] + def render(self, name, value, attrs=None, renderer=None): + output = [super(SponsorPageWidget, self).render(name, value, attrs, renderer)] sponsors = [(str(obj), obj.pk, obj.logo.url) for obj in models.Sponsor.objects.all().iterator()] sponsors_js = ', '.join('{name: "%s", id: %d, image: "%s"}' % sponsor for sponsor in sponsors) output.append('\n' % (name, sponsors_js)) - return mark_safe(u''.join(output)) + output.append('$("#id_%s").sponsorsFooter({sponsors: [%s]}); });\n' % (name, sponsors_js)) + return mark_safe(''.join(output)) diff --git a/src/stats/tasks.py b/src/stats/tasks.py index cb2ec8363..d0aeb7ae5 100644 --- a/src/stats/tasks.py +++ b/src/stats/tasks.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -23,7 +22,7 @@ except AttributeError: @task(ignore_result=True) def track_request(piwik_args): - piwik_url = "%s%s%s" % (settings.PIWIK_URL, u"/piwik.php?", piwik_args) + piwik_url = "%s%s%s" % (settings.PIWIK_URL, "/piwik.php?", piwik_args) conn = HTTPConnection(_host) conn.request('GET', piwik_url) conn.close() diff --git a/src/suggest/admin.py b/src/suggest/admin.py index b76b621d7..7c7159d97 100644 --- a/src/suggest/admin.py +++ b/src/suggest/admin.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/suggest/forms.py b/src/suggest/forms.py index 90d3b9896..952c4fe5c 100644 --- a/src/suggest/forms.py +++ b/src/suggest/forms.py @@ -20,7 +20,7 @@ class SuggestForm(NewsletterForm): contact = forms.CharField(label=_('Contact'), max_length=120, required=False) description = forms.CharField(label=_('Description'), widget=forms.Textarea, required=True) - data_processing_part2 = u'''\ + data_processing_part2 = '''\ Dane są przetwarzane w zakresie niezbędnym do obsługi zgłoszenia. W przypadku wyrażenia dodatkowej zgody \ adres e-mail zostanie wykorzystany także w celu przesyłania newslettera Wolnych Lektur.''' @@ -34,7 +34,7 @@ adres e-mail zostanie wykorzystany także w celu przesyłania newslettera Wolnyc suggestion.user = request.user suggestion.save() - mail_managers(u'Nowa sugestia na stronie WolneLektury.pl', u'''\ + mail_managers('Nowa sugestia na stronie WolneLektury.pl', '''\ Zgłoszono nową sugestię w serwisie WolneLektury.pl. http://%(site)s%(url)s @@ -55,8 +55,8 @@ Kontakt: %(contact)s pass else: send_noreply_mail( - ugettext(u'Thank you for your suggestion.'), - ugettext(u"""\ + ugettext('Thank you for your suggestion.'), + ugettext("""\ Thank you for your comment on WolneLektury.pl. The suggestion has been referred to the project coordinator."""), [contact], fail_silently=True) @@ -73,7 +73,7 @@ class PublishingSuggestForm(NewsletterForm): def clean(self): if not self.cleaned_data['ebook'] and not self.cleaned_data['audiobook']: - msg = ugettext(u"One of these options is required.") + msg = ugettext("One of these options is required.") self._errors['ebook'] = self.error_class([msg]) self._errors['audiobook'] = self.error_class([msg]) return super(PublishingSuggestForm, self).clean() @@ -94,7 +94,7 @@ class PublishingSuggestForm(NewsletterForm): suggestion.save() if not suggestion.is_spam(): - mail_managers(u'Konsultacja planu wydawniczego na WolneLektury.pl', u'''\ + mail_managers('Konsultacja planu wydawniczego na WolneLektury.pl', '''\ Zgłoszono nową sugestię nt. planu wydawniczego w serwisie WolneLektury.pl. %(url)s @@ -119,8 +119,8 @@ class PublishingSuggestForm(NewsletterForm): pass else: send_noreply_mail( - ugettext(u'Thank you for your suggestion.'), - ugettext(u"""\ + ugettext('Thank you for your suggestion.'), + ugettext("""\ Thank you for your comment on WolneLektury.pl. The suggestion has been referred to the project coordinator."""), [contact], fail_silently=True) diff --git a/src/suggest/migrations/0001_initial.py b/src/suggest/migrations/0001_initial.py index 6e43ed17c..e61375afc 100644 --- a/src/suggest/migrations/0001_initial.py +++ b/src/suggest/migrations/0001_initial.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations import django.db.models.deletion from django.conf import settings diff --git a/src/suggest/migrations/0002_auto_20151221_1225.py b/src/suggest/migrations/0002_auto_20151221_1225.py index 126808b68..c8eece615 100644 --- a/src/suggest/migrations/0002_auto_20151221_1225.py +++ b/src/suggest/migrations/0002_auto_20151221_1225.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/suggest/migrations/0003_auto_20190729_1450.py b/src/suggest/migrations/0003_auto_20190729_1450.py index 6d0a3f445..505c4b073 100644 --- a/src/suggest/migrations/0003_auto_20190729_1450.py +++ b/src/suggest/migrations/0003_auto_20190729_1450.py @@ -1,7 +1,6 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.20 on 2019-07-29 12:50 -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.conf import settings from django.db import migrations, models import django.db.models.deletion diff --git a/src/suggest/urls.py b/src/suggest/urls.py index 167a1a82f..4a03a0d35 100644 --- a/src/suggest/urls.py +++ b/src/suggest/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/waiter/__init__.py b/src/waiter/__init__.py index 9c83ee36e..62097829a 100644 --- a/src/waiter/__init__.py +++ b/src/waiter/__init__.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/waiter/migrations/0001_initial.py b/src/waiter/migrations/0001_initial.py index a579d6efb..90ce6e964 100644 --- a/src/waiter/migrations/0001_initial.py +++ b/src/waiter/migrations/0001_initial.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations import picklefield.fields diff --git a/src/waiter/settings.py b/src/waiter/settings.py index 15fb7ef83..c5cb32832 100644 --- a/src/waiter/settings.py +++ b/src/waiter/settings.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/waiter/tasks.py b/src/waiter/tasks.py index 89db402a3..0961b3891 100644 --- a/src/waiter/tasks.py +++ b/src/waiter/tasks.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/waiter/urls.py b/src/waiter/urls.py index 51d5f6e95..ffe9805f4 100644 --- a/src/waiter/urls.py +++ b/src/waiter/urls.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/waiter/utils.py b/src/waiter/utils.py index 68d21bd79..a08ee1548 100644 --- a/src/waiter/utils.py +++ b/src/waiter/utils.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/waiter/views.py b/src/waiter/views.py index 836534e32..b001fef1b 100644 --- a/src/waiter/views.py +++ b/src/waiter/views.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/wolnelektury/__init__.py b/src/wolnelektury/__init__.py index c37925093..2d0acdbf5 100644 --- a/src/wolnelektury/__init__.py +++ b/src/wolnelektury/__init__.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/wolnelektury/apps.py b/src/wolnelektury/apps.py index a75fd0ca7..d1535d37c 100644 --- a/src/wolnelektury/apps.py +++ b/src/wolnelektury/apps.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/wolnelektury/celery.py b/src/wolnelektury/celery.py index 23bf6dcb3..1aa0b2e0c 100644 --- a/src/wolnelektury/celery.py +++ b/src/wolnelektury/celery.py @@ -1,9 +1,6 @@ -# -*- 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. # -from __future__ import absolute_import - import os from celery import Celery from django.conf import settings diff --git a/src/wolnelektury/contact_forms.py b/src/wolnelektury/contact_forms.py index 6d436a033..9eb87ffa7 100644 --- a/src/wolnelektury/contact_forms.py +++ b/src/wolnelektury/contact_forms.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -14,220 +13,220 @@ mark_safe_lazy = lazy(mark_safe, str) class KonkursForm(ContactForm): form_tag = 'konkurs' - form_title = u"Konkurs Trzy strony" + form_title = "Konkurs Trzy strony" admin_list = ['podpis', 'contact', 'temat'] ends_on = (2017, 11, 8) disabled_template = 'contact/disabled_contact_form.html' - opiekun_header = HeaderField(label=u'Dane\xa0Opiekuna/Opiekunki') - opiekun_nazwisko = forms.CharField(label=u'Imię i nazwisko', max_length=128) - contact = forms.EmailField(label=u'Adres e-mail', max_length=128) - opiekun_tel = forms.CharField(label=u'Numer telefonu', max_length=32) - nazwa_dkk = forms.CharField(label=u'Nazwa DKK', max_length=128) - adres_dkk = forms.CharField(label=u'Adres DKK', max_length=128) - - uczestnik_header = HeaderField(label=u'Dane\xa0Uczestnika/Uczestniczki') - uczestnik_imie = forms.CharField(label=u'Imię', max_length=128) - uczestnik_nazwisko = forms.CharField(label=u'Nazwisko', max_length=128) - uczestnik_email = forms.EmailField(label=u'Adres e-mail', max_length=128) - wiek = forms.ChoiceField(label=u'Kategoria wiekowa', choices=( + opiekun_header = HeaderField(label='Dane\xa0Opiekuna/Opiekunki') + opiekun_nazwisko = forms.CharField(label='Imię i nazwisko', max_length=128) + contact = forms.EmailField(label='Adres e-mail', max_length=128) + opiekun_tel = forms.CharField(label='Numer telefonu', max_length=32) + nazwa_dkk = forms.CharField(label='Nazwa DKK', max_length=128) + adres_dkk = forms.CharField(label='Adres DKK', max_length=128) + + uczestnik_header = HeaderField(label='Dane\xa0Uczestnika/Uczestniczki') + uczestnik_imie = forms.CharField(label='Imię', max_length=128) + uczestnik_nazwisko = forms.CharField(label='Nazwisko', max_length=128) + uczestnik_email = forms.EmailField(label='Adres e-mail', max_length=128) + wiek = forms.ChoiceField(label='Kategoria wiekowa', choices=( ('0-11', 'do 11 lat'), ('12-15', '12–15 lat'), ('16-19', '16–19 lat'), )) - tytul = forms.CharField(label=u'Tytuł opowiadania', max_length=255) + tytul = forms.CharField(label='Tytuł opowiadania', max_length=255) plik = forms.FileField( - label=u'Plik z opowiadaniem', - help_text=u'Prosimy o nazwanie pliku imieniem i nazwiskiem autora.') + label='Plik z opowiadaniem', + help_text='Prosimy o nazwanie pliku imieniem i nazwiskiem autora.') - agree_header = HeaderField(label=u'Oświadczenia') + agree_header = HeaderField(label='Oświadczenia') agree_terms = forms.BooleanField( label='Regulamin', help_text=mark_safe_lazy( - u'Znam i akceptuję ' - u'Regulamin Konkursu.'), + 'Znam i akceptuję ' + 'Regulamin Konkursu.'), ) agree_data = forms.BooleanField( label='Przetwarzanie danych osobowych', - help_text=u'Oświadczam, że wyrażam zgodę na przetwarzanie danych osobowych zawartych w niniejszym formularzu ' - u'zgłoszeniowym przez Fundację Nowoczesna Polska (administratora danych) z siedzibą w Warszawie (00-514) ' - u'przy ul. Marszałkowskiej 84/92 lok. 125 na potrzeby organizacji Konkursu. Jednocześnie oświadczam, ' - u'że zostałam/em poinformowana/y o tym, że mam prawo wglądu w treść swoich danych i możliwość ich ' - u'poprawiania oraz że ich podanie jest dobrowolne, ale niezbędne do dokonania zgłoszenia.') + help_text='Oświadczam, że wyrażam zgodę na przetwarzanie danych osobowych zawartych w niniejszym formularzu ' + 'zgłoszeniowym przez Fundację Nowoczesna Polska (administratora danych) z siedzibą w Warszawie (00-514) ' + 'przy ul. Marszałkowskiej 84/92 lok. 125 na potrzeby organizacji Konkursu. Jednocześnie oświadczam, ' + 'że zostałam/em poinformowana/y o tym, że mam prawo wglądu w treść swoich danych i możliwość ich ' + 'poprawiania oraz że ich podanie jest dobrowolne, ale niezbędne do dokonania zgłoszenia.') agree_license = forms.BooleanField( label='Licencja', help_text=mark_safe_lazy( - u'Wyrażam zgodę oraz potwierdzam, że autor/ka (lub ich przedstawiciele ustawowi – gdy dotyczy) ' - u'wyrazili zgodę na korzystanie z opowiadania zgodnie z postanowieniami wolnej licencji ' - u'Creative Commons Uznanie autorstwa – ' - u'Na tych samych warunkach 3.0. Licencja pozwala każdemu na swobodne, nieodpłatne korzystanie z utworu ' - u'w oryginale oraz w postaci opracowań do wszelkich celów wymagając poszanowania autorstwa i innych praw ' - u'osobistych oraz tego, aby ewentualne opracowania utworu były także udostępniane na tej samej licencji.')) + 'Wyrażam zgodę oraz potwierdzam, że autor/ka (lub ich przedstawiciele ustawowi – gdy dotyczy) ' + 'wyrazili zgodę na korzystanie z opowiadania zgodnie z postanowieniami wolnej licencji ' + 'Creative Commons Uznanie autorstwa – ' + 'Na tych samych warunkach 3.0. Licencja pozwala każdemu na swobodne, nieodpłatne korzystanie z utworu ' + 'w oryginale oraz w postaci opracowań do wszelkich celów wymagając poszanowania autorstwa i innych praw ' + 'osobistych oraz tego, aby ewentualne opracowania utworu były także udostępniane na tej samej licencji.')) agree_wizerunek = forms.BooleanField( label='Rozpowszechnianie wizerunku', - help_text=u'Wyrażam zgodę oraz potwierdzam, że autor/ka opowiadania (lub ich przedstawiciele ustawowi – ' - u'gdy dotyczy) wyrazili zgodę na fotografowanie i nagrywanie podczas gali wręczenia nagród i następnie ' - u'rozpowszechnianie ich wizerunków.') + help_text='Wyrażam zgodę oraz potwierdzam, że autor/ka opowiadania (lub ich przedstawiciele ustawowi – ' + 'gdy dotyczy) wyrazili zgodę na fotografowanie i nagrywanie podczas gali wręczenia nagród i następnie ' + 'rozpowszechnianie ich wizerunków.') class CoJaCzytamForm(ContactForm): form_tag = 'cojaczytam' - form_title = u"#cojaczytam?" + form_title = "#cojaczytam?" admin_list = ['opiekun_nazwisko', 'contact', 'nazwa_kampanii'] # ends_on = (2018, 11, 16) disabled_template = 'contact/disabled_contact_form.html' - submit_label = u'Wyślij' + submit_label = 'Wyślij' - opiekun_nazwisko = forms.CharField(label=u'Imię i nazwisko Opiekuna/ki', max_length=128) - contact = forms.EmailField(label=u'Adres e-mail Opiekuna/ki', max_length=128) - opiekun_tel = forms.CharField(label=u'Numer telefonu Opiekuna/ki', max_length=32) - nazwa_dkk = forms.CharField(label=u'Nazwa szkoły/biblioteki publicznej', max_length=128) - adres_dkk = forms.CharField(label=u'Adres szkoły/biblioteki publicznej', max_length=128) + opiekun_nazwisko = forms.CharField(label='Imię i nazwisko Opiekuna/ki', max_length=128) + contact = forms.EmailField(label='Adres e-mail Opiekuna/ki', max_length=128) + opiekun_tel = forms.CharField(label='Numer telefonu Opiekuna/ki', max_length=32) + nazwa_dkk = forms.CharField(label='Nazwa szkoły/biblioteki publicznej', max_length=128) + adres_dkk = forms.CharField(label='Adres szkoły/biblioteki publicznej', max_length=128) - nazwa_kampanii = forms.CharField(label=u'Nazwa kampanii', max_length=255) + nazwa_kampanii = forms.CharField(label='Nazwa kampanii', max_length=255) - wiek = forms.ChoiceField(label=u'Grupa wiekowa', choices=( - ('9-14', u'uczniowie kl. IV-VIII szkół podstawowych w wieku 9-14 lat,'), - ('15-19', u'uczniowie gimnazjum oraz wszystkich typów szkół ponadpodstawowych w wieku 15-19.'), + wiek = forms.ChoiceField(label='Grupa wiekowa', choices=( + ('9-14', 'uczniowie kl. IV-VIII szkół podstawowych w wieku 9-14 lat,'), + ('15-19', 'uczniowie gimnazjum oraz wszystkich typów szkół ponadpodstawowych w wieku 15-19.'), ), widget=forms.RadioSelect) - uczestnik1_header = HeaderField(label=u'Dane\xa0Uczestników (3 do 5)') - uczestnik1_imie = forms.CharField(label=u'Imię', max_length=128) - uczestnik1_nazwisko = forms.CharField(label=u'Nazwisko', max_length=128) - uczestnik1_email = forms.EmailField(label=u'Adres e-mail', max_length=128) - uczestnik2_header = HeaderField(label=u'') - uczestnik2_imie = forms.CharField(label=u'Imię', max_length=128) - uczestnik2_nazwisko = forms.CharField(label=u'Nazwisko', max_length=128) - uczestnik2_email = forms.EmailField(label=u'Adres e-mail', max_length=128) - uczestnik3_header = HeaderField(label=u'') - uczestnik3_imie = forms.CharField(label=u'Imię', max_length=128) - uczestnik3_nazwisko = forms.CharField(label=u'Nazwisko', max_length=128) - uczestnik3_email = forms.EmailField(label=u'Adres e-mail', max_length=128) - uczestnik4_header = HeaderField(label=u'') - uczestnik4_imie = forms.CharField(label=u'Imię', max_length=128, required=False) - uczestnik4_nazwisko = forms.CharField(label=u'Nazwisko', max_length=128, required=False) - uczestnik4_email = forms.EmailField(label=u'Adres e-mail', max_length=128, required=False) - uczestnik5_header = HeaderField(label=u'') - uczestnik5_imie = forms.CharField(label=u'Imię', max_length=128, required=False) - uczestnik5_nazwisko = forms.CharField(label=u'Nazwisko', max_length=128, required=False) - uczestnik5_email = forms.EmailField(label=u'Adres e-mail', max_length=128, required=False) - - ankieta_header = HeaderField(label=u'') + uczestnik1_header = HeaderField(label='Dane\xa0Uczestników (3 do 5)') + uczestnik1_imie = forms.CharField(label='Imię', max_length=128) + uczestnik1_nazwisko = forms.CharField(label='Nazwisko', max_length=128) + uczestnik1_email = forms.EmailField(label='Adres e-mail', max_length=128) + uczestnik2_header = HeaderField(label='') + uczestnik2_imie = forms.CharField(label='Imię', max_length=128) + uczestnik2_nazwisko = forms.CharField(label='Nazwisko', max_length=128) + uczestnik2_email = forms.EmailField(label='Adres e-mail', max_length=128) + uczestnik3_header = HeaderField(label='') + uczestnik3_imie = forms.CharField(label='Imię', max_length=128) + uczestnik3_nazwisko = forms.CharField(label='Nazwisko', max_length=128) + uczestnik3_email = forms.EmailField(label='Adres e-mail', max_length=128) + uczestnik4_header = HeaderField(label='') + uczestnik4_imie = forms.CharField(label='Imię', max_length=128, required=False) + uczestnik4_nazwisko = forms.CharField(label='Nazwisko', max_length=128, required=False) + uczestnik4_email = forms.EmailField(label='Adres e-mail', max_length=128, required=False) + uczestnik5_header = HeaderField(label='') + uczestnik5_imie = forms.CharField(label='Imię', max_length=128, required=False) + uczestnik5_nazwisko = forms.CharField(label='Nazwisko', max_length=128, required=False) + uczestnik5_email = forms.EmailField(label='Adres e-mail', max_length=128, required=False) + + ankieta_header = HeaderField(label='') opis_kampanii = forms.CharField( - label=u'Krótki opis realizacji oraz przebiegu kampanii', max_length=255, widget=forms.Textarea) - co_sie_udalo = forms.CharField(label=u'Co udało Wam się zrealizować?', max_length=1024, widget=forms.Textarea) + label='Krótki opis realizacji oraz przebiegu kampanii', max_length=255, widget=forms.Textarea) + co_sie_udalo = forms.CharField(label='Co udało Wam się zrealizować?', max_length=1024, widget=forms.Textarea) co_sie_nie_udalo = forms.CharField( - label=u'Czy jest coś, co chcieliście zrealizować, a się nie udało? Jeśli tak, to dlaczego?', max_length=1024, + label='Czy jest coś, co chcieliście zrealizować, a się nie udało? Jeśli tak, to dlaczego?', max_length=1024, widget=forms.Textarea) wnioski = forms.CharField( - label=u'Jakie wnioski na przyszłość wyciągnęliście z tego, czego się nie udało zrealizować?', max_length=1024, + label='Jakie wnioski na przyszłość wyciągnęliście z tego, czego się nie udało zrealizować?', max_length=1024, widget=forms.Textarea) zasieg = forms.CharField( - label=u'Do ilu odbiorców udało Wam się dotrzeć z Waszą kompanią? Podaj liczbę, może być szacunkowa.', + label='Do ilu odbiorców udało Wam się dotrzeć z Waszą kompanią? Podaj liczbę, może być szacunkowa.', max_length=1024, widget=forms.Textarea) grupy_odbiorcow = forms.CharField( - label=u'Do jakich grup odbiorców dotarliście (np. uczniowie, nauczyciele, rodzice, seniorzy, inni)?', + label='Do jakich grup odbiorców dotarliście (np. uczniowie, nauczyciele, rodzice, seniorzy, inni)?', max_length=1024, widget=forms.Textarea) plik = forms.FileField( - label=u'Plik .zip ze stworzonymi materiałami (np. zdjęcia, dokumenty tekstowe)') + label='Plik .zip ze stworzonymi materiałami (np. zdjęcia, dokumenty tekstowe)') materialy = forms.CharField( - label=u'Adresy stworzonych materiałów online (jeśli dotyczy)', max_length=1024, widget=forms.Textarea, + label='Adresy stworzonych materiałów online (jeśli dotyczy)', max_length=1024, widget=forms.Textarea, required=False) - agree_header = HeaderField(label=u'Oświadczenia') + agree_header = HeaderField(label='Oświadczenia') agree_terms = forms.BooleanField( label='Regulamin', help_text=mark_safe_lazy( - u'Znam i akceptuję ' - u'Regulamin Konkursu.'), + 'Znam i akceptuję ' + 'Regulamin Konkursu.'), ) agree_data = forms.BooleanField( label='Przetwarzanie danych osobowych', - help_text=u'Oświadczam, że wyrażam zgodę na przetwarzanie danych osobowych zawartych w niniejszym formularzu ' - u'zgłoszeniowym przez Fundację Nowoczesna Polska (administratora danych) z siedzibą w Warszawie (00-514) ' - u'przy ul. Marszałkowskiej 84/92 lok. 125 na potrzeby organizacji Konkursu. Jednocześnie oświadczam, ' - u'że zostałam/em poinformowana/y o tym, że mam prawo wglądu w treść swoich danych i możliwość ich ' - u'poprawiania oraz że ich podanie jest dobrowolne, ale niezbędne do dokonania zgłoszenia.') + help_text='Oświadczam, że wyrażam zgodę na przetwarzanie danych osobowych zawartych w niniejszym formularzu ' + 'zgłoszeniowym przez Fundację Nowoczesna Polska (administratora danych) z siedzibą w Warszawie (00-514) ' + 'przy ul. Marszałkowskiej 84/92 lok. 125 na potrzeby organizacji Konkursu. Jednocześnie oświadczam, ' + 'że zostałam/em poinformowana/y o tym, że mam prawo wglądu w treść swoich danych i możliwość ich ' + 'poprawiania oraz że ich podanie jest dobrowolne, ale niezbędne do dokonania zgłoszenia.') agree_license = forms.BooleanField( label='Licencja', help_text=mark_safe_lazy( - u'Wyrażam zgodę oraz potwierdzam, że uczestnicy (lub ich przedstawiciele ustawowi – gdy dotyczy) ' - u'wyrazili zgodę na korzystanie ze stworzonych materiałów zgodnie z postanowieniami ' - u'wolnej licencji, takiej jak ' - u'Creative Commons Uznanie autorstwa – ' - u'Na tych samych warunkach 3.0 PL. Licencja pozwala każdemu na swobodne, nieodpłatne korzystanie ' - u'z utworu ' - u'w oryginale oraz w postaci opracowań do wszelkich celów wymagając poszanowania autorstwa i innych praw ' - u'osobistych oraz tego, aby ewentualne opracowania utworu były także udostępniane na tej samej licencji.')) + 'Wyrażam zgodę oraz potwierdzam, że uczestnicy (lub ich przedstawiciele ustawowi – gdy dotyczy) ' + 'wyrazili zgodę na korzystanie ze stworzonych materiałów zgodnie z postanowieniami ' + 'wolnej licencji, takiej jak ' + 'Creative Commons Uznanie autorstwa – ' + 'Na tych samych warunkach 3.0 PL. Licencja pozwala każdemu na swobodne, nieodpłatne korzystanie ' + 'z utworu ' + 'w oryginale oraz w postaci opracowań do wszelkich celów wymagając poszanowania autorstwa i innych praw ' + 'osobistych oraz tego, aby ewentualne opracowania utworu były także udostępniane na tej samej licencji.')) agree_wizerunek = forms.BooleanField( label='Rozpowszechnianie wizerunku', - help_text=u'Wyrażam zgodę oraz potwierdzam, że uczestnicy (lub ich przedstawiciele ustawowi – gdy dotyczy) ' - u'wyrazili zgodę na fotografowanie oraz nagrywanie, a następnie rozpowszechnianie ich ' - u'wizerunków w celach promocyjnych.') + help_text='Wyrażam zgodę oraz potwierdzam, że uczestnicy (lub ich przedstawiciele ustawowi – gdy dotyczy) ' + 'wyrazili zgodę na fotografowanie oraz nagrywanie, a następnie rozpowszechnianie ich ' + 'wizerunków w celach promocyjnych.') class WorkshopsForm(ContactForm): form_tag = 'warsztaty' - form_title = u"Wolne Lektury Fest" - nazwisko = forms.CharField(label=u'Imię i nazwisko uczestnika', max_length=128) - instytucja = forms.CharField(label=u'Instytucja/organizacja', max_length=128, required=False) - contact = forms.EmailField(label=u'Adres e-mail', max_length=128) - tel = forms.CharField(label=u'Numer telefonu', max_length=32) + form_title = "Wolne Lektury Fest" + nazwisko = forms.CharField(label='Imię i nazwisko uczestnika', max_length=128) + instytucja = forms.CharField(label='Instytucja/organizacja', max_length=128, required=False) + contact = forms.EmailField(label='Adres e-mail', max_length=128) + tel = forms.CharField(label='Numer telefonu', max_length=32) warsztat = forms.ChoiceField(choices=( - ('skad-i-jak', u'Skąd i jak bezpiecznie korzystać z darmowych i wolnych wideo i zdjęć w sieci? ' - u'Jak wykorzystać wolne licencje by zwiększyć zasięg Twoich publikacji?'), - ('jak-badac', u'Jak badać wykorzystanie zbiorów domeny publicznej?'), - ('kultura', u'Kultura dostępna dla wszystkich')), + ('skad-i-jak', 'Skąd i jak bezpiecznie korzystać z darmowych i wolnych wideo i zdjęć w sieci? ' + 'Jak wykorzystać wolne licencje by zwiększyć zasięg Twoich publikacji?'), + ('jak-badac', 'Jak badać wykorzystanie zbiorów domeny publicznej?'), + ('kultura', 'Kultura dostępna dla wszystkich')), widget=forms.RadioSelect, ) - agree_header = HeaderField(label=mark_safe_lazy(u'Oświadczenia')) + agree_header = HeaderField(label=mark_safe_lazy('Oświadczenia')) agree_data = forms.BooleanField( label='Przetwarzanie danych osobowych', - help_text=u'Oświadczam, że wyrażam zgodę na przetwarzanie danych osobowych zawartych w niniejszym formularzu ' - u'zgłoszeniowym przez Fundację Nowoczesna Polska (administratora danych) z siedzibą w Warszawie (00-514) ' - u'przy ul. Marszałkowskiej 84/92 lok. 125 na potrzeby organizacji warsztatów w ramach wydarzenia ' - u'„WOLNE LEKTURY FEST”. Jednocześnie oświadczam, że zostałam/em poinformowana/y o tym, że mam prawo ' - u'wglądu w treść swoich danych i możliwość ich poprawiania oraz że ich podanie jest dobrowolne, ' - u'ale niezbędne do dokonania zgłoszenia.') + help_text='Oświadczam, że wyrażam zgodę na przetwarzanie danych osobowych zawartych w niniejszym formularzu ' + 'zgłoszeniowym przez Fundację Nowoczesna Polska (administratora danych) z siedzibą w Warszawie (00-514) ' + 'przy ul. Marszałkowskiej 84/92 lok. 125 na potrzeby organizacji warsztatów w ramach wydarzenia ' + '„WOLNE LEKTURY FEST”. Jednocześnie oświadczam, że zostałam/em poinformowana/y o tym, że mam prawo ' + 'wglądu w treść swoich danych i możliwość ich poprawiania oraz że ich podanie jest dobrowolne, ' + 'ale niezbędne do dokonania zgłoszenia.') agree_wizerunek = forms.BooleanField( label='Rozpowszechnianie wizerunku', - help_text=u'Wyrażam zgodę na fotografowanie i nagrywanie podczas warsztatów „WOLNE LEKTURY FEST” ' - u'24.11.2017 roku i następnie rozpowszechnianie mojego wizerunku w celach promocyjnych.') + help_text='Wyrażam zgodę na fotografowanie i nagrywanie podczas warsztatów „WOLNE LEKTURY FEST” ' + '24.11.2017 roku i następnie rozpowszechnianie mojego wizerunku w celach promocyjnych.') agree_gala = forms.BooleanField( - label=u'Wezmę udział w uroczystej gali o godz. 19.00.', required=False) + label='Wezmę udział w uroczystej gali o godz. 19.00.', required=False) class WLFest2018Form(ContactForm): form_tag = 'wlfest2018' - form_title = u"Wolne Lektury Fest" - nazwisko = forms.CharField(label=u'Imię i nazwisko uczestnika', max_length=128) - instytucja = forms.CharField(label=u'Instytucja/organizacja', max_length=128, required=False) - contact = forms.EmailField(label=u'Adres e-mail', max_length=128) - tel = forms.CharField(label=u'Numer telefonu', max_length=32) + form_title = "Wolne Lektury Fest" + nazwisko = forms.CharField(label='Imię i nazwisko uczestnika', max_length=128) + instytucja = forms.CharField(label='Instytucja/organizacja', max_length=128, required=False) + contact = forms.EmailField(label='Adres e-mail', max_length=128) + tel = forms.CharField(label='Numer telefonu', max_length=32) warsztaty = forms.MultipleChoiceField(choices=( - ('kim-sa-odbiorcy', u'Kim są odbiorcy zdigitalizowanych zasobów kultury w Polsce? (9:30-11:30)'), - ('business-model-canvas', u'Business Model Canvas dla kultury (9:30-11:30)'), - ('jak-byc-glam', u'Jak być GLAM? Współpraca pomiędzy instytucjami kultury a Wikipedią (12:00-14:00)'), - ('wirtualne-muzea', u'Jak twórczo i zgodnie z prawem wykorzystywać zasoby dziedzictwa kulturowego ' - u'na przykładzie portalu „Wirtualne Muzea Małopolski” (12:00-14:00)'), - ('jak-legalnie-tworzyc', u'Jak legalnie tworzyć i korzystać z cudzej twórczości (15:00-17:00)'), - ('aplikacje-w-dzialaniach', u'Aplikacje w działaniach kulturalnych (15:00-17:00)')), + ('kim-sa-odbiorcy', 'Kim są odbiorcy zdigitalizowanych zasobów kultury w Polsce? (9:30-11:30)'), + ('business-model-canvas', 'Business Model Canvas dla kultury (9:30-11:30)'), + ('jak-byc-glam', 'Jak być GLAM? Współpraca pomiędzy instytucjami kultury a Wikipedią (12:00-14:00)'), + ('wirtualne-muzea', 'Jak twórczo i zgodnie z prawem wykorzystywać zasoby dziedzictwa kulturowego ' + 'na przykładzie portalu „Wirtualne Muzea Małopolski” (12:00-14:00)'), + ('jak-legalnie-tworzyc', 'Jak legalnie tworzyć i korzystać z cudzej twórczości (15:00-17:00)'), + ('aplikacje-w-dzialaniach', 'Aplikacje w działaniach kulturalnych (15:00-17:00)')), widget=forms.CheckboxSelectMultiple, ) - agree_header = HeaderField(label=mark_safe_lazy(u'Oświadczenia')) + agree_header = HeaderField(label=mark_safe_lazy('Oświadczenia')) agree_data = forms.BooleanField( label='Przetwarzanie danych osobowych', - help_text=u'Administratorem danych osobowych przetwarzanych w związku z organizacją wydarzenia ' - u'„WOLNE LEKTURY FEST” jest Fundacja Nowoczesna Polska ' - u'(ul. Marszałkowska 84/92 lok. 125, 00-514 Warszawa). Podanie danych osobowych jest konieczne ' - u'do dokonania rejestracji na wydarzenie. Dane są przetwarzane w zakresie niezbędnym ' - u'do przeprowadzenia wydarzenia, a także w celach prowadzenia statystyk, ' - u'ewaluacji i sprawozdawczości. Osobom, których dane są zbierane, przysługuje prawo dostępu ' - u'do treści swoich danych oraz ich poprawiania. Więcej informacji w polityce prywatności ' - u'(https://nowoczesnapolska.org.pl/prywatnosc/).') + help_text='Administratorem danych osobowych przetwarzanych w związku z organizacją wydarzenia ' + '„WOLNE LEKTURY FEST” jest Fundacja Nowoczesna Polska ' + '(ul. Marszałkowska 84/92 lok. 125, 00-514 Warszawa). Podanie danych osobowych jest konieczne ' + 'do dokonania rejestracji na wydarzenie. Dane są przetwarzane w zakresie niezbędnym ' + 'do przeprowadzenia wydarzenia, a także w celach prowadzenia statystyk, ' + 'ewaluacji i sprawozdawczości. Osobom, których dane są zbierane, przysługuje prawo dostępu ' + 'do treści swoich danych oraz ich poprawiania. Więcej informacji w polityce prywatności ' + '(https://nowoczesnapolska.org.pl/prywatnosc/).') agree_wizerunek = forms.BooleanField( label='Rozpowszechnianie wizerunku', - help_text=u'Wyrażam zgodę na fotografowanie i nagrywanie podczas warsztatów „WOLNE LEKTURY FEST” ' - u'28.11.2018 roku i następnie rozpowszechnianie mojego wizerunku w celach promocyjnych.') + help_text='Wyrażam zgodę na fotografowanie i nagrywanie podczas warsztatów „WOLNE LEKTURY FEST” ' + '28.11.2018 roku i następnie rozpowszechnianie mojego wizerunku w celach promocyjnych.') agree_gala = forms.BooleanField( - label=u'Wezmę udział w spotkaniu z Julią Fiedorczuk o godz. 17:30.', required=False) + label='Wezmę udział w spotkaniu z Julią Fiedorczuk o godz. 17:30.', required=False) diff --git a/src/wolnelektury/context_processors.py b/src/wolnelektury/context_processors.py index 0079ea0df..fb857baa6 100644 --- a/src/wolnelektury/context_processors.py +++ b/src/wolnelektury/context_processors.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/wolnelektury/forms.py b/src/wolnelektury/forms.py index 0eb1e973b..c3c378fe0 100644 --- a/src/wolnelektury/forms.py +++ b/src/wolnelektury/forms.py @@ -1,4 +1,6 @@ -# -*- 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. +# from allauth.socialaccount.forms import SignupForm from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User @@ -8,7 +10,7 @@ from newsletter.forms import NewsletterForm # has to be this order, because otherwise the form is lacking fields class RegistrationForm(UserCreationForm, NewsletterForm): - data_processing_part2 = u'''\ + data_processing_part2 = '''\ Dane są przetwarzane w zakresie niezbędnym do prowadzenia serwisu, a także w celach prowadzenia statystyk, \ ewaluacji i sprawozdawczości. W przypadku wyrażenia dodatkowej zgody adres e-mail zostanie wykorzystany \ także w celu przesyłania newslettera Wolnych Lektur.''' @@ -23,7 +25,7 @@ także w celu przesyłania newslettera Wolnych Lektur.''' class SocialSignupForm(NewsletterForm, SignupForm): - data_processing_part2 = u'''\ + data_processing_part2 = '''\ Dane są przetwarzane w zakresie niezbędnym do prowadzenia serwisu, a także w celach prowadzenia statystyk, \ ewaluacji i sprawozdawczości. W przypadku wyrażenia dodatkowej zgody adres e-mail zostanie wykorzystany \ także w celu przesyłania newslettera Wolnych Lektur.''' diff --git a/src/wolnelektury/management/commands/clean_social_accounts.py b/src/wolnelektury/management/commands/clean_social_accounts.py index ca7692ee1..72c297816 100644 --- a/src/wolnelektury/management/commands/clean_social_accounts.py +++ b/src/wolnelektury/management/commands/clean_social_accounts.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/wolnelektury/management/profile.py b/src/wolnelektury/management/profile.py index 6978ea831..a40e73f03 100644 --- a/src/wolnelektury/management/profile.py +++ b/src/wolnelektury/management/profile.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/wolnelektury/migrations/getpaid/0001_initial.py b/src/wolnelektury/migrations/getpaid/0001_initial.py index 1271201c7..7e0d66c0d 100644 --- a/src/wolnelektury/migrations/getpaid/0001_initial.py +++ b/src/wolnelektury/migrations/getpaid/0001_initial.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import models, migrations import django.db.models.deletion import getpaid.abstract_mixin diff --git a/src/wolnelektury/migrations/getpaid/0002_auto_20151221_1225.py b/src/wolnelektury/migrations/getpaid/0002_auto_20151221_1225.py index 8e1eba179..3cc3f480c 100644 --- a/src/wolnelektury/migrations/getpaid/0002_auto_20151221_1225.py +++ b/src/wolnelektury/migrations/getpaid/0002_auto_20151221_1225.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.db import migrations, models diff --git a/src/wolnelektury/settings/__init__.py b/src/wolnelektury/settings/__init__.py index 78b556d78..4cab2b136 100644 --- a/src/wolnelektury/settings/__init__.py +++ b/src/wolnelektury/settings/__init__.py @@ -1,4 +1,6 @@ -# -*- 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. +# # Django settings for wolnelektury project. from .apps import * from .basic import * diff --git a/src/wolnelektury/settings/auth.py b/src/wolnelektury/settings/auth.py index e704dc611..d4824999a 100644 --- a/src/wolnelektury/settings/auth.py +++ b/src/wolnelektury/settings/auth.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/wolnelektury/settings/contrib.py b/src/wolnelektury/settings/contrib.py index bf2962bf8..528688b56 100644 --- a/src/wolnelektury/settings/contrib.py +++ b/src/wolnelektury/settings/contrib.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/wolnelektury/settings/custom.py b/src/wolnelektury/settings/custom.py index fbb7ba2fd..0ac8a8a77 100644 --- a/src/wolnelektury/settings/custom.py +++ b/src/wolnelektury/settings/custom.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/wolnelektury/settings/locale.py b/src/wolnelektury/settings/locale.py index 0a4876671..16ca0c27d 100644 --- a/src/wolnelektury/settings/locale.py +++ b/src/wolnelektury/settings/locale.py @@ -1,4 +1,3 @@ -# -*- 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. # @@ -23,14 +22,14 @@ def gettext(s): return s LANGUAGES = tuple(sorted([ - ('pl', u'polski'), - ('de', u'Deutsch'), - ('en', u'English'), - ('lt', u'lietuvių'), - ('fr', u'français'), - ('ru', u'русский'), - ('es', u'español'), - ('uk', u'українська'), - # ('jp', u'日本語'), - ('it', u'italiano'), + ('pl', 'polski'), + ('de', 'Deutsch'), + ('en', 'English'), + ('lt', 'lietuvių'), + ('fr', 'français'), + ('ru', 'русский'), + ('es', 'español'), + ('uk', 'українська'), + # ('jp', '日本語'), + ('it', 'italiano'), ], key=lambda x: x[0])) diff --git a/src/wolnelektury/settings/paths.py b/src/wolnelektury/settings/paths.py index 32ab1c24f..1a167b9b6 100644 --- a/src/wolnelektury/settings/paths.py +++ b/src/wolnelektury/settings/paths.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/wolnelektury/settings/static.py b/src/wolnelektury/settings/static.py index b8b782839..6cf76662d 100644 --- a/src/wolnelektury/settings/static.py +++ b/src/wolnelektury/settings/static.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/wolnelektury/settings/test.py b/src/wolnelektury/settings/test.py index 25bd82caf..57718b854 100644 --- a/src/wolnelektury/settings/test.py +++ b/src/wolnelektury/settings/test.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from wolnelektury.settings import * THUMBNAIL_BACKEND = 'wolnelektury.test_utils.DummyThumbnailBackend' diff --git a/src/wolnelektury/signals.py b/src/wolnelektury/signals.py index d15b960b7..c698c545c 100644 --- a/src/wolnelektury/signals.py +++ b/src/wolnelektury/signals.py @@ -1,4 +1,3 @@ -# -*- 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. # diff --git a/src/wolnelektury/templatetags/blog.py b/src/wolnelektury/templatetags/blog.py index ca97e2508..cb5c2e7ea 100644 --- a/src/wolnelektury/templatetags/blog.py +++ b/src/wolnelektury/templatetags/blog.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from datetime import date from django.conf import settings from django.template import Library diff --git a/src/wolnelektury/templatetags/switch_tag.py b/src/wolnelektury/templatetags/switch_tag.py index ca6782384..d4701ab7e 100644 --- a/src/wolnelektury/templatetags/switch_tag.py +++ b/src/wolnelektury/templatetags/switch_tag.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Source: http://djangosnippets.org/snippets/967/ # Author: adurdin # Posted: August 13, 2008 diff --git a/src/wolnelektury/test_utils.py b/src/wolnelektury/test_utils.py index f22eb9898..74635176b 100644 --- a/src/wolnelektury/test_utils.py +++ b/src/wolnelektury/test_utils.py @@ -1,3 +1,6 @@ +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# class DummyThumbnailBackend: class DummyThumbnail: def __init__(self, url): diff --git a/src/wolnelektury/utils.py b/src/wolnelektury/utils.py index c9b1a18f7..b0b972657 100644 --- a/src/wolnelektury/utils.py +++ b/src/wolnelektury/utils.py @@ -118,8 +118,8 @@ def ajax(login_required=False, method=None, template=None, permission_required=N def send_noreply_mail(subject, message, recipient_list, **kwargs): send_mail( - u'[WolneLektury] ' + subject, - message + u"\n\n-- \n" + ugettext(u'Message sent automatically. Please do not reply.'), + '[WolneLektury] ' + subject, + message + "\n\n-- \n" + ugettext('Message sent automatically. Please do not reply.'), 'no-reply@wolnelektury.pl', recipient_list, **kwargs) diff --git a/src/wolnelektury/wsgi.py b/src/wolnelektury/wsgi.py index fe72d395d..5fc78fec0 100644 --- a/src/wolnelektury/wsgi.py +++ b/src/wolnelektury/wsgi.py @@ -1,4 +1,6 @@ -# -*- 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 os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wolnelektury.settings") -- 2.20.1