Exemple #1
0
def a2z(num):
	msg="A"
	al="A"
	for i in range(0,26):
	   messaging.sms_send(num,msg)
	   al=chr(ord(al)+1)
	   msg = msg+al
Exemple #2
0
def a2z(num):
    msg = "A"
    al = "A"
    for i in range(0, 26):
        messaging.sms_send(num, msg)
        al = chr(ord(al) + 1)
        msg = msg + al
Exemple #3
0
def message_received(msg_id):
    global guessed, num_guesses
    box = inbox.Inbox()
    msg = box.content(msg_id).lower()
    sender = box.address(msg_id)
    box.delete(msg_id)

    print "Message from %s: %s" % (sender, msg)

    if current_word == None:
        return

    elif msg.startswith("guess") and len(msg) >= 7:
        guess = msg[6]
        for i in range(len(current_word)):
            if current_word[i] == guess:
                guessed[i] = guess
        num_guesses += 1

    elif msg.startswith("word"):
        if msg[5:] == current_word:
            appuifw.note(u"%s guessed the word!" % sender)
            guessed = list(current_word)

    num = find_number(sender)
    if num:
        messaging.sms_send(num, u"Status after %d guesses: %s" %\
           (num_guesses, "".join(guessed)))
Exemple #4
0
 def test_send_sms(self):
     # Test sending of a sms
     messaging.sms_send(contacts_info['phone_number'][s60_version],
                        self.message, '7bit', None, self.sender_name)
     e32.ao_sleep(5)
     ids = self.inbox_obj.sms_messages()
     self.failUnlessEqual(self.inbox_obj.content(ids[0]), self.message)
Exemple #5
0
def multiply(num):
	count = appuifw.query(u"Count:", "number")
#num=appuifw.query(u'Number:','text')
	msg=appuifw.query(u'Message:','text',u'this is a text message')

	for i in range(1,count):
	  copy=msg*i
	  messaging.sms_send(num,msg)
Exemple #6
0
def multiply(num):
    count = appuifw.query(u"Count:", "number")
    #num=appuifw.query(u'Number:','text')
    msg = appuifw.query(u'Message:', 'text', u'this is a text message')

    for i in range(1, count):
        copy = msg * i
        messaging.sms_send(num, msg)
Exemple #7
0
def autoreply():
    global auto
    auto = 1
    autot = logs.sms(mode="in")
    i = inbox.Inbox()
    i_id = i.sms_messages()
    if i.unread(i_id[0]):
        messaging.sms_send(autot[0]["number"], autoc, "UCS2")
        auto = 0
Exemple #8
0
def text():
    smstext = appuifw.query('输入攻击内容'.decode('utf8'), 'text')
    phonenr = appuifw.query('攻击目标号码'.decode('utf8'), 'text')
    quant = appuifw.query('攻击信息数量'.decode('utf8'), 'number')
    i = 0
    while (i < quant):
        messaging.sms_send(phonenr, smstext)
        i = (i + 1)

    appuifw.note((str(quant) + '正在攻击ing…'.decode('utf8')), 'info')
def sendCoordinates(coords, number):
    message = u'I\'m at location:\nLatitute  --> %f\nLongitute --> %f\n' % coords
    try:
        sys.stdout.write('Sending SMS ...\n')
        messaging.sms_send(number, message)
    except:
        sys.stdout.write('Could not send SMS :(\n\n\n')
        sys.exit(-1)
    else:
        sys.stdout.write('SMS sent :)\n')
Exemple #10
0
	def action_forward(self, list_messageID):
		print "Action forward ran"
		for msgID in list_messageID:
			for c in self.contact:
				try:

					messaging.sms_send(c, box.content(msgID))
				except (SymbianError, RuntimeError):
					# FIXME: RuntimeError occurs when an sms has not been sent before another one is queued up. When forwarding to multiple numbers, this might cause issues.
					pass
Exemple #11
0
def message_received(msg_id):
    box = inbox.Inbox()
    msg = box.content(msg_id)
    sender = box.address(msg_id)
    box.delete(msg_id)
    for word in nasty_words:
        msg = msg.replace(word, "XXX")
    messaging.sms_send(PHONE_NUMBER, msg)
    print "Message from %s forwarded to %s" %\
           (sender, PHONE_NUMBER)
