-
Notifications
You must be signed in to change notification settings - Fork 3
/
roadnet_exceptions.py
122 lines (76 loc) · 2.48 KB
/
roadnet_exceptions.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# -*- coding: utf-8 -*-
from PyQt4.QtGui import QMessageBox
from PyQt4.Qt import Qt
from PyQt4.QtSql import QSqlError
class QMessageBoxWarningError(Exception):
"""
Exception that raises message box with information for user.
"""
def __init__(self, message):
# Call the base class constructor with the parameters it needs
super(QMessageBoxWarningError, self).__init__(message)
self.show_message_box()
def show_message_box(self):
"""
Show message box with message.
"""
msg_box = QMessageBox(QMessageBox.Warning, " ", self.message,
QMessageBox.Ok, None)
msg_box.setWindowFlags(Qt.CustomizeWindowHint | Qt.WindowTitleHint)
msg_box.exec_()
class MissingParamsFilePopupError(QMessageBoxWarningError):
pass
class InvalidParamsKeysPopupError(QMessageBoxWarningError):
pass
class ExtraParamsKeysPopupError(QMessageBoxWarningError):
pass
class InvalidLayerPopupError(QMessageBoxWarningError):
pass
class InvalidStylePopupError(QMessageBoxWarningError):
pass
class CannotOpenShapefilePopupError(QMessageBoxWarningError):
pass
class BadSpatialiteVersionPopupError(QMessageBoxWarningError):
pass
class RemoveNonExistentLayerPopupError(QMessageBoxWarningError):
pass
class BadRampTableStructureError(QMessageBoxWarningError):
pass
class RampRdPolyUpdateFailedPopupError(QMessageBoxWarningError):
pass
class RampRdPolyAlreadyLinkedPopupError(QMessageBoxWarningError):
pass
class RampMclNumberingFailedPopupError(QMessageBoxWarningError):
pass
class RampNoLinkedPolyPopupError(QMessageBoxWarningError):
pass
class NoFeaturesFoundException(BaseException):
"""
Used to raise an exception where the database would have silently
returned nothing.
"""
pass
class MclFormLengthCalculationError(BaseException):
pass
class MclFormBadMclRefError(BaseException):
pass
class RdpolyFormBadRdpolyRefError(BaseException):
pass
class RdpolyFormBadMclRefError(BaseException):
pass
class RdPolyNullGeometryError(BaseException):
"""
Raised when feature in WDM export has NULL geometry.
"""
pass
class LengthOfRoadsCalculationDatabaseError(BaseException):
"""
Raised when Length of Roads calculation fails but database would have
silently returned nothing.
"""
pass
class BadSpatialiteVersionError(BaseException):
"""
Raised with Spatialite version < 4.3.0.
"""
pass