From 9a4ae0f32f1aa422264eab55c88304b04aae50d5 Mon Sep 17 00:00:00 2001 From: schneefux Date: Thu, 12 Jun 2014 22:36:33 +0200 Subject: Check if first_name is set for profile beforehand --- client/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/main.py b/client/main.py index 75ee9f6..0b29c75 100644 --- a/client/main.py +++ b/client/main.py @@ -23,7 +23,10 @@ if __name__ == "__main__": mic = Mic("languagemodel.lm", "dictionary.dic", "languagemodel_persona.lm", "dictionary_persona.dic") - mic.say("How can I be of service, %s?" % (profile["first_name"])) + addendum = "" + if 'first_name' in profile: + addendum = ", %s" % profile["first_name"] + mic.say("How can I be of service%s?" % addendum) conversation = Conversation("JASPER", mic, profile) -- cgit v1.3.1