|
@@ -16,6 +16,10 @@
|
|
|
|
|
|
|
|
|
|
class DataBaseAccessFailed(Exception):
|
|
class DataBaseAccessFailed(Exception):
|
|
|
|
+ """This exception will be raised when opening or creating the database
|
|
|
|
+ failed.
|
|
|
|
+
|
|
|
|
+ """
|
|
def __init__(self):
|
|
def __init__(self):
|
|
self.__message = "Accessing the database failed!"
|
|
self.__message = "Accessing the database failed!"
|
|
|
|
|
|
@@ -24,6 +28,10 @@ class DataBaseAccessFailed(Exception):
|
|
|
|
|
|
|
|
|
|
class DataBaseWriteFailed(Exception):
|
|
class DataBaseWriteFailed(Exception):
|
|
|
|
+ """This exception will be raised when a write access to the database
|
|
|
|
+ failed.
|
|
|
|
+
|
|
|
|
+ """
|
|
def __init__(self):
|
|
def __init__(self):
|
|
self.__message = "Writing to the database failed, requested action " \
|
|
self.__message = "Writing to the database failed, requested action " \
|
|
"aborted !"
|
|
"aborted !"
|
|
@@ -33,6 +41,10 @@ class DataBaseWriteFailed(Exception):
|
|
|
|
|
|
|
|
|
|
class WrongParameters(Exception):
|
|
class WrongParameters(Exception):
|
|
|
|
+ """This exception will be raised when the number of parameters or their
|
|
|
|
+ value is wrong.
|
|
|
|
+
|
|
|
|
+ """
|
|
def __init__(self):
|
|
def __init__(self):
|
|
self.__message = "The wrong number or values of parameters where " \
|
|
self.__message = "The wrong number or values of parameters where " \
|
|
"given to the function, the requested action failed."
|
|
"given to the function, the requested action failed."
|
|
@@ -42,6 +54,10 @@ class WrongParameters(Exception):
|
|
|
|
|
|
|
|
|
|
class CategoryNotFound(Exception):
|
|
class CategoryNotFound(Exception):
|
|
|
|
+ """This exception will be raised when the user tries to access a category
|
|
|
|
+ that does not exist in the database.
|
|
|
|
+
|
|
|
|
+ """
|
|
def __init__(self):
|
|
def __init__(self):
|
|
self.__message = "The category could not be found in the database."
|
|
self.__message = "The category could not be found in the database."
|
|
|
|
|
|
@@ -50,6 +66,10 @@ class CategoryNotFound(Exception):
|
|
|
|
|
|
|
|
|
|
class DayAlreadyInDatabase(Exception):
|
|
class DayAlreadyInDatabase(Exception):
|
|
|
|
+ """This exception will be raised when the user tries to add a day to the
|
|
|
|
+ database which does already have an entry there.
|
|
|
|
+
|
|
|
|
+ """
|
|
def __init__(self):
|
|
def __init__(self):
|
|
self.__message = "This day already exists in the database."
|
|
self.__message = "This day already exists in the database."
|
|
|
|
|
|
@@ -57,6 +77,10 @@ class DayAlreadyInDatabase(Exception):
|
|
return self.__message
|
|
return self.__message
|
|
|
|
|
|
class ConfigurationFileMissing(Exception):
|
|
class ConfigurationFileMissing(Exception):
|
|
|
|
+ """This exception will be raised when the configuration file is
|
|
|
|
+ missing.
|
|
|
|
+
|
|
|
|
+ """
|
|
def __init__(self):
|
|
def __init__(self):
|
|
self.__message = "The configuration file does not exist."
|
|
self.__message = "The configuration file does not exist."
|
|
|
|
|
|
@@ -64,9 +88,44 @@ class ConfigurationFileMissing(Exception):
|
|
return self.__message
|
|
return self.__message
|
|
|
|
|
|
class ConfigurationFileAccessDenied(Exception):
|
|
class ConfigurationFileAccessDenied(Exception):
|
|
|
|
+ """This exception will be raised when the access to the configuration
|
|
|
|
+ file is denied by it's permissions.
|
|
|
|
+
|
|
|
|
+ """
|
|
def __init__(self):
|
|
def __init__(self):
|
|
self.__message = "The configuration file could not be opened " \
|
|
self.__message = "The configuration file could not be opened " \
|
|
"for reading."
|
|
"for reading."
|
|
|
|
|
|
def __str__(self):
|
|
def __str__(self):
|
|
return self.__message
|
|
return self.__message
|
|
|
|
+
|
|
|
|
+class PasswdOrGroupAccessFailed(Exception):
|
|
|
|
+ """This exception will be raised when accessing either /etc/passwd or
|
|
|
|
+ /etc/group failed.
|
|
|
|
+
|
|
|
|
+ """
|
|
|
|
+ def __init__(self):
|
|
|
|
+ self.__message = "Opening /etc/passwd or /etc/group failed."
|
|
|
|
+
|
|
|
|
+ def __str__(self):
|
|
|
|
+ return self.__message
|
|
|
|
+
|
|
|
|
+class DaemonAlreadyRunning(Exception):
|
|
|
|
+ """This exception will be raised when another process is already
|
|
|
|
+ running.
|
|
|
|
+
|
|
|
|
+ """
|
|
|
|
+ def __init__(self):
|
|
|
|
+ self.__message = "Another process is already running, exiting."
|
|
|
|
+
|
|
|
|
+ def __str__(self):
|
|
|
|
+ return self.__message
|
|
|
|
+
|
|
|
|
+class WritingPIDFileFailed(Exception):
|
|
|
|
+ """This exception will be raised when creating the PID file failed."""
|
|
|
|
+ def __init__(self):
|
|
|
|
+ self.__message = "The PID file could not be created, please check if " \
|
|
|
|
+ "/run or /var/run exist and are writable."
|
|
|
|
+
|
|
|
|
+ def __str__(self):
|
|
|
|
+ return self.__message
|