Show More
@@ -280,9 +280,11 b' class DictDB(BaseDB):' | |||||
280 | return sorted(msg_ids, key=lambda m: self._records[m]['submitted']) |
|
280 | return sorted(msg_ids, key=lambda m: self._records[m]['submitted']) | |
281 |
|
281 | |||
282 |
|
282 | |||
283 | NODATA = KeyError("NoDB backend doesn't store any data. " |
|
283 | class NoData(KeyError): | |
284 | "Start the Controller with a DB backend to enable resubmission / result persistence." |
|
284 | """Special KeyError to raise when requesting data from NoDB""" | |
285 | ) |
|
285 | def __str__(self): | |
|
286 | return "NoDB backend doesn't store any data. " | |||
|
287 | "Start the Controller with a DB backend to enable resubmission / result persistence." | |||
286 |
|
288 | |||
287 |
|
289 | |||
288 | class NoDB(BaseDB): |
|
290 | class NoDB(BaseDB): | |
@@ -298,7 +300,7 b' class NoDB(BaseDB):' | |||||
298 | pass |
|
300 | pass | |
299 |
|
301 | |||
300 | def get_record(self, msg_id): |
|
302 | def get_record(self, msg_id): | |
301 |
raise N |
|
303 | raise NoData() | |
302 |
|
304 | |||
303 | def update_record(self, msg_id, record): |
|
305 | def update_record(self, msg_id, record): | |
304 | pass |
|
306 | pass | |
@@ -310,8 +312,8 b' class NoDB(BaseDB):' | |||||
310 | pass |
|
312 | pass | |
311 |
|
313 | |||
312 | def find_records(self, check, keys=None): |
|
314 | def find_records(self, check, keys=None): | |
313 |
raise N |
|
315 | raise NoData() | |
314 |
|
316 | |||
315 | def get_history(self): |
|
317 | def get_history(self): | |
316 |
raise N |
|
318 | raise NoData() | |
317 |
|
319 |
General Comments 0
You need to be logged in to leave comments.
Login now