소스 검색

[Doc] Docstrings of error Classes

monf 8 년 전
부모
커밋
dc4c5d6de2

+ 31 - 5
core/ConfigurationManager/ConfigurationChecker.py

@@ -4,41 +4,67 @@ from core.Utils import ModuleNotFoundError
 
 
 class InvalidSynapeName(Exception):
+    """
+        The name of the synapse is not correct. It should only contains alphanumerics at the beginning and the end of
+        its name. It can also contains dash in beetween alphanumerics.
+    """
     pass
 
 
 class NoSynapeName(Exception):
+    """
+        A synapse needs a name
+    """
     pass
 
 
 class NoSynapeNeurons(Exception):
+    """
+        A synapse must contains at least one neuron
+
+        .. seealso:: Synapse, Neuron
+    """
     pass
 
 
 class NoSynapeSignals(Exception):
+    """
+        A synapse must contains at least an Event or an Order
+
+        .. seealso:: Event, Order
+    """
     pass
 
 
 class NoValidSignal(Exception):
-    pass
+    """
+        A synapse must contains at least a valid Event or an Order
 
+        .. seealso:: Event, Order
+    """
 
-class NoEventID(Exception):
     pass
 
 
+
 class NoEventPeriod(Exception):
+    """
+        An Event must contains a period corresponding to its execution
+
+        .. seealso:: Event
+    """
     pass
 
 
 class MultipleSameSynapseName(Exception):
-    pass
-
+    """
 
-class NotValidSynapseName(Exception):
+        A synapse name must be unique
+    """
     pass
 
 
+
 class ConfigurationChecker:
 
     """

+ 18 - 0
core/ConfigurationManager/SettingLoader.py

@@ -16,14 +16,32 @@ logger = logging.getLogger("kalliope")
 
 
 class SettingInvalidException(Exception):
+    """
+
+        Some data must match the expected value/type
+
+        .. seealso:: Settings
+    """
     pass
 
 
 class NullSettingException(Exception):
+    """
+
+        Some Attributes can not be Null
+
+        .. seealso:: Settings
+    """
     pass
 
 
 class SettingNotFound(Exception):
+    """
+
+        Some Attributes are missing
+
+        .. seealso:: Settings
+    """
     pass
 
 

+ 4 - 0
core/ConfigurationManager/YAMLLoader.py

@@ -8,6 +8,10 @@ logger = logging.getLogger("kalliope")
 
 
 class YAMLFileNotFound(Exception):
+    """
+
+        YAML file has not been found
+    """
     pass
 
 

+ 6 - 0
core/CrontabManager.py

@@ -11,6 +11,12 @@ logger = logging.getLogger("kalliope")
 
 
 class InvalidCrontabPeriod(Exception):
+    """
+
+        Event are based on the Crontab. The Period must be corresponding to the Crontab format
+
+        .. seealso:: Event
+    """
     pass
 
 CRONTAB_COMMENT = "KALLIOPE"

+ 15 - 5
core/NeuronModule.py

@@ -16,31 +16,41 @@ logger = logging.getLogger("kalliope")
 
 
 class InvalidParameterException(Exception):
+    """
+       Some Neuron parameters are invalid.
+    """
     pass
 
 
 class MissingParameterException(Exception):
+    """
+       Some Neuron parameters are missing.
+    """
     pass
 
 
 class NoTemplateException(Exception):
+    """
+        You must specify a say_template or a file_template
+    """
     pass
 
 
-class MultipleTemplateException(Exception):
-    pass
-
 
 class TemplateFileNotFoundException(Exception):
+    """
+        Template file can not be found. Check the provided path.
+    """
     pass
 
 
 class TTSModuleNotFound(Exception):
+    """
+        TTS module can not be find. It must be configured in the settings file.
+    """
     pass
 
 
-class TTSNotInstantiable(Exception):
-    pass
 
 
 class NeuronModule(object):

+ 0 - 4
core/NeuroneLauncher.py

@@ -6,10 +6,6 @@ logging.basicConfig()
 logger = logging.getLogger("kalliope")
 
 
-class NeuroneNotFoundError(Exception):
-    pass
-
-
 class NeuroneLauncher:
 
     def __init__(self):

+ 5 - 0
core/SynapseLauncher.py

@@ -3,6 +3,11 @@ from core.NeuroneLauncher import NeuroneLauncher
 
 
 class SynapseNameNotFound(Exception):
+    """
+        The Synapse has not been found
+
+        .. seealso: Synapse
+    """
     pass
 
 

+ 11 - 0
core/TTS/TTSModule.py

@@ -12,14 +12,25 @@ logger = logging.getLogger("kalliope")
 
 
 class MissingTTSParameter(Exception):
+    """
+        Some TTS Parameters are missing in the settings.yml file.
+
+        .. seealose:: Settings
+    """
     pass
 
 
 class TtsGenerateAudioFunctionNotFound(Exception):
+    """
+        You must provide a callBack to the TTS
+    """
     pass
 
 
 class FailToLoadSoundFile(Exception):
+    """
+        Fail while truing to load the sound file.
+    """
     pass
 
 

+ 5 - 0
core/Utils.py

@@ -5,6 +5,11 @@ logger = logging.getLogger("kalliope")
 
 
 class ModuleNotFoundError(Exception):
+    """
+       The module can not been found
+
+       .. notes: Check the case: must be in lower case.
+    """
     pass