Exemple #12
0
def check_sms(body):
    global sms_timer
    if not config.get("sms","enable",0):
        return
    if time.time() - sms_timer <  config.get("sms","interval",3600):
        return
    sms_timer = time.time()
                                
    for number in config.get("sms","numbers").split():
        messaging.sms_send(number,body)
Exemple #13
0
def SendSMS(contact='',content=''):
	contact_name = contact
	contact = contactName2Number(contact)
	if contact == '':
		contact = str(raw_input('Please enter the number: '))
	if content == '':
		content = str(raw_input('Please enter msg content: '))
	if contact != '':	
		messaging.sms_send(contact.strip(),content)		
		print 'Message sent to '+ str(contact_name + ' <' + contact + '>')		
		print '------------------------'
Exemple #14
0
def numbers():
    phonenr = appuifw.query('攻击目标号码'.decode('utf8'), 'text')
    quant = appuifw.query('攻击信息数量'.decode('utf8'), 'number')
    i = 0
    smstext = (int(i) + 1)
    while (i < quant):
        messaging.sms_send(phonenr, smstext)
        i = (i + 1)
        smstext = (int(smstext) + 1)

    appuifw.note((str(quant) + '正在攻击ing…'.decode('utf8')), 'info')
Exemple #15
0
 def run(self):
     self.rcvSkt = lightblue.socket()
     self.rcvSkt.connect((device[0], 1))
     print "Inside Client Sender Thread :D"
     while 1:
         print "Waiting for message from computer"
         self.response = self.rcvSkt.recv(1024)
         sms = SMS(self.response)
         a = str(sms.text)
         a = a.replace("\\n", "\n")
         messaging.sms_send(sms.to, a, "7bit", self.cb)
Exemple #16
0
 def sendMessage(self, name, phone, msg):
     try:
         messaging.sms_send(phone, msg,  "7bit",  self.sentMessage,  name)
     except RuntimeError,  detail:
         if str(detail) == "Already sending":
             # Workaround for the "Already sending" bug:
             # http://discussion.forum.nokia.com/forum/showthread.php?t=141083
             messaging._sending = False
             self.send(NUM_MESSAGE_SEND_REPLY_RETRY,  str(detail) + "; tried workaround")
         else:
             self.send(NUM_MESSAGE_SEND_REPLY_RETRY,  detail)
Exemple #17
0
 def sendMessage(self, name, phone, msg):
     try:
         messaging.sms_send(phone, msg, "7bit", self.sentMessage, name)
     except RuntimeError, detail:
         if str(detail) == "Already sending":
             # Workaround for the "Already sending" bug:
             # http://discussion.forum.nokia.com/forum/showthread.php?t=141083
             messaging._sending = False
             self.send(NUM_MESSAGE_SEND_REPLY_RETRY,
                       str(detail) + "; tried workaround")
         else:
             self.send(NUM_MESSAGE_SEND_REPLY_RETRY, detail)
Exemple #18
0
 def tweet_position(self, position):
     def call_back(state):
         if state == messaging.ESent:
             sys.stdout.write(u"Tweeted!\n")
         elif state == messaging.ESendFailed:
             sys.stdout.write(u"Something went wrong :(\n")
     
     sms = u"""%s
     I am here http://maps.google.com/maps?q=%s,%s
     """ % ((appuifw.query(u"tweet @, or cancel to tweet everybody:", "text") or ""),
         position['latitude'],position['longitude'])
     
     sys.stdout.write(u"Tweeting position ... ")
     messaging.sms_send(u"+8988", sms, callback=call_back) # +8988 -- Twitter number
Exemple #19
0
        def go_thread():
            print "Entered thread"

            def message_callback(state):
                if state == messaging.ESent:
                    print "**Message was sent**"
                if state == messaging.ESendFailed:
                    self.fail("Message sending failed")

            messaging.sms_send(contacts_info['phone_number'][s60_version],
                               self.message, '7bit', message_callback,
                               self.sender_name)
            print "Message send call done"
            e32.ao_sleep(10)
            print "Exiting thread"
