-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.py
75 lines (62 loc) · 2.46 KB
/
configuration.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#
# Neodym
#
# Copyright (C) by Andreas Zoglauer and contributors
# Please see the license file for more details.
#
# -----------------------------------------------------------------------------------
# Import external files
# Import neodym files
from reader import ZReader
# -----------------------------------------------------------------------------------
# Parses all the global configuration parameters
class ZConfiguration(ZReader):
# Constructor
def __init__(self):
super(ZConfiguration, self).__init__()
self.mTitle = "Neodym"
self.mSubTitle = ""
self.mDescription = ""
self.mFooter = ""
self.mMenu = []
self.mLogo = ""
self.mContentDirectory = "."
self.mTemplateDirectory = "."
self.mTargetDirectory = "public"
self.mTargetPermissions = "a+rX"
print("Config init")
def assign(self):
if "Title" in self.mDictionary:
self.mTitle = self.mDictionary["Title"]
if "SubTitle" in self.mDictionary:
self.mSubTitle = self.mDictionary["SubTitle"]
if "Description" in self.mDictionary:
self.mDescription = self.mDictionary["Description"]
if "Logo" in self.mDictionary:
self.mLogo = self.mDictionary["Logo"]
if "Footer" in self.mDictionary:
self.mFooter = self.mDictionary["Footer"]
if "ContentDirectory" in self.mDictionary:
self.mContentDirectory = self.mDictionary["ContentDirectory"]
if "TemplateDirectory" in self.mDictionary:
self.mTemplateDirectory = self.mDictionary["TemplateDirectory"]
if "TargetDirectory" in self.mDictionary:
self.mTargetDirectory = self.mDictionary["TargetDirectory"]
if "TargetPermissions" in self.mDictionary:
self.mTargetPermissions = self.mDictionary["TargetPermissions"]
def read(self, FileName):
super(ZConfiguration, self).read(FileName)
self.assign()
return True
def print(self):
print("Configuration of file " + self.mFileName)
print("Logo: " + self.mLogo)
print("Title: " + self.mTitle)
print("SubTitle: " + self.mSubTitle)
print("Description: " + self.mSubTitle)
print("Footer: " + self.mFooter)
print("ContentDirectory: " + self.mContentDirectory)
print("TemplateDirectory: " + self.mTemplateDirectory)
print("TargetDirectory: " + self.mTargetDirectory)
print("TargetPermissions: " + self.mTargetPermissions)
# -----------------------------------------------------------------------------------