-
Notifications
You must be signed in to change notification settings - Fork 2
/
compy_config.py
53 lines (45 loc) · 1.6 KB
/
compy_config.py
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
50
51
52
53
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#
# ━━━━━━━━━━━━━
# ┏┓┏┓┳┳┓┏┓┓┏
# ┃ ┃┃┃┃┃┃┃┗┫
# ┗┛┗┛┛ ┗┣┛┗┛
# ━━━━━━━━━━━━━
#
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#
# Competition organization tool
# for freediving competitions.
#
# Copyright 2023 - Arno Mayrhofer
#
# Licensed under the GNU AGPL
#
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
#
# Authors:
#
# - Arno Mayrhofer
#
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
from os import path,mkdir
import logging
class CompyConfig:
def __init__(self):
self.upload_folder_ = self.initFolder(path.join(path.dirname(path.abspath(__file__)), 'uploads'))
self.storage_folder_ = self.initFolder(path.join(path.dirname(path.abspath(__file__)), 'storage'))
self.download_folder_ = self.initFolder(path.join(path.dirname(path.abspath(__file__)), 'download'))
def initFolder(self, folder):
if not path.isdir(folder):
mkdir(folder)
logging.debug("Created folder: " + folder)
return folder
@property
def upload_folder(self):
return self.upload_folder_
@property
def storage_folder(self):
return self.storage_folder_
@property
def download_folder(self):
return self.download_folder_