Browse Source

some fixes for v0.3

fix link

update doc

doc update

fix setup.py

fix link

fix get random_wake_up_sounds path

fix get tempalte path

fix neuron list

add started config
nico 8 năm trước cách đây
mục cha
commit
ab55f4af3c

+ 9 - 0
Docs/installation.md

@@ -21,6 +21,7 @@ sudo pip install kalliope
 Clone the project:
 ```
 git clone https://github.com/kalliope-project/kalliope.git
+cd kalliope
 ```
 
 Install the project:
@@ -108,5 +109,13 @@ Order matched in the brain. Running synapse "say-hello-fr"
 Waiting for trigger detection
 ```
 
+## Get a starter configuration
+We create some starter configuration that only need to be downloaded and then started. 
+Those repositories provides you a basic structure to start playing with kalliope. We recommend you to clone one of them and then go to the next section.
+
+- [French starter config](https://github.com/kalliope-project/kalliope_starter_fr)
+- [English starter config](https://github.com/kalliope-project/kalliope_starter_en)
+
+
 ## Next: Create you own bot
 If everything is ok, you can start playing with Kalliope. First, take a look to the [default settings](settings.md).

+ 9 - 4
Docs/installation/debian_jessie.md

@@ -14,12 +14,17 @@ Install some required system libraries and softwares:
 
 ```
 sudo apt-get update
-sudo apt-get install git python-pip python-dev libsmpeg0 libttspico-utils libsmpeg0 flac dialog libffi-dev libffi-dev libssl-dev portaudio19-dev build-essential libssl-dev libffi-dev sox libatlas3-base mplayer
+sudo apt-get install git python-dev libsmpeg0 libttspico-utils libsmpeg0 flac dialog libffi-dev libffi-dev libssl-dev portaudio19-dev build-essential libssl-dev libffi-dev sox libatlas3-base mplayer
 ```
 
-You also need some packages from the backports:
+Let's install the last release of python-pip
+```
+wget https://bootstrap.pypa.io/get-pip.py
+sudo python get-pip.py
+```
 
+Then, with pip, the last release of setuptools
 ```
