def go_to_formation(clientId, xls_filename, name):

    global global_vars
    global_var = (item for item in global_vars if item["clientId"] == str(clientId)).next()

    global_var['flag_disable_detection'] = 1 # Disable the detection when entering Formation page
    global_var['flag_enable_recog']      = 0

    tb_formation = read_xls(xls_filename, 0) # Read Excel file which contains Formation info
    mail = reform_username(name) # Find email from name
    global_var['text'] = "Bonjour " + str(name)

    if (mail == '.'):
        global_var['text2'] = "Votre information n'est pas disponible !"
        global_var['text3'] = "Veuillez contacter [email protected]"
    else:
        mail_idx = tb_formation[0][:].index('Mail')

        # Get mail list
        mail_list = []
        for idx in range(0, len(tb_formation)):
            mail_list.append(tb_formation[idx][mail_idx])

        ind = mail_list.index(mail) # Find user in xls file based on his/her mail
        date = xlrd.xldate_as_tuple(tb_formation[ind][tb_formation[0][:].index('Date du jour')],0)
        text2 = "Bienvenue à la formation de "+str(tb_formation[ind][tb_formation[0][:].index('Prenom')])+" "+str(tb_formation[ind][tb_formation[0][:].index('Nom')] + ' !')
        text3 = "Vous avez un cours de " + str(tb_formation[ind][tb_formation[0][:].index('Formation')]) + ", dans la salle " + str(tb_formation[ind][tb_formation[0][:].index('Salle')]) + ", à partir du " + "{}/{}/{}".format(str(date[2]), str(date[1]),str(date[0]))
        global_var['text2'] = replace_accents2(text2)
        global_var['text3'] = replace_accents2(text3)

    simple_message(clientId, 'Page Formation', text2 + ' ' + text3)
    return global_var['text'], global_var['text2'], global_var['text3']
def go_to_formation(xls_filename, name):

    global flag_disable_detection, flag_enable_recog, text, text2, text3
    flag_disable_detection = 1 # Disable the detection when entering Formation page
    flag_enable_recog = 0

    tb_formation = read_xls(xls_filename, 0) # Read Excel file which contains Formation info
    mail = reform_username(name) # Find email from name
    text  = "Bonjour " + str(name)

    if (mail == '.'):
        text2 = "Votre information n'est pas disponible !"
        text3 = "Veuillez contacter [email protected]"
    else:
        mail_idx = tb_formation[0][:].index('Mail')

        # Get mail list
        mail_list = []
        for idx in range(0, len(tb_formation)):
            mail_list.append(tb_formation[idx][mail_idx])

        ind = mail_list.index(mail) # Find user in excel file based on his/her mail
        date = xlrd.xldate_as_tuple(tb_formation[ind][tb_formation[0][:].index('Date du jour')],0)
        text2 = "Bienvenue a la formation de "+str(tb_formation[ind][tb_formation[0][:].index('Prenom')])+" "+str(tb_formation[ind][tb_formation[0][:].index('Nom')] + ' !')
        text3 = "Vous avez un cours de " + str(tb_formation[ind][tb_formation[0][:].index('Formation')]) + ", dans la salle " + str(tb_formation[ind][tb_formation[0][:].index('Salle')]) + ", a partir du " + "{}/{}/{}".format(str(date[2]), str(date[1]),str(date[0]))

    simple_message(flag_speech, 'Page Formation', text2+' '+text3)
    return text, text2, text3
