Parcourir la source

PEP8 + PEP 257 for all model

nico il y a 8 ans
Parent
commit
397c1c5b1f

+ 2 - 4
core/Models/Brain.py

@@ -5,10 +5,8 @@ from core.Models import Singleton
 class Brain:
     # TODO review the Singleton, should be Instantiate at the BrainLoader level
     """
-
-        This Class is a Singleton Representing the Brain.yml file with synapse
-
-        .. note:: the is_loaded Boolean is True when the Brain has been properly loaded.
+    This Class is a Singleton Representing the Brain.yml file with synapse
+    .. note:: the is_loaded Boolean is True when the Brain has been properly loaded.
     """
 
     def __init__(self, synapses=None, brain_file=None, brain_yaml=None):

+ 3 - 6
core/Models/Event.py

@@ -1,12 +1,10 @@
 class Event(object):
     """
+    This Class is representing an Event which is raised by when the System at some defined time.
 
-        This Class is representing an Event which is raised by when the System at some defined time.
-
-        .. note:: Events are based on the system crontab
+    .. note:: Events are based on the system crontab
     """
 
-
     def __init__(self, period):
         self.period = period
 
@@ -16,10 +14,9 @@ class Event(object):
 
     def serialize(self):
         """
-
         This method allows to serialize in a proper way this object
 
-        :return: A dict of name / perio
+        :return: A dict of name / period
         :rtype: Dict
         """
 

+ 2 - 5
core/Models/Neuron.py

@@ -1,19 +1,16 @@
 class Neuron(object):
     """
+    This Class is representing a Neuron which is corresponding to an action to perform.
 
-        This Class is representing a Neuron which is corresponding to an action to perform.
-
-        .. note:: Neurons are defined in the brain file
+    .. note:: Neurons are defined in the brain file
     """
 
-
     def __init__(self, name=None, parameters=None):
         self.name = name
         self.parameters = parameters
 
     def serialize(self):
         """
-
         This method allows to serialize in a proper way this object
 
         :return: A dict of name and parameters

+ 2 - 5
core/Models/Order.py

@@ -1,12 +1,10 @@
 class Order(object):
     """
+    This Class is representing an Order which is raised by when an entry (Vocal/REST/ anything ...) is matching it.
 
-        This Class is representing an Order which is raised by when an entry (Vocal/REST/ anything ...) is matching it.
-
-        .. note:: Order are defined in the brain file for each synapse.
+    .. note:: Order are defined in the brain file for each synapse.
     """
 
-
     def __init__(self, sentence):
         self.sentence = sentence
 
@@ -15,7 +13,6 @@ class Order(object):
 
     def serialize(self):
         """
-
         This method allows to serialize in a proper way this object
 
         :return: A dict of order

+ 1 - 4
core/Models/RestAPI.py

@@ -1,11 +1,8 @@
 class RestAPI(object):
     """
-
-        This Class is representing the rest API with all its configuration.
-
+    This Class is representing the rest API with all its configuration.
     """
 
-
     def __init__(self, password_protected=None, login=None, password=None, active=None, port=None):
         """
 

+ 2 - 3
core/Models/Settings.py

@@ -5,10 +5,9 @@ from core.Models import Singleton
 class Settings(object):
     # TODO review the Singleton, should be Instantiate at the BrainLoader level
     """
+    This Class is a Singleton Representing the settings.yml file with synapse
 
-        This Class is a Singleton Representing the settings.yml file with synapse
-
-        .. note:: the is_loaded Boolean is True when the Settings has been properly loaded.
+    .. note:: the is_loaded Boolean is True when the Settings has been properly loaded.
     """
     def __init__(self,
                  default_tts_name=None,

+ 2 - 4
core/Models/Stt.py

@@ -1,10 +1,8 @@
 class Stt(object):
-
     """
+    This Class is representing a Speech To Text (STT) element with name and parameters
 
-        This Class is representing a Speech To Text (STT) element with name and parameters
-
-        .. note:: must be defined in the settings.yml
+    .. note:: must be defined in the settings.yml
     """
 
     def __init__(self, name=None, parameters=None):

+ 2 - 5
core/Models/Synapse.py

@@ -1,12 +1,10 @@
 class Synapse(object):
     """
+    This Class is representing a Synapse with its name, and a dict of Neurons and a dict of signals
 
-        This Class is representing a Synapse with its name, and a dict of Neurons and a dict of signals
-
-        .. note:: must be defined in the brain.yml
+    .. note:: must be defined in the brain.yml
     """
 
-
     def __init__(self, name=None, neurons=None, signals=None):
         self.name = name
         self.neurons = neurons
@@ -14,7 +12,6 @@ class Synapse(object):
 
     def serialize(self):
         """
-
         This method allows to serialize in a proper way this object
 
         :return: A dict of name, neurons, signals

+ 2 - 6
core/Models/Trigger.py

@@ -1,17 +1,13 @@
 class Trigger(object):
-
     """
+    This Class is representing a Trigger with its name and parameters
 
-        This Class is representing a Trigger with its name and parameters
-
-        .. note:: must be defined in the settings.yml
+    .. note:: must be defined in the settings.yml
     """
 
-
     def __init__(self, name=None, parameters=None):
         self.name = name
         self.parameters = parameters
 
     def __str__(self):
         return "Trigger name: %s, parameters: %s" % (str(self.name), str(self.parameters))
-

+ 2 - 4
core/Models/Tts.py

@@ -1,12 +1,10 @@
 class Tts(object):
     """
+    This Class is representing a Text To Speech (TTS) with its name and parameters
 
-        This Class is representing a Text To Speech (TTS) with its name and parameters
-
-        .. note:: must be defined in the settings.yml
+    .. note:: must be defined in the settings.yml
     """
 
-
     def __init__(self, name=None, parameters=None):
         self.name = name
         self.parameters = parameters