forked from A-Metaphysical-Drama/cork-on-blender
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexceptions.py
69 lines (52 loc) · 2.01 KB
/
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
# exceptions
# ############################################################
# Cork
# ############################################################
class InvalidPathException(Exception):
def __init__(self, filepath):
Exception.__init__(self)
self._filepath = filepath
def __str__(self):
return "Invalid path: \"{0}\".".format(self._filepath)
class InvalidTemporaryDir(Exception):
def __init__(self, exception):
Exception.__init__(self)
self._exception = exception
def __str__(self):
print(self._exception)
return "Failed to create temporary folder"
class NonExecutableException(Exception):
def __init__(self, filepath):
Exception.__init__(self)
self._filepath = filepath
def __str__(self):
return "File not executable: \"{0}\".".format(self._filepath)
class NumberSelectionException(Exception):
def __init__(self):
Exception.__init__(self)
def __str__(self):
return "Only two objects can be selected at a time (the base object and the slice plane)"
class NonMeshSelectedException(Exception):
def __init__(self, obj):
Exception.__init__(self)
self._object = obj
def __str__(self):
return "Selected object \"{0}\" is not a mesh".format(self._object.name)
class ExportMeshException(Exception):
def __init__(self, obj, filepath):
Exception.__init__(self)
self._object = obj
self._filepath = filepath
def __str__(self):
return "Failed to export object \"{0}\" to \"{1}\"".format(self._object.name, self._filepath)
class ImportMeshException(Exception):
def __init__(self, filepath):
Exception.__init__(self)
self._filepath = filepath
def __str__(self):
return "Failed to import mesh \"{0}\"".format(self._filepath)
class ImportOffsetException(Exception):
def __init__(self):
Exception.__init__(self)
def __str__(self):
return "OFF importer not found. Enable the addon in Blender User Preferences"