X-Git-Url: https://git.mdrn.pl/audio.git/blobdiff_plain/eee35e00bf0d0eb3d2a9f08f72c7052962fecbf6..f9eae91a6d2d175b2f227d7ea04ddd5994e9a95a:/src/archive/settings.py diff --git a/src/archive/settings.py b/src/archive/settings.py index 476f6c7..91921a8 100644 --- a/src/archive/settings.py +++ b/src/archive/settings.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - import os.path from django.conf import settings @@ -17,8 +15,9 @@ except AttributeError: FILES_PATH = os.path.abspath(os.path.join(settings.MEDIA_ROOT, "archive/files")) -if FILES_PATH.startswith(settings.MEDIA_ROOT): - FILES_SAVE_PATH = FILES_PATH[len(settings.MEDIA_ROOT):].lstrip('/') +_media_root = os.path.abspath(settings.MEDIA_ROOT) +if FILES_PATH.startswith(_media_root): + FILES_SAVE_PATH = FILES_PATH[len(_media_root):].lstrip('/') # here the app keeps the unmanaged (archive) files @@ -37,64 +36,40 @@ except AttributeError: "archive/final")) -# here the app keeps temporary build files -try: - BUILD_PATH = settings.ARCHIVE_BUILD_PATH -except AttributeError: - BUILD_PATH = os.path.abspath(os.path.join(settings.MEDIA_ROOT, - "archive/build")) - -# upload conf -try: - UPLOAD_HOST = settings.ARCHIVE_UPLOAD_HOST -except AttributeError: - UPLOAD_HOST = 'wolnelektury.pl' - -try: - UPLOAD_USER = settings.ARCHIVE_UPLOAD_USER -except AttributeError: - UPLOAD_USER = 'username' - -try: - UPLOAD_PASSWORD = settings.ARCHIVE_UPLOAD_PASSWORD -except AttributeError: - UPLOAD_PASSWORD = None +UPLOAD_URL = getattr( + settings, + 'ARCHIVE_UPLOAD_URL', + 'audiobooks/' +) -try: - UPLOAD_PATH = settings.ARCHIVE_UPLOAD_PATH -except AttributeError: - UPLOAD_PATH = '' try: - UPLOAD_CMD = settings.ARCHIVE_UPLOAD_CMD + PROJECT = settings.ARCHIVE_PROJECT except AttributeError: - UPLOAD_CMD = '/path/to/manage.py savemedia' + PROJECT = 'Wolne Lektury' -try: - UPLOAD_SUDO = settings.ARCHIVE_UPLOAD_SUDO -except AttributeError: - UPLOAD_SUDO = None +LICENSE = getattr( + settings, + 'ARCHIVE_LICENSE', + 'http://artlibre.org/licence/lal/pl/' +) -try: - PROJECT = settings.ARCHIVE_PROJECT -except AttributeError: - PROJECT = u'Wolne Lektury' +LICENSE_NAME = getattr( + settings, 'ARCHIVE_LICENSE_NAME', + 'Licencja Wolnej Sztuki 1.3' +) -try: - LICENSE = settings.ARCHIVE_LICENSE -except AttributeError: - LICENSE = u'http://creativecommons.org/licenses/by-sa/3.0/deed.pl' try: ORGANIZATION = settings.ARCHIVE_ORGANIZATION except AttributeError: - ORGANIZATION = u'Fundacja Nowoczesna Polska' + ORGANIZATION = 'Fundacja Nowoczesna Polska' try: ADVERT = settings.ARCHIVE_ADVERT except AttributeError: - ADVERT = u""" + ADVERT = """ Przekaż 1% podatku na rozwój Wolnych Lektur: Fundacja Nowoczesna Polska KRS 0000070056