Begin add search module
This commit is contained in:
parent
d753d98637
commit
be1cd97916
7 changed files with 36 additions and 5 deletions
4
resources/neurons/.gitignore
vendored
4
resources/neurons/.gitignore
vendored
|
@ -1,4 +0,0 @@
|
|||
# Ignore everything in this directory
|
||||
*
|
||||
# Except this file
|
||||
!.gitignore
|
1
resources/neurons/search/.gitignore
vendored
Normal file
1
resources/neurons/search/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
__pycache__
|
1
resources/neurons/search/__init__.py
Normal file
1
resources/neurons/search/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
from .search import Search
|
15
resources/neurons/search/search.py
Normal file
15
resources/neurons/search/search.py
Normal file
|
@ -0,0 +1,15 @@
|
|||
import logging
|
||||
import subprocess
|
||||
|
||||
from kalliope.core import NeuronModule
|
||||
from kalliope.core.NeuronModule import MissingParameterException
|
||||
|
||||
class Search(NeuronModule):
|
||||
def __init__(self, **kwargs):
|
||||
super(Search, self).__init__(**kwargs)
|
||||
|
||||
self.query = kwargs.get('search', None)
|
||||
|
||||
if self.query is not None:
|
||||
command = "xdg-open \"https://www.google.fr/search?q="+self.query+"&ie=utf-8&oe=utf-8\" &"
|
||||
p = subprocess.Popen(command, shell=True)
|
Loading…
Add table
Add a link
Reference in a new issue