[PyQt] Sending Instant Message on N900 through PyQt (using PySide & QtMobility)

praveen koduru prawin1111 at gmail.com
Tue Oct 5 04:27:05 BST 2010


Hi,

I want to send IM(Instant Message) from GTalk of N900 using PyQt. I have
found sending sms  PyQt script here
http://wiki.maemo.org/Phone_control#Send_SMS. and tried to modify for
Instant Messaging. But I am getting "send failed" error. I am new to PyQt.

I have logged in to gtalk before running the script & then started the
script.
the following is the code I have modified.

app = QCoreApplication(sys.argv)

'*''get number and name'''*
stringit = sys.argv
numpertemp = str(stringit[1:2])
mesits = str(stringit[2:])[2:-2]

num = str(numpertemp[2:-2])

if (mesits == ""):
  print "Usage:"
  print "python ssms.py 01234567 'message text here'"
  sys.exit(69)
else:
  print "number is " + str(num)
  print "message is " + str(mesits)

'*''define message to be sent'''*
numperi = QtCore.QString(num)

numper = QMessageAddress(QMessageAddress.InstantMessage, "user at gmail.com")
mesitsi = QMessage()
mesitsi.setType(QMessage.InstantMessage)
mesitsi.setTo(numper)
mesitsi.setBody(mesits)

'*''send message'''*
sender = QMessageService()
if (sender.send(mesitsi)):
  print "success"
else:
  print "fail"

where as  modifying  "writemessage" example of QtMobility(C++) I am able to
send IM by making the above changes only. but not with PyQt. I need with
PyQt. any help would be greatly appreciated


-Praveen.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20101005/d28b1f8b/attachment.html>


More information about the PyQt mailing list