2017-05-22 21:33:52 +02:00
|
|
|
class FDroidException(Exception):
|
|
|
|
|
|
|
|
def __init__(self, value=None, detail=None):
|
|
|
|
self.value = value
|
|
|
|
self.detail = detail
|
|
|
|
|
|
|
|
def shortened_detail(self):
|
|
|
|
if len(self.detail) < 16000:
|
|
|
|
return self.detail
|
|
|
|
return '[...]\n' + self.detail[-16000:]
|
|
|
|
|
|
|
|
def get_wikitext(self):
|
|
|
|
ret = repr(self.value) + "\n"
|
|
|
|
if self.detail:
|
|
|
|
ret += "=detail=\n"
|
|
|
|
ret += "<pre>\n" + self.shortened_detail() + "</pre>\n"
|
|
|
|
return ret
|
|
|
|
|
|
|
|
def __str__(self):
|
2017-10-19 20:37:39 +02:00
|
|
|
if self.value is None:
|
|
|
|
ret = __name__
|
|
|
|
else:
|
|
|
|
ret = str(self.value)
|
2017-05-22 21:33:52 +02:00
|
|
|
if self.detail:
|
2017-09-27 17:35:51 +02:00
|
|
|
ret += "\n==== detail begin ====\n%s\n==== detail end ====" % ''.join(self.detail).strip()
|
2017-05-22 21:33:52 +02:00
|
|
|
return ret
|
|
|
|
|
|
|
|
|
|
|
|
class MetaDataException(Exception):
|
|
|
|
|
|
|
|
def __init__(self, value):
|
|
|
|
self.value = value
|
|
|
|
|
|
|
|
def __str__(self):
|
|
|
|
return self.value
|
|
|
|
|
|
|
|
|
|
|
|
class VCSException(FDroidException):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2017-12-04 15:10:21 +01:00
|
|
|
class NoSubmodulesException(VCSException):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2017-05-22 21:33:52 +02:00
|
|
|
class BuildException(FDroidException):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class VerificationException(FDroidException):
|
|
|
|
pass
|