-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.py
More file actions
executable file
·151 lines (131 loc) · 4.46 KB
/
Copy patherror.py
File metadata and controls
executable file
·151 lines (131 loc) · 4.46 KB
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
"""
error, part of chipFish
(c) 2008-2011 oAxiom
Not for distribution.
Class containter for error handling.
. remove the error class, and raise exceptions.
. assertions to add
. use config.log.error
"""
import sys, os
# A generic error class.
class error:
def __init__(self, message, bFatal=False):
print("Error: ", message)
if bFatal:
sys.exit()
# ----------------------------------------------------------------------
# Generic Assertion Error:
class AssertionError(Exception):
"""
Error
An assertion or requirement for a particular method
failed. This usually means some sort of category required
for the method is missing.
This method (in contrast to a lot of other error methods) needs
to provide its own error message
"""
def __init__(self, message):
"""
Output the error message and tidy up the traceback, and perform other stuff.
"""
print("Error: %s" % (message))
# ---------------------------------------------------------------------
# Exceptions
class ErrorUnrecognisedTrackMode(Exception):
"""
Error
A mode in the server track descriptor file was not recognised
at the time of writing (this may be out of date), only tracks and beds
are supported.
"""
def __init__(self, message):
"""
Output the error message and tidy up the traceback, and perform other stuff.
"""
self.message = "Error: Mode in track descriptor file '%s' not recognised" % (message)
class ErrorCairoDraw(Exception):
"""
Error: Attempting to draw to a non-ready Cairo surface.
"""
def __init__(self):
self.message = "Error: Attempted to draw on an uninitialised Cairo Surface."
def __str__(self):
return(repr(self.message))
class ErrorCairoAcquireDevice(Exception):
"""
Error: For some reason a Cairo surface is not available
"""
def __init__(self):
self.message = "Error: Failed to acquire a Cairo Surface."
def __str__(self):
return(repr(self.message))
class ErrorInvalidGeneDefinition(Exception):
"""
Error: Attempting to draw to a non-ready Cairo surface.
"""
def __init__(self):
self.message = "Error: Failed to acquire a Cairo Surface."
def __str__(self):
return(repr(self.message))
class ErrorInvalidChromosome(Exception):
"""
Error: Invalid Chromosome name, only 1-999 and X, Y, M are valid chromsome names.
"""
def __init__(self):
self.message = "Error: Invalid Chromosome name, only 1-999 and X, Y, M are valid chromsome names."
def __str__(self):
return(repr(self.message))
class ErrorLibrarySQLite(Exception):
"""
Error: SQL backend not available.
"""
def __init__(self):
self.message = "Error: Database SQLite not found or not available."
def __str__(self):
return(repr(self.message))
class ErrorUserDataNotFound(Exception):
"""
Error: the user data cannot be found or is otherwise mangled
This should be fixable?
Should intelligently fail?
"""
def __init__(self):
self.message = "Error: The per-user data is not available or mangled."
def __str__(self):
return(repr(self.message))
class ErrorUserDataReadOnly(Exception):
"""
Error: The user config is inaccesible.
This suggests an install screw-up.
The home directory ~ should be writable.
"""
def __init__(self):
self.message = "Error: The per-user data is read-only."
def __str__(self):
return(repr(self.message))
class ErrorOSNotSupported(Exception):
"""
Error: This OS type is not currently supported.
"""
def __init__(self):
import platform
self.message = "Error: The OS '%s' is not currently supported" % platform.platform()
def __str__(self):
return(repr(self.message))
class ErrorTrackDrawTypeNotFound(Exception):
"""
Error: The tracks draw type cannot be found/determined/guessed.
"""
def __init__(self, message):
self.message = "Error: The tracks draw type '%s' cannot be found/determined/guessed" % message
def __str__(self):
return(repr(self.message))
class ErrorGenomeNotSupported(Exception):
"""
Error: The tracks draw type cannot be found/determined/guessed.
"""
def __init__(self, message):
self.message = "Error: The genome '%s' is not supported on this build of chipfish" % message
def __str__(self):
return(repr(self.message))