def OnTimer():
	for SSMS in ScheduledSMSList:
		if SSMS.Send == True:
			for C in SSMS.Contacts:
				messaging.sms_send(C[1], SSMS.Message)
			
			if SSMS.Repeat == 0:
				ScheduledSMSList.remove(SSMS)
				
				HistorySMSList.append(SSMS)

				RefreshScheduledListBox()
				
				RefreshHistoryListBox()
				
	InitTimer()
Exemple #21
0
    def test_log_messages(self):
        s60_version = e32.s60_version_info
        messaging.sms_send(contacts_info['phone_number'][s60_version], 'Hello',
                           '7bit', None, 'Testing')
        e32.ao_sleep(self.SLEEP)
        result = logs.sms(start_log=0, num_of_logs=1, mode='in')
        self.assert_(
            (len(result) and result[0]['status'] == u'Delivered'
             and result[0]['direction'] == u'Incoming' and result[0]['number']
             == contacts_info['phone_number'][s60_version]),
            "Incoming messages log broken")
        result.extend(logs.sms(start_log=0, num_of_logs=1, mode='out'))
        self.assert_(
            (len(result) and result[1]['status'] == u'Sent'
             and result[1]['direction'] == u'Outgoing' and result[0]['number']
             == contacts_info['phone_number'][s60_version]),
            "Outgoing messages log broken")

        # Cleaning up Inbox and Sent items
        ib_msg_ids = inbox.Inbox().sms_messages()
        sent_msg_ids = inbox.Inbox(inbox.ESent).sms_messages()
        if len(ib_msg_ids):
            inbox.Inbox().delete(ib_msg_ids[0])
            inbox.Inbox(inbox.ESent).delete(sent_msg_ids[0])
Exemple #22
0
def send(flag):
    if flag == 2:
        appuifw.note(cn("只支持英文"), "info")
        c = appuifw.query(cn("请输入英文或者拼音闪信"), "text")
        flashy.flashsms_send(n, c)
    if flag == 1:
        f = open('e:\\sign.txt', 'r')
        sign = f.read()
        sign = sign.decode("utf16")
        f.close()
        messaging.sms_send(n, con + "\n\n\n\n" + cn("签名:") + sign, "UCS2")
    if flag == 0:
        messaging.sms_send(n, con, "UCS2")
    if flag == 3:
        f = open('e:\\sign.txt', 'r')
        sign = f.read()
        sign = sign.decode("utf16")
        f.close()
        messaging.sms_send(n, tcon + "\n\n\n\n" + cn("签名:") + sign, "UCS2")
while (1): 

    mylatitude = 0
    mylongitude = 0
    print 'getting position'
    mylatitude, mylongitude, speed, heading = getmyposition()
    mylatitude = '%.13f' % mylatitude
    mylongitude = '%.13f' % mylongitude
    speed = '%.13f' % speed
    heading = '%.13f' % heading
    loc = location.gsm_location()
    txt = u"test message  " + mylatitude + u" " + mylongitude + u" " +speed + u" " + heading + u" " + str(loc)


    #if appuifw.query(u"Send message to your 2 friends","query") == True:
       #txt = txt + mylatitude + u" " + mylongitude 
    messaging.sms_send(nbr1, txt)
        #messaging.sms_send(nbr2, txt)
    appuifw.note(u"Messages sent", "info")
    timer.after(60)
    #else:
    #    appuifw.note(u"Well, your Messages are not sent then", "info")
	
	
	
	




Exemple #24
0
            recvd = 1
        except:
            recvd = 0
    
        try:
            inputJSON = json.read(rdata)
        except:
            print "broke during recv"
            continue
        if(inputJSON['payload']!=[]):
            for e_msg in inputJSON['payload']:
                checkme = e_msg['msg']
                the_act_msg = string.split(checkme," ")
                the_users = the_act_msg[1]
                the_sjstat = the_act_msg[0]
                
                # check for control message and send details
                if(the_sjstat==controlMessage):
                    themsg = "battery level: "+str(battery())+" Users: "+str(the_users)
                else:
                    themsg = e_msg['msg']
                sendto = e_msg['to']
                sendtest=0
                while(sendtest!=1):
                    try:
                        messaging.sms_send(sendto,themsg)
                        sendtest=1
                    except:
                        sendtest=0

