Skip to content

Commit 3e3ffdd

Browse files
Marco BellomoMarco Bellomo
Marco Bellomo
authored and
Marco Bellomo
committed
first commit
0 parents  commit 3e3ffdd

File tree

1,965 files changed

+384039
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,965 files changed

+384039
-0
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
local_settings.py
202 Bytes
Binary file not shown.

index.py

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
3+
import os, requests
4+
import json
5+
import apiai
6+
import local_settings
7+
from time import gmtime, strftime
8+
9+
10+
CLIENT_ACCESS_TOKEN=local_settings.CLIENT_ACCESS_TOKEN
11+
12+
def ascolta_tastiera():
13+
ascolto=input('Enter your input:')
14+
return ascolto
15+
#dialogflow
16+
def elabora(richiesta):
17+
ai = apiai.ApiAI(CLIENT_ACCESS_TOKEN)
18+
19+
request = ai.text_request()
20+
21+
request.lang = 'id' # optional, default value equal 'en'
22+
23+
request.session_id = "1"
24+
25+
request.query = richiesta
26+
27+
#response = request.getresponse()
28+
29+
response = json.loads(request.getresponse().read().decode('utf-8'))
30+
action= response['result']['action']
31+
32+
print(action)
33+
if (action == 'direora'):
34+
message = ' sono le ore '+ strftime("%H:%M ", gmtime())
35+
else :
36+
message = response['result']['fulfillment']['speech']
37+
return (message)
38+
39+
40+
def parla(testo):
41+
os.system("say "+testo )
42+
43+
44+
ascolto=ascolta_tastiera()
45+
risponde=elabora(ascolto)
46+
parla(risponde)

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
requests

touch

Whitespace-only changes.

venv/.Python

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/Python

venv/bin/activate

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# This file must be used with "source bin/activate" *from bash*
2+
# you cannot run it directly
3+
4+
deactivate () {
5+
unset -f pydoc >/dev/null 2>&1
6+
7+
# reset old environment variables
8+
# ! [ -z ${VAR+_} ] returns true if VAR is declared at all
9+
if ! [ -z "${_OLD_VIRTUAL_PATH+_}" ] ; then
10+
PATH="$_OLD_VIRTUAL_PATH"
11+
export PATH
12+
unset _OLD_VIRTUAL_PATH
13+
fi
14+
if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then
15+
PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
16+
export PYTHONHOME
17+
unset _OLD_VIRTUAL_PYTHONHOME
18+
fi
19+
20+
# This should detect bash and zsh, which have a hash command that must
21+
# be called to get it to forget past commands. Without forgetting
22+
# past commands the $PATH changes we made may not be respected
23+
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
24+
hash -r 2>/dev/null
25+
fi
26+
27+
if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then
28+
PS1="$_OLD_VIRTUAL_PS1"
29+
export PS1
30+
unset _OLD_VIRTUAL_PS1
31+
fi
32+
33+
unset VIRTUAL_ENV
34+
if [ ! "${1-}" = "nondestructive" ] ; then
35+
# Self destruct!
36+
unset -f deactivate
37+
fi
38+
}
39+
40+
# unset irrelevant variables
41+
deactivate nondestructive
42+
43+
VIRTUAL_ENV="/Users/marcobellomo/progetti/assistentevocale/venv"
44+
export VIRTUAL_ENV
45+
46+
_OLD_VIRTUAL_PATH="$PATH"
47+
PATH="$VIRTUAL_ENV/bin:$PATH"
48+
export PATH
49+
50+
# unset PYTHONHOME if set
51+
if ! [ -z "${PYTHONHOME+_}" ] ; then
52+
_OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
53+
unset PYTHONHOME
54+
fi
55+
56+
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
57+
_OLD_VIRTUAL_PS1="$PS1"
58+
if [ "x" != x ] ; then
59+
PS1="$PS1"
60+
else
61+
PS1="(`basename \"$VIRTUAL_ENV\"`) $PS1"
62+
fi
63+
export PS1
64+
fi
65+
66+
# Make sure to unalias pydoc if it's already there
67+
alias pydoc 2>/dev/null >/dev/null && unalias pydoc
68+
69+
pydoc () {
70+
python -m pydoc "$@"
71+
}
72+
73+
# This should detect bash and zsh, which have a hash command that must
74+
# be called to get it to forget past commands. Without forgetting
75+
# past commands the $PATH changes we made may not be respected
76+
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
77+
hash -r 2>/dev/null
78+
fi

