Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add open terminal command and "night" piece of time. #97

Merged
merged 3 commits into from
Jan 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions dragonfire/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ def command(self, com):
userin.execute(["plasma-discover"], "Software Center") # KDE neon
userin.execute(["software-center"], "Software Center") # elementary OS & Ubuntu
return userin.say("Software Center")
if h.check_noun_lemma("console"): #for openin terminal.
userin.execute(["konsole"], "Terminal") # KDE neon
userin.execute(["gnome-terminal"], "Terminal") # elementary OS & Ubuntu
return userin.say("console")
if h.check_lemma("be") and h.check_lemma("-PRON-") and (h.check_lemma("lady") or h.check_lemma("woman") or h.check_lemma("girl")):
config_file.update({'gender': 'female'}, Query().datatype == 'gender')
config_file.remove(Query().datatype == 'callme')
Expand Down Expand Up @@ -620,12 +624,14 @@ def greet(userin):
config_file.insert({'datatype': 'gender', 'gender': gender})
user_prefix = GENDER_PREFIX[gender]

if time < datetime.time(12):
if datetime.time(4) < time < datetime.time(12):
time_of_day = "morning"
elif datetime.time(12) < time < datetime.time(18):
time_of_day = "afternoon"
else:
elif datetime.time(18) < time < datetime.time(22):
time_of_day = "evening"
else:
time_of_day = "night"
userin.execute(["echo"], "To activate say 'Dragonfire!' or 'Wake Up!'")
return userin.say(" ".join(["Good", time_of_day, user_prefix]))

Expand Down