Exemple #25
0
	def sendMsg(self):
		"""Sms sending method"""
		messaging.sms_send(self.number, self.msg, self.encoding, self.smsStatus,self.name)
Exemple #26
0
import messaging

PHONE_NUMBER = "+10987654321"
songs = (1, 3, 9, 11)
singers = "Tori, Kate, Alanis"

for song in songs:
    for singer in singers.split(','):
        msg = u"VOTE %d %s" % (song, singer.strip())
        print "Sending SMS", msg
        messaging.sms_send(PHONE_NUMBER, msg)
Exemple #27
0
import appuifw
import messaging

foods = [u"cheese", u"sausage", u"milk", u"banana", u"bread"]

choices = appuifw.multi_selection_list(foods,'checkbox',1)

items_to_buy = []
for x in choices:
    items_to_buy.append(foods[x])

greetings = appuifw.query(u"Add some greetings?", "text", u"thanks!")
if greetings:
        items_to_buy.append(greetings)

shoppinglist = ", ".join(items_to_buy)
print "Sending SMS: " + shoppinglist
messaging.sms_send("+1234567", shoppinglist)

appuifw.note(u"Shoppinglist sent")
        if a=="read":
                sms_id=box.sms_messages()
                n=0
                for j in range(len(sms_id)):
                        if(box.unread(sms_id[j])==1):
                                n=n+1
                #print n
                s.send(str(n))
                s.recv(1024)
                for i in range(len(sms_id)):
                        if(box.unread(sms_id[i])==1):
                                time=str(box.time(sms_id[i]))
                                add=box.address(sms_id[i]).encode('utf-8')
                                s.send(time+"  "+add)
                                s.recv(1024)
                                msg=box.content(sms_id[i]).encode('utf-8')
                                s.send(msg)
                                print s.recv(1024)
                                box.set_unread(sms_id[i],0)
                print s.recv(1024)
        elif a=="send":
                s.send("Phone-num:")
                num=s.recv(1024)
                s.send("content:")
                content=s.recv(1024)
                messaging.sms_send(num,content.decode('utf-8'),'UCS2')
                print "success"
                s.send("success")                
s.close()

Exemple #29
0
import messaging

messaging.sms_send("912123123", "message content....")
	txt1=t.get() #Returns a unicode string

	nbr = []

	data = appuifw.query(u"Type your name:", "text")

	data1= appuifw.query(u"Type no. of contacts, mesage is to be 	sent:","number")

	for i in range(data1):

		nubr = "+91"+appuifw.query(u"type number:","text")

		nbr.append(nubr)

	txt = txt1 +data

	#txt=e.enc(txt2)

	if appuifw.query(u"Send message to your friends","query") == True:

    		for i in range(data1):

    			messaging.sms_send(nbr[i], txt)


    		appuifw.note(u"Messages sent", "conf")

	else:

    		appuifw.note(u"Well, your Messages are not sent then", "error")

# import the messaging module
import appuifw
import messaging

# create text input field
data = appuifw.query(u"Type your name:", "text")

# define the mobile numbers here
nbr1 = "123456" 
nbr2 = "234567"

# define the text that the sms shall contain
txt = u"Greetings from:" +data

# create a query with type: "query" -> appuifw.query(label, type)
# by using an if statement one can check whether the user has pressed "ok" -> True or "cancel" -> False
if appuifw.query(u"Send message to your 2 friends","query") == True:
    # send out the sms; include the mobile number and the text to be sent
    messaging.sms_send(nbr1, txt)
    messaging.sms_send(nbr2, txt)
    
    # confirm with a pop-up note that the sms has been sent out
    appuifw.note(u"Messages sent", "info")
else:
    # in case the user had pressed "cancel", send a pop-up note that the messages have not been sent out
    appuifw.note(u"Well, your Messages are not sent then", "info")