venv/bin/activate.csh

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This file must be used with "source bin/activate.csh" *from csh*.
2+
# You cannot run it directly.
3+
# Created by Davide Di Blasi <[email protected]>.
4+
5+
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc'
6+
7+
# Unset irrelevant variables.
8+
deactivate nondestructive
9+
10+
setenv VIRTUAL_ENV "/Users/marcobellomo/progetti/assistentevocale/venv"
11+
12+
set _OLD_VIRTUAL_PATH="$PATH"
13+
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
14+
15+
16+
17+
if ("" != "") then
18+
set env_name = ""
19+
else
20+
set env_name = `basename "$VIRTUAL_ENV"`
21+
endif
22+
23+
# Could be in a non-interactive environment,
24+
# in which case, $prompt is undefined and we wouldn't
25+
# care about the prompt anyway.
26+
if ( $?prompt ) then
27+
set _OLD_VIRTUAL_PROMPT="$prompt"
28+
set prompt = "[$env_name] $prompt"
29+
endif
30+
31+
unset env_name
32+
33+
alias pydoc python -m pydoc
34+
35+
rehash
36+

venv/bin/activate.fish

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# This file must be used using `. bin/activate.fish` *within a running fish ( http://fishshell.com ) session*.
2+
# Do not run it directly.
3+
4+
function deactivate -d 'Exit virtualenv mode and return to the normal environment.'
5+
# reset old environment variables
6+
if test -n "$_OLD_VIRTUAL_PATH"
7+
set -gx PATH $_OLD_VIRTUAL_PATH
8+
set -e _OLD_VIRTUAL_PATH
9+
end
10+
11+
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
12+
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
13+
set -e _OLD_VIRTUAL_PYTHONHOME
14+
end
15+
16+
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
17+
# Set an empty local `$fish_function_path` to allow the removal of `fish_prompt` using `functions -e`.
18+
set -l fish_function_path
19+
20+
# Erase virtualenv's `fish_prompt` and restore the original.
21+
functions -e fish_prompt
22+
functions -c _old_fish_prompt fish_prompt
23+
functions -e _old_fish_prompt
24+
set -e _OLD_FISH_PROMPT_OVERRIDE
25+
end
26+
27+
set -e VIRTUAL_ENV
28+
29+
if test "$argv[1]" != 'nondestructive'
30+
# Self-destruct!
31+
functions -e pydoc
32+
functions -e deactivate
33+
end
34+
end
35+
36+
# Unset irrelevant variables.
37+
deactivate nondestructive
38+
39+
set -gx VIRTUAL_ENV "/Users/marcobellomo/progetti/assistentevocale/venv"
40+
41+
set -gx _OLD_VIRTUAL_PATH $PATH
42+
set -gx PATH "$VIRTUAL_ENV/bin" $PATH
43+
44+
# Unset `$PYTHONHOME` if set.
45+
if set -q PYTHONHOME
46+
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
47+
set -e PYTHONHOME
48+
end
49+
50+
function pydoc
51+
python -m pydoc $argv
52+
end
53+
54+
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
55+
# Copy the current `fish_prompt` function as `_old_fish_prompt`.
56+
functions -c fish_prompt _old_fish_prompt
57+
58+
function fish_prompt
59+
# Save the current $status, for fish_prompts that display it.
60+
set -l old_status $status
61+
62+
# Prompt override provided?
63+
# If not, just prepend the environment name.
64+
if test -n ""
65+
printf '%s%s' "" (set_color normal)
66+
else
67+
printf '%s(%s) ' (set_color normal) (basename "$VIRTUAL_ENV")
68+
end
69+
70+
# Restore the original $status
71+
echo "exit $old_status" | source
72+
_old_fish_prompt
73+
end
74+
75+
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
76+
end