def go_to_formation(clientId, xls_filename, name):
    resp = ask_go_to_formation(clientId)
    if (resp==1):

        global global_vars
        global_var = (item for item in global_vars if item["clientId"] == str(clientId)).next()

        global_var['age']     = ''
        global_var['gender']  = ''
        global_var['emo']     = ''

        global_var['flag_disable_detection'] = 1 # Disable the detection when entering Formation page
        global_var['flag_enable_recog']      = 0

        tb_formation = read_xls(xls_filename, 0) # Read Excel file which contains Formation info
        mail = reform_username(name) # Find email from name
        global_var['text'] = "Bonjour " + str(name)

        if (mail == '.'):
            text2 = "Votre information n'est pas disponible !"
            text3 = "Veuillez contacter [email protected]"
        else:
            mail_idx = tb_formation[0][:].index('Mail')

            # Get mail list
            mail_list = []
            for idx in range(0, len(tb_formation)):
                mail_list.append(tb_formation[idx][mail_idx])

            ind = mail_list.index(mail) # Find user in xls file based on his/her mail
            date = xlrd.xldate_as_tuple(tb_formation[ind][tb_formation[0][:].index('Date du jour')],0)
            text2 = "Bienvenue à la formation de "+str(tb_formation[ind][tb_formation[0][:].index('Prenom')])+" "+str(tb_formation[ind][tb_formation[0][:].index('Nom')] + ' !')
            text3 = "Vous avez un cours de " + str(tb_formation[ind][tb_formation[0][:].index('Formation')]) + ", dans la salle " + str(tb_formation[ind][tb_formation[0][:].index('Salle')]) + ", à partir du " + "{}/{}/{}".format(str(date[2]), str(date[1]),str(date[0]))

        global_var['text2'] = replace_accents2(text2)
        global_var['text3'] = replace_accents2(text3)

        simple_message(clientId, text2 + ' ' + text3)
        time.sleep(1)

        link='<a href="http://centre-formation-orange.mybluemix.net">ici</a>'
        chrome_server2client(clientId, u"Cliquez " + link + u" pour accéder à la page Formation pour plus d'information")
        time.sleep(0.5)

        cv2.waitKey(5000)
        return_to_recog(clientId) # Return to recognition program immediately or 20 seconds before returning
    else:
        return_to_recog(clientId) # Return to recognition program immediately or 20 seconds before returning
def go_to_formation(clientId, xls_filename, name):
    resp = ask_go_to_formation(clientId)
    if (resp==1):

        global global_vars
        global_var = (item for item in global_vars if item["clientId"] == str(clientId)).next()

        global_var['flag_disable_detection'] = 1 # Disable the detection when entering Formation page
        global_var['flag_enable_recog']      = 0

        tb_formation = read_xls(xls_filename, 0) # Read Excel file which contains Formation info
        mail = reform_username(name) # Find email from name
        global_var['text'] = "Bonjour " + str(name)

        if (mail == '.'):
            text2 = "Votre information n'est pas disponible !"
            text3 = "Veuillez contacter [email protected]"
            global_var['text2'] = replace_accents2(text2)
            global_var['text3'] = replace_accents2(text3)
        else:
            mail_idx = tb_formation[0][:].index('Mail')

            # Get mail list
            mail_list = []
            for idx in range(0, len(tb_formation)):
                mail_list.append(tb_formation[idx][mail_idx])

            ind = mail_list.index(mail) # Find user in xls file based on his/her mail
            date = xlrd.xldate_as_tuple(tb_formation[ind][tb_formation[0][:].index('Date du jour')],0)
            text2 = "Bienvenue à la formation de "+str(tb_formation[ind][tb_formation[0][:].index('Prenom')])+" "+str(tb_formation[ind][tb_formation[0][:].index('Nom')] + ' !')
            text3 = "Vous avez un cours de " + str(tb_formation[ind][tb_formation[0][:].index('Formation')]) + ", dans la salle " + str(tb_formation[ind][tb_formation[0][:].index('Salle')]) + ", à partir du " + "{}/{}/{}".format(str(date[2]), str(date[1]),str(date[0]))
            global_var['text2'] = replace_accents2(text2)
            global_var['text3'] = replace_accents2(text3)

        simple_message(clientId, text2 + ' ' + text3)
        time.sleep(1)

        link='<a href="http://centre-formation-orange.mybluemix.net">ici</a>'
        simple_message(clientId, u"SILENT Cliquez " + link + u" pour accéder à la page Formation pour plus d'information")
        time.sleep(0.5)

        time.sleep(5)
        return_to_recog(clientId) # Return to recognition program immediately or 20 seconds before returning
    else:
        return_to_recog(clientId) # Return to recognition program immediately or 20 seconds before returning
Exemplo n.º 5
0
 def __init__(self):
     self.tb = read_xls("TextToSpeakRobot_new.xls", 0) # Read Excel file
     self.text_id_idx = self.tb[0][:].index('Text_ID')
     self.questions = []
     for idx in range(0, len(self.tb)):
         self.questions.append(self.tb[idx][self.text_id_idx])
Exemplo n.º 6
0
 def data_anti(self): # Data from antitheses.
     print u"现在获得数据匹配的对象......"
     Antith = read_xls.read_xls()
     Antith.run()
     self.AntDct = Antith.dataDct
Exemplo n.º 7
0
 def data_ori(self): # Data from origin.
     print u"现在请输入想要得到数据表和列....."
     Origin = read_xls.read_xls()
     Origin.run()
     self.OriDct = Origin.dataDct