-sudo apt-get install -t jessie-backports python-setuptools
-sudo apt-get install -t jessie-backports python-pyasn1
+sudo pip install -U pip setuptools
 ```
+

+ 18 - 18
Docs/neuron_list.md

@@ -2,22 +2,22 @@
 
 A neuron is a module that will perform some actions attached to an order. You can use it in your synapses. See the [complete neuron documentation](neurons.md) for more information.
 
-| Name                                               | Description                                                                             |
-|----------------------------------------------------|-----------------------------------------------------------------------------------------|
-| [ansible_playbook](../kalliope/neurons/ansible_playbook/)   | Run an ansible playbook                                                                 |
-| [gmail_checker](../kalliope/neurons/gmail_checker/)         | Get the number of unread email and their subjects from a gmail account                  |
-| [kill_switch](../kalliope/neurons/kill_switch/)             | Stop Kalliope process                                                                   |
-| [neurotransmitter](../kalliope/neurons/neurotransmitter/)   | Link synapse together                                                                   |
-| [push_message](../kalliope/neurons/push_message/)           | Send a push message to a remote device like Android/iOS/Windows Phone or Chrome browser |
-| [rss_reader](../kalliope/neurons/rss_reader/)               | Get items from a RSS feed                                                               |
-| [say](../kalliope/neurons/say/)                             | Make Kalliope talk by using TTS                                                         |
-| [script](../kalliope/neurons/script/)                       | Run an executable script                                                                |
-| [shell](../kalliope/neurons/shell/)                         | Run a shell command                                                                     |
-| [sleep](../kalliope/neurons/sleep/)                         | Make Kalliope sleep for a while before continuing                                       |
-| [systemdate](../kalliope/neurons/systemdate/)               | Give the local system date and time                                                     |
-| [tasker_autoremote](../kalliope/neurons/tasker_autoremote/) | Send a message to Android tasker app                                                    |
-| [twitter](../kalliope/neurons/twitter/)                     | Send a Twit from kalliope                                                               |
-| [uri](../kalliope/neurons/uri/)                             | Interacts with HTTP and HTTPS web services.                                             |
-| [wake_on_lan](../kalliope/neurons/wake_on_lan/)             | Wake on lan a computer                                                                  |
-| [wikipedia_searcher](../kalliope/neurons/wikipedia/)        | Search for a page on Wikipedia                                                          |
+| Name                                                          | Description                                                                             |
+|---------------------------------------------------------------|-----------------------------------------------------------------------------------------|
+| [ansible_playbook](../kalliope/neurons/ansible_playbook/)     | Run an ansible playbook                                                                 |
+| [gmail_checker](../kalliope/neurons/gmail_checker/)           | Get the number of unread email and their subjects from a gmail account                  |
+| [kill_switch](../kalliope/neurons/kill_switch/)               | Stop Kalliope process                                                                   |
+| [neurotransmitter](../kalliope/neurons/neurotransmitter/)     | Link synapse together                                                                   |
+| [push_message](../kalliope/neurons/push_message/)             | Send a push message to a remote device like Android/iOS/Windows Phone or Chrome browser |
+| [rss_reader](../kalliope/neurons/rss_reader/)                 | get rss feed from website                                                               |
+| [say](../kalliope/neurons/say/)                               | Make Kalliope talk by using TTS                                                         |
+| [script](../kalliope/neurons/script/)                         | Run an executable script                                                                |
+| [shell](../kalliope/neurons/shell/)                           | Run a shell command                                                                     |
+| [sleep](../kalliope/neurons/sleep/)                           | Make Kalliope sleep for a while before continuing                                       |
+| [systemdate](../kalliope/neurons/systemdate/)                 | Give the local system date and time                                                     |
+| [tasker_autoremote](../kalliope/neurons/tasker_autoremote/)   | Send a message to Android tasker app                                                    |
+| [twitter](../kalliope/neurons/twitter/)                       | Send a Twit from kalliope                                                               |
+| [uri](../kalliope/neurons/uri/)                               | Interacts with HTTP and HTTPS web services.                                             |
+| [wake_on_lan](../kalliope/neurons/wake_on_lan/)               | Wake on lan a computer                                                                  |
+| [wikipedia_searcher](../kalliope/neurons/wikipedia_searcher/) | Search for a page on Wikipedia                                                          |
 

+ 1 - 1
Docs/neurons.md

@@ -66,7 +66,7 @@ the [template engine](https://en.wikipedia.org/wiki/Jinja_(template_engine)), an
 
 The template engine used in Kalliope is [Jinja2](http://jinja.pocoo.org/docs/dev/).
 
-For example, if we look at the [documentation of the neuron systemedate](../neurons/systemdate), we can see that the neuron will return a dictionary of value like `minute`, `hours` and all other values about the current time on the system where Kalliope is installed.
+For example, if we look at the [documentation of the neuron systemedate](../kalliope/neurons/systemdate), we can see that the neuron will return a dictionary of value like `minute`, `hours` and all other values about the current time on the system where Kalliope is installed.
 
 A simple, that only use **variables**, template would be
 ```

+ 1 - 0
install/files/python_requirements.txt

@@ -1,3 +1,4 @@
+six==1.10.0
 SpeechRecognition>=3.5.0
 markupsafe==0.23
 pyaudio==0.2.9

+ 1 - 6
kalliope/core/MainController.py

@@ -95,9 +95,4 @@ class MainController:
         # take first randomly a path
         random_path = random.choice(random_wake_up_sounds)
         logger.debug("Selected sound: %s" % random_path)
-        if os.path.isabs(random_path):
-            logger.debug("Path of file %s is absolute" % random_path)
-            return random_path
-        else:
-            logger.debug("Path of file %s is relative" % random_path)
-            return "sounds" + os.sep + random_path
+        return Utils.get_real_file_path(random_path)

+ 2 - 9
kalliope/core/NeuronModule.py

@@ -160,15 +160,8 @@ class NeuronModule(object):
             sys.setdefaultencoding('utf-8')
             # the user choose a file_template option
             if self.file_template is not None:  # the user choose a file_template option
-                if not os.path.isabs(self.file_template):  # os.path.isabs returns True if the path is absolute
-                    # here we are
-                    dir_we_are = os.path.dirname(os.path.realpath(__file__))
-                    # root directory
-                    root_dir = os.path.normpath(dir_we_are + os.sep + os.pardir)
-                    # real path of the template
-                    real_file_template_path = os.path.join(root_dir, self.file_template)
-                else:
-                    real_file_template_path = self.file_template
+                real_file_template_path = Utils.get_real_file_path(self.file_template)
+
                 if os.path.isfile(real_file_template_path):
                     # load the content of the file as template
                     t = Template(self._get_content_of_file(real_file_template_path))

+ 1 - 0
setup.py

@@ -57,6 +57,7 @@ setup(
 
     # required libs
     install_requires=[
+        'six==1.10.0',
         'SpeechRecognition>=3.5.0',
         'markupsafe==0.23',
         'pyaudio==0.2.9',