venv/bin/activate_this.py

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""By using execfile(this_file, dict(__file__=this_file)) you will
2+
activate this virtualenv environment.
3+
4+
This can be used when you must use an existing Python interpreter, not
5+
the virtualenv bin/python
6+
"""
7+
8+
try:
9+
__file__
10+
except NameError:
11+
raise AssertionError(
12+
"You must run this like execfile('path/to/activate_this.py', dict(__file__='path/to/activate_this.py'))")
13+
import sys
14+
import os
15+
16+
old_os_path = os.environ.get('PATH', '')
17+
os.environ['PATH'] = os.path.dirname(os.path.abspath(__file__)) + os.pathsep + old_os_path
18+
base = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
19+
if sys.platform == 'win32':
20+
site_packages = os.path.join(base, 'Lib', 'site-packages')
21+
else:
22+
site_packages = os.path.join(base, 'lib', 'python%s' % sys.version[:3], 'site-packages')
23+
prev_sys_path = list(sys.path)
24+
import site
25+
site.addsitedir(site_packages)
26+
sys.real_prefix = sys.prefix
27+
sys.prefix = base
28+
# Move the added items to the front of the path:
29+
new_sys_path = []
30+
for item in list(sys.path):
31+
if item not in prev_sys_path:
32+
new_sys_path.append(item)
33+
sys.path.remove(item)
34+
sys.path[:0] = new_sys_path

venv/bin/chardetect

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/Users/marcobellomo/progetti/assistentevocale/venv/bin/python3
2+
3+
# -*- coding: utf-8 -*-
4+
import re
5+
import sys
6+
7+
from chardet.cli.chardetect import main
8+
9+
if __name__ == '__main__':
10+
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
11+
sys.exit(main())

venv/bin/easy_install

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/Users/marcobellomo/progetti/assistentevocale/venv/bin/python3
2+
3+
# -*- coding: utf-8 -*-
4+
import re
5+
import sys
6+
7+
from setuptools.command.easy_install import main
8+
9+
if __name__ == '__main__':
10+
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
11+
sys.exit(main())

venv/bin/easy_install-3.6

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/Users/marcobellomo/progetti/assistentevocale/venv/bin/python3
2+
3+
# -*- coding: utf-8 -*-
4+
import re
5+
import sys
6+
7+
from setuptools.command.easy_install import main
8+
9+
if __name__ == '__main__':
10+
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
11+
sys.exit(main())

venv/bin/f2py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/Users/marcobellomo/progetti/assistentevocale/venv/bin/python3
2+
# See http://cens.ioc.ee/projects/f2py2e/
3+
from __future__ import division, print_function
4+
5+
import os
6+
import sys
7+
for mode in ["g3-numpy", "2e-numeric", "2e-numarray", "2e-numpy"]:
8+
try:
9+
i = sys.argv.index("--" + mode)
10+
del sys.argv[i]
11+
break
12+
except ValueError:
13+
pass
14+
os.environ["NO_SCIPY_IMPORT"] = "f2py"
15+
if mode == "g3-numpy":
16+
sys.stderr.write("G3 f2py support is not implemented, yet.\\n")
17+
sys.exit(1)
18+
elif mode == "2e-numeric":
19+
from f2py2e import main
20+
elif mode == "2e-numarray":
21+
sys.argv.append("-DNUMARRAY")
22+
from f2py2e import main
23+
elif mode == "2e-numpy":
24+
from numpy.f2py import main
25+
else:
26+
sys.stderr.write("Unknown mode: " + repr(mode) + "\\n")
27+
sys.exit(1)
28+
main()

venv/bin/pip

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/Users/marcobellomo/progetti/assistentevocale/venv/bin/python3
2+
3+
# -*- coding: utf-8 -*-
4+
import re
5+
import sys
6+
7+
from pip._internal import main
8+
9+
if __name__ == '__main__':
10+
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
11+
sys.exit(main())

venv/bin/pip3

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/Users/marcobellomo/progetti/assistentevocale/venv/bin/python3
2+
3+
# -*- coding: utf-8 -*-
4+
import re
5+
import sys
6+
7+
from pip._internal import main
8+
9+
if __name__ == '__main__':
10+
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
11+
sys.exit(main())

venv/bin/pip3.6

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/Users/marcobellomo/progetti/assistentevocale/venv/bin/python3
2+
3+
# -*- coding: utf-8 -*-
4+
import re
5+
import sys
6+
7+
from pip._internal import main
8+
9+
if __name__ == '__main__':
10+
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
11+
sys.exit(main())

venv/bin/python

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python3

0 commit comments

Comments
 (0)