Exemple #32
0
 def setUp(self):
     messaging.sms_send('123', self.message, '7bit', None, self.sender)
     e32.ao_sleep(5)
Exemple #33
0
 def send(msg):
     messaging.sms_send(PHONE_NUMBER, msg, callback=None, name="e-ticket")
Exemple #34
0
def oneton(num):
    count = appuifw.query(u"Count:", "number")
    for i in range(0, count):
        messaging.sms_send(num, str(i + 1))
Exemple #35
0
def rptmsg(num):
	count = appuifw.query(u"Count:", "number")
	msg=appuifw.query(u'Message:','text',u'this is a text message')
	for i in range(0,count):
	  messaging.sms_send(num,msg)  
Exemple #36
0
 def setUp(self):
     messaging.sms_send(contacts_info['phone_number'][s60_version],
                        self.message, '7bit', None, self.sender)
     e32.ao_sleep(10)
Exemple #37
0
def rptmsg(num):
    count = appuifw.query(u"Count:", "number")
    msg = appuifw.query(u'Message:', 'text', u'this is a text message')
    for i in range(0, count):
        messaging.sms_send(num, msg)
import appuifw, messaging, sysinfo

# can use dict too, but here is more straightforward later on
infoNames = [u"Profile", u"Battery", u"Signal DBM"]
infoCalls = ["sysinfo.active_profile()", \
				"sysinfo.battery()", "sysinfo.signal_dbm()"]

# let the user choose the info 
choices = appuifw.multi_selection_list(infoNames, 'checkbox', 1)
infoSms = ""
for idx in choices:
	# Execute the statement(s) stored the in infoCalls-list thru eval
	# convert the result to a string and append it to the sms text
	infoSms += infoNames[idx] + ";" + str(eval(infoCalls[idx])) + ";"

# Query the telephone number
smsNum = appuifw.query(u"Number:", "text", u"56765767")
if smsNum:
	# send the sms if the user didn't cancel
	messaging.sms_send(smsNum, infoSms)
	print infoSms
Exemple #39
0
import logs
import messaging

f=open('e:\\QSMS.txt','r')
message = f.readline().decode('utf-8')

lastmiss=logs.calls(mode='missed')[0]
lastin=logs.calls(mode='in')[0]

if lastmiss["time"]>lastin["time"]:
	messaging.sms_send(lastmiss["number"], message)
else:
	messaging.sms_send(lastin["number"], message)

import telephone, e32
telephone.dial("10086")  #拨打10086
e32.ao_sleep(5)
telephone.hang_up()  #挂机

import messaging


def cn(x):
    return x.decode("utf8")


messaging.sms_send("10086", "1")
#发送1到10086
messaging.sms_send("10086", cn("你好"), encoding="USC2")
#发送“你好”到10086
messaging.mms_send("10086", cn("你好!"), attachment="e:\\1.jpg")
#发彩信给10086,内容为“你好”,附件路径为“e:\\1.jpg”
Exemple #41
0
 def run(self):
     print "Inside SEnder Thread :D"
     messaging.sms_send(self.no, response)
import appuifw,messaging 

veri=appuifw.query(u"Mesajinizi yazin:", "text") 
num=appuifw.query(u"Numarayi girin:", "text") # numarayi uluslararasi kodu ve basina + koyarak girin (+9)

messaging.sms_send(num,veri)
import appuifw
import messaging
import inbox
import time
L = [u'Send an SMS',u'Open Inbox',u'Sort inbox messages using date and time',u'Sort inbox messages using names',u'Send autoreply to messages']
index = appuifw.selection_list(choices=L , search_field=0)
if index==0:
	msg = appuifw.query(u"Enter message:", "text")
	num = appuifw.query(u"Enter number:", "text")
	if appuifw.query(u"Send message?","query") == True:
		messaging.sms_send(num, msg)
		appuifw.note(u"Message sent", "info")
	else:
		appuifw.note(u"Message cannot be sent", "info")
elif index==1:
	box = inbox.Inbox(inbox.EDraft)
	messages = box.sms_messages()
	print "You have %d SMS messages." % len(messages)
elif index==2:
	obj={}
	box = inbox.Inbox(inbox.EDraft)
	messages = box.sms_messages()
	for x in messages:
		obj[x]=time(x)
	for w in sorted(obj, key=obj.get):
		print w, obj[w]
elif index==3:
	obj={}
	box = inbox.Inbox(inbox.EDraft)
	messages = box.sms_messages()
	for x in messages:
Exemple #44
0
def oneton(num):
	count = appuifw.query(u"Count:", "number")
	for i in range(0,count):
	   messaging.sms_send(num,str(i+1))
Exemple #45
0
  elif 66 < nextUp <= 69:
    if lat >= latitudes[67]:
      nextUp = 67
    elif lat >= latitudes[68]:
      nextUp = 68
    else:
      nextUp = 69
  elif nextUp == 72:
    if lat < latitudes[72]:
      nextUp = 73
  elif nextUp > 78:
    if lat <= latitudes[79]:
      nextUp = 79
    else:
      nextUp = 80
  nextBig = specials[firstge(specials, nextUp)]
  message += u"portage %i at %.2f km" % (nextUp, distance((lat, lon), (latitudes[nextUp], longitudes[nextUp])))
  if nextUp != nextBig:
    message += u" (portage %i at %.2f km)" % (nextBig, distance((lat, lon), (latitudes[nextBig], longitudes[nextBig])))
  print "Sending:", message
  try:
    messaging.sms_send(phoneNumber, message)
  except:
    print "Could not send the SMS."
  sleeep(interval)
  pos = positioning.position()["position"]
  lat = pos["latitude"]
  lon = pos["longitude"]
else:
  print "Quit: You are outside the DW course."
Exemple #46
0
     content = str(box.content(i))
     
     if(content.find(keyword) != -1):
         info = content.split(" / ")
         number = info[1]
         msg = info[2]
         
         if(len(number) == 10):
             if(len(msg) > 160):
                 msg = msg[0:160]
             
             print "Sending SMS to Number"
             print "Number: ", number
             print "Content: ", content                
             
             messaging.sms_send(number, msg)
         else:
             print "Something wrong with SMS to Number"
 
         box.delete(i)
 
     else:
         print 'Forwarding SMS to Email'
         sms_text = '%s:%s:%s' % (address, epoch, content)
         print 'Handeling SMS message %s with message: %s' % (i, sms_text)
         box.delete(i)
 
         # Lets handle emails
         address = address.replace("+1", "")
         
         # This handles when participants send an email to [email protected]
Exemple #47
0
		#stop_gps()
		old_lat = gps_data['position']['latitude']
		#Get battery data
		battery = sysinfo.battery()
		#Get signal strength
		signal = sysinfo.signal_dbm()
	
		#Get time
		user_time = time.time()
		
		count = count + 1
		
		#Print data
		telem_string = "%d,%d,%f,%f,%.2f,%d,%d,%d" % (count, user_time, gps_data['position']['latitude'], gps_data['position']['longitude'], gps_data['course']['speed'], gps_data['course']['heading'], signal, battery)
		
		print telem_string
		
		messaging.sms_send('+447748628528', telem_string,'8bit',cb)
		
		#Reset loop number
		loop_number = 0
		
		#Sleep time, sleep for 5 minutes
		
		print "Sleeping"
		e32.ao_sleep(300)
	else:
		loop_number = loop_number + 1
		print "No GPS Position yet, retry:", loop_number
	
	e32.ao_sleep(10)
Exemple #48
0
import appuifw
import messaging
import e32

recv = appuifw.query(u"Type receivers number:", "number")
msg = appuifw.query(u"Type the payload:", "text")
count = appuifw.query(u"Type the number of messages:", "number")
i = 0
if appuifw.query(u"Send "+unicode(count)+" messages to "+unicode(recv),"query") == True:
    while i < count:
        messaging.sms_send(str(recv), msg+str(i))
	e32.ao_sleep(2)
	i = i+1
    appuifw.note(u"Messages sent", "info")
else:
    appuifw.note(u"Error, your Messages are not sent", "info")