476f6c704ac4e813d0b0b4b0bd5dd466f5b4c0c6
[audio.git] / src / archive / settings.py
1 # -*- coding: utf-8 -*-
2
3 import os.path
4 from django.conf import settings
5
6 # this is where the end user puts new files
7 try:
8     NEW_PATH = settings.ARCHIVE_NEW_PATH
9 except AttributeError:
10     NEW_PATH = os.path.abspath(os.path.join(settings.MEDIA_ROOT,
11                         "archive/new"))
12
13 # here the application keeps its managed files
14 try:
15     FILES_PATH = settings.ARCHIVE_FILES_PATH
16 except AttributeError:
17     FILES_PATH = os.path.abspath(os.path.join(settings.MEDIA_ROOT,
18                         "archive/files"))
19
20 if FILES_PATH.startswith(settings.MEDIA_ROOT):
21     FILES_SAVE_PATH = FILES_PATH[len(settings.MEDIA_ROOT):].lstrip('/')
22
23
24 # here the app keeps the unmanaged (archive) files
25 try:
26     UNMANAGED_PATH = settings.ARCHIVE_UNMANAGED_PATH
27 except AttributeError:
28     UNMANAGED_PATH = os.path.abspath(os.path.join(settings.MEDIA_ROOT,
29                         "archive/unmanaged"))
30
31
32 # here the app keeps the resulting (published) files
33 try:
34     FINAL_PATH = settings.ARCHIVE_FINAL_PATH
35 except AttributeError:
36     FINAL_PATH = os.path.abspath(os.path.join(settings.MEDIA_ROOT,
37                         "archive/final"))
38
39
40 # here the app keeps temporary build files
41 try:
42     BUILD_PATH = settings.ARCHIVE_BUILD_PATH
43 except AttributeError:
44     BUILD_PATH = os.path.abspath(os.path.join(settings.MEDIA_ROOT,
45                         "archive/build"))
46
47 # upload conf
48 try:
49     UPLOAD_HOST = settings.ARCHIVE_UPLOAD_HOST
50 except AttributeError:
51     UPLOAD_HOST = 'wolnelektury.pl'
52
53 try:
54     UPLOAD_USER = settings.ARCHIVE_UPLOAD_USER
55 except AttributeError:
56     UPLOAD_USER = 'username'
57
58 try:
59     UPLOAD_PASSWORD = settings.ARCHIVE_UPLOAD_PASSWORD
60 except AttributeError:
61     UPLOAD_PASSWORD = None
62
63 try:
64     UPLOAD_PATH = settings.ARCHIVE_UPLOAD_PATH
65 except AttributeError:
66     UPLOAD_PATH = ''
67
68 try:
69     UPLOAD_CMD = settings.ARCHIVE_UPLOAD_CMD
70 except AttributeError:
71     UPLOAD_CMD = '/path/to/manage.py savemedia'
72
73 try:
74     UPLOAD_SUDO = settings.ARCHIVE_UPLOAD_SUDO
75 except AttributeError:
76     UPLOAD_SUDO = None
77
78
79 try:
80     PROJECT = settings.ARCHIVE_PROJECT
81 except AttributeError:
82     PROJECT = u'Wolne Lektury'
83
84 try:
85     LICENSE = settings.ARCHIVE_LICENSE
86 except AttributeError:
87     LICENSE = u'http://creativecommons.org/licenses/by-sa/3.0/deed.pl'
88
89 try:
90     ORGANIZATION = settings.ARCHIVE_ORGANIZATION
91 except AttributeError:
92     ORGANIZATION = u'Fundacja Nowoczesna Polska'
93
94 try:
95     ADVERT = settings.ARCHIVE_ADVERT
96 except AttributeError:
97     ADVERT = u"""
98 Przekaż 1% podatku na rozwój Wolnych Lektur:
99 Fundacja Nowoczesna Polska
100 KRS 0000070056
101 http://nowoczesnapolska.org.pl/wesprzyj_nas/
102 """
103
104 try:
105     COVER_IMAGE = settings.ARCHIVE_COVER_IMAGE
106 except AttributeError:
107     COVER_IMAGE = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'cover.png')
108