def handle(self, hands):

        if (not self.eval_state(hands[0])):
            return

        minx, maxx = -200, 200
        miny, maxy = 0, 200
        minz, maxz = -200, 200

        normx = min(max(minx, hands[0][self.hand]['x']),
                    maxx) / float(maxx - minx) * 2
        normy = min(max(miny, hands[0][self.hand]['y']) + self.yoffset,
                    maxy) / float(maxy - miny) * 2
        normz = min(max(minz, hands[0][self.hand]['z']),
                    maxz) / float(maxz - minz) * 2

        send(type=1, how=1, angle=0.0, distance=0.0, x=normx, y=normy, z=normz)
Beispiel #2
0
def sending_email():
    """Email script with email box input from user)"""

    reciever_addr = input("Please provide Your email adress\n")
    time = datetime.datetime.now()
    #server commends
    server = server_info
    server.ehlo()
    server.starttls()
    server.ehlo()

    #credentials of sender
    who = "michael93pl"
    password = additional.x

    #logging in
    server.login(who, password)

    #template for recievers
    toaddr = [reciever_addr]
    cc = []
    subject = "Weather for {}.".format(time)
    text = str(main.send())

    #MSG template

    message = MIMEMultipart()
    message['From'] = "Michal <{}>".format(who)
    message['To'] = ", ".join(toaddr)
    message['Cc'] = ", ".join(cc)
    message['Subject'] = subject
    message.attach(MIMEText(text))

    msg = message.as_string()

    #Join reciever with CC

    final_to = cc + toaddr

    server.sendmail(who, final_to, msg)

    print("Email sent at {}".format(time))
Beispiel #3
0
def testVoice(text):
    import apis.voicerss
    import main
    voice = apis.voicerss.getVoice(text)
    main.send('13278104', voice = voice)
Beispiel #4
0
def testUnkown(inp):
    response = responder.reply_to_unknown_chat(inp)
    if not response:
        print 'Response is empty'
        return
    main.send(database.get_setting(Setting.ADMIN_ID), response)
Beispiel #5
0
 def send(msg):
     main.send(msg, chat_id)
Beispiel #6
0
from main import send

user_name = input('Enter your name:')

print('hello, ' + user_name)

while True:
    message = input(' > ')
    if message == 'exit':
        break
    send(routing_key=user_name, message=message)

print('Goodby!')