|
@@ -1,26 +1,18 @@
|
|
|
import threading
|
|
import threading
|
|
|
import traceback
|
|
import traceback
|
|
|
|
|
|
|
|
-import email_mailgun
|
|
|
|
|
import todo_wunderlist
|
|
import todo_wunderlist
|
|
|
import input_sources
|
|
import input_sources
|
|
|
import output
|
|
import output
|
|
|
-import current_time
|
|
|
|
|
import services.help
|
|
import services.help
|
|
|
import echo
|
|
import echo
|
|
|
import duckduckgo_answers
|
|
import duckduckgo_answers
|
|
|
-import music
|
|
|
|
|
import conf
|
|
import conf
|
|
|
|
|
|
|
|
def _get_services(cclient):
|
|
def _get_services(cclient):
|
|
|
res = {
|
|
res = {
|
|
|
- 'email': email_mailgun.Email(),
|
|
|
|
|
- 'food': todo_wunderlist.Wunderlist(True, 'food'),
|
|
|
|
|
- 'todo': todo_wunderlist.Wunderlist(False),
|
|
|
|
|
- 'time': current_time.CurrentTime('Europe/Dublin'),
|
|
|
|
|
'echo': echo.Echo(),
|
|
'echo': echo.Echo(),
|
|
|
'duck': duckduckgo_answers.DuckDuckGo(),
|
|
'duck': duckduckgo_answers.DuckDuckGo(),
|
|
|
- 'play': music.Music(cclient),
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
res['help'] = services.help.Help(res)
|
|
res['help'] = services.help.Help(res)
|
|
@@ -29,6 +21,23 @@ def _get_services(cclient):
|
|
|
import weather
|
|
import weather
|
|
|
res['weather'] = weather.Weather()
|
|
res['weather'] = weather.Weather()
|
|
|
|
|
|
|
|
|
|
+ if conf.MAILGUN_API_KEY:
|
|
|
|
|
+ import email_mailgun
|
|
|
|
|
+ res['email'] = email_mailgun.Email()
|
|
|
|
|
+
|
|
|
|
|
+ if conf.WUNDERLIST_ACCESS_TOKEN:
|
|
|
|
|
+ import todo_wunderlist
|
|
|
|
|
+ res['food'] = todo_wunderlist.Wunderlist(True, 'food')
|
|
|
|
|
+ res['todo'] = todo_wunderlist.Wunderlist(False)
|
|
|
|
|
+
|
|
|
|
|
+ if conf.MUSIC_FOLDERS:
|
|
|
|
|
+ import music
|
|
|
|
|
+ res['play'] = music.Music(cclient)
|
|
|
|
|
+
|
|
|
|
|
+ if conf.TZ:
|
|
|
|
|
+ import current_time
|
|
|
|
|
+ res['time'] = current_time.CurrentTime(conf.TZ)
|
|
|
|
|
+
|
|
|
return res
|
|
return res
|
|
|
|
|
|
|
|
def launch_services(cclient, interrupted):
|
|
def launch_services(cclient, interrupted):
|