Skip to content

Commit acd8ed9

Browse files
Usage of @staticmethod (#20)
1 parent 455a8be commit acd8ed9

12 files changed

Lines changed: 185 additions & 0 deletions

src/core/bugcheck_error.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88

99
class BugCheckError:
10+
@staticmethod
1011
def UnkObjectDataType(objectType: type):
1112
assert objectType is not None
1213
assert type(objectType) is type
@@ -15,6 +16,7 @@ def UnkObjectDataType(objectType: type):
1516
raise Exception(errMsg)
1617

1718
# --------------------------------------------------------------------
19+
@staticmethod
1820
def MultipleDefOfOptionIsFound(optName: str, count: int):
1921
assert type(optName) is str
2022
assert type(count) is int
@@ -27,6 +29,7 @@ def MultipleDefOfOptionIsFound(optName: str, count: int):
2729
raise Exception(errMsg)
2830

2931
# --------------------------------------------------------------------
32+
@staticmethod
3033
def UnkOptObjectDataType(optName: str, optDataType: type):
3134
assert type(optName) is str
3235
assert type(optDataType) is type
@@ -39,6 +42,7 @@ def UnkOptObjectDataType(optName: str, optDataType: type):
3942
raise Exception(errMsg)
4043

4144
# --------------------------------------------------------------------
45+
@staticmethod
4246
def MultipleDefOfFileIsFound(fileName: str, count: int):
4347
assert type(fileName) is str
4448
assert type(count) is int
@@ -51,6 +55,7 @@ def MultipleDefOfFileIsFound(fileName: str, count: int):
5155
raise Exception(errMsg)
5256

5357
# --------------------------------------------------------------------
58+
@staticmethod
5459
def UnkFileObjectDataType(fileName: str, fileDataType: type):
5560
assert type(fileName) is str
5661
assert type(fileDataType) is type
@@ -61,6 +66,7 @@ def UnkFileObjectDataType(fileName: str, fileDataType: type):
6166
raise Exception(errMsg)
6267

6368
# --------------------------------------------------------------------
69+
@staticmethod
6470
def UnkFileDataStatus(filePath: str, fileStatus: any):
6571
assert type(filePath) is str
6672
assert fileStatus is not None
@@ -71,6 +77,7 @@ def UnkFileDataStatus(filePath: str, fileStatus: any):
7177
raise Exception(errMsg)
7278

7379
# --------------------------------------------------------------------
80+
@staticmethod
7481
def FileIsNotFoundInIndex(fileKey: str, filePath: str):
7582
assert type(fileKey) is str
7683
assert type(filePath) is str
@@ -81,35 +88,41 @@ def FileIsNotFoundInIndex(fileKey: str, filePath: str):
8188
raise Exception(errMsg)
8289

8390
# --------------------------------------------------------------------
91+
@staticmethod
8492
def OptionIsNotFoundInIndex(optName: str):
8593
assert type(optName) is str
8694

8795
errMsg = "[BUG CHECK] Option [{0}] is not found in index.".format(optName)
8896
raise Exception(errMsg)
8997

9098
# --------------------------------------------------------------------
99+
@staticmethod
91100
def OptionIsNotFoundInFileLine(optName: str):
92101
assert type(optName) is str
93102

94103
errMsg = "[BUG CHECK] Option [{0}] is not found in file line.".format(optName)
95104
raise Exception(errMsg)
96105

97106
# --------------------------------------------------------------------
107+
@staticmethod
98108
def CommentIsNotFoundInFileLine():
99109
errMsg = "[BUG CHECK] Comment is not found in file line."
100110
raise Exception(errMsg)
101111

102112
# --------------------------------------------------------------------
113+
@staticmethod
103114
def IncludeIsNotFoundInFileLine():
104115
errMsg = "[BUG CHECK] Include is not found in file line."
105116
raise Exception(errMsg)
106117

107118
# --------------------------------------------------------------------
119+
@staticmethod
108120
def FileLineIsNotFoundInFile():
109121
errMsg = "[BUG CHECK] FileLine is not found in file."
110122
raise Exception(errMsg)
111123

112124
# --------------------------------------------------------------------
125+
@staticmethod
113126
def OptionHandlerToPrepareSetValueIsNotDefined(name: str):
114127
assert type(name) is str
115128

@@ -119,6 +132,7 @@ def OptionHandlerToPrepareSetValueIsNotDefined(name: str):
119132
raise Exception(errMsg)
120133

121134
# --------------------------------------------------------------------
135+
@staticmethod
122136
def OptionHandlerToPrepareGetValueIsNotDefined(name: str):
123137
assert type(name) is str
124138

@@ -128,6 +142,7 @@ def OptionHandlerToPrepareGetValueIsNotDefined(name: str):
128142
raise Exception(errMsg)
129143

130144
# --------------------------------------------------------------------
145+
@staticmethod
131146
def OptionHandlerToPrepareSetValueItemIsNotDefined(name: str):
132147
assert type(name) is str
133148

@@ -137,6 +152,7 @@ def OptionHandlerToPrepareSetValueItemIsNotDefined(name: str):
137152
raise Exception(errMsg)
138153

139154
# --------------------------------------------------------------------
155+
@staticmethod
140156
def OptionHandlerToSetValueIsNotDefined(name: str):
141157
assert type(name) is str
142158

@@ -146,6 +162,7 @@ def OptionHandlerToSetValueIsNotDefined(name: str):
146162
raise Exception(errMsg)
147163

148164
# --------------------------------------------------------------------
165+
@staticmethod
149166
def OptionHandlerToGetValueIsNotDefined(name: str):
150167
assert type(name) is str
151168

@@ -155,6 +172,7 @@ def OptionHandlerToGetValueIsNotDefined(name: str):
155172
raise Exception(errMsg)
156173

157174
# --------------------------------------------------------------------
175+
@staticmethod
158176
def OptionHandlerToAddOptionIsNotDefined(name: str):
159177
assert type(name) is str
160178

@@ -166,6 +184,7 @@ def OptionHandlerToAddOptionIsNotDefined(name: str):
166184
raise Exception(errMsg)
167185

168186
# --------------------------------------------------------------------
187+
@staticmethod
169188
def OptionHandlerToSetValueItemIsNotDefined(name: str):
170189
assert type(name) is str
171190

@@ -177,6 +196,7 @@ def OptionHandlerToSetValueItemIsNotDefined(name: str):
177196
raise Exception(errMsg)
178197

179198
# --------------------------------------------------------------------
199+
@staticmethod
180200
def OptionHandlerToWriteIsNotDefined(name: str):
181201
assert type(name) is str
182202

@@ -186,6 +206,7 @@ def OptionHandlerToWriteIsNotDefined(name: str):
186206
raise Exception(errMsg)
187207

188208
# --------------------------------------------------------------------
209+
@staticmethod
189210
def UnexpectedSituation(bugcheckSrc: str, bugcheckPoint: str, explain: str):
190211
assert type(bugcheckSrc) is str
191212
assert type(bugcheckPoint) is str
@@ -204,6 +225,7 @@ def UnexpectedSituation(bugcheckSrc: str, bugcheckPoint: str, explain: str):
204225
raise Exception(errMsg)
205226

206227
# --------------------------------------------------------------------
228+
@staticmethod
207229
def UnknownOptionValueType(optionName: str, typeOfOptionValue: type):
208230
assert type(optionName) is str
209231
assert optionName != ""

0 commit comments

Comments
 (0)