config.py 1.41 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import pterClasses
from pterClasses import MailParticipant


class Config:
    NOT_APPROVED_SIGN = "*"
    ATTACHMENT_SIGN = "+"
    FACHGRUPPENVOLLVERSAMMLUNG_SIGN = ">"

    # Folders
    TEMPLATE_FOLDER = "templates"
    DATA_FOLDER = "data"

    OVERRIDE_ACCEPTED = False
    GREMIUM = None
    PAD_COLLECTION_URL = None

    # LDAP
    LDAP_USER = ""
    LDAP_PASSWORD = ""
    LDAP_MAIL = ""
    MAIL_DISPLAY_NAME = ""
    APPROVED_MAIL_RECEIVER = [MailParticipant("fr-info@finf.uni-hannover.de", "FR-Info")]
    PRELIMINARY_MAIL_RECEIVER = [MailParticipant("fr@finf.uni-hannover.de", "Fachrat Informatik Hannover")]

    # Grav
    GRAV_PROTOCOL_PATH = "pages/fachrat/02.protokolle/"
    IGNORED_TOPS = ["Anwesende", "Ständiges", "Termine", "Mitteilungen/Verschiedenes", "Schluss"]

    # Git
    GIT_REPO = "https://git.finf.uni-hannover.de/fachrat-informatik/website.git"
    GIT_REPO_PATH = "gravRepo"
    GIT_NAME = "pter"
    GIT_EMAIL = ""

    # Properties
    _git = None

    @property
    def git(self):
        if self._git is not None:
            return self._git
        if any(o is None for o in [self.GIT_REPO, self.GIT_REPO_PATH, self.GIT_EMAIL, self.GIT_NAME]):
            raise RuntimeError("Git is not configured correctly")

        self._git = pterClasses.GitHelper(self.GIT_REPO, self.GIT_REPO_PATH)
        self._git.config(self.GIT_EMAIL, self.GIT_NAME)
        self._git.update()
        return self._git