| Reply | « Previous Thread | Next Thread » |
|
Hello ,
Here's an example from Nokia for set/unset read sms status ! this example only works with PyS60 1.4.4 ![]() Code:
# Copyright (c) 2008 Nokia Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# NOTE: Sets/Get the status(1=unread, 0=read) of SMS.
import inbox, appuifw, e32
inb = inbox.Inbox()
sms_ids = inb.sms_messages()
msgs = []
msg_unread = []
msg_read = []
for id in sms_ids:
msgs.append(inb.content(id))
def setreadunread(message, status):
global msgs
i = 0
for msg in msgs:
if message == msg:
if status == 1:
inb.set_unread(sms_ids[i],1)
else:
inb.set_unread(sms_ids[i],0)
i = i+1
def get_readandunreadmessages_inlist():
global msg_unread
global msg_read
msg_unread = []
msg_read = []
for id in sms_ids:
if inb.unread(id):
msg_unread.append(inb.content(id))
else:
msg_read.append(inb.content(id))
def setmessageunread():
global msg_read
get_readandunreadmessages_inlist()
index = appuifw.selection_list(msg_read, 1)
if index != None and index >= 0:
print index
setreadunread(msg_read[index], 1)
print "Done"
def setmessageread():
global msg_unread
get_readandunreadmessages_inlist()
index = appuifw.selection_list(msg_unread, 1)
if index != None and index >= 0:
print index
setreadunread(msg_unread[index], 0)
print "Done"
def showmessagestatus():
global sms_ids
for id in sms_ids:
print inb.content(id)[:20]
print inb.unread(id)
def quit():
app_lock.signal()
appuifw.app.exit_key_handler = quit
appuifw.app.menu = [(u"Mark_read", setmessageread),
(u"Mark_unread", setmessageunread),
(u"Show_read/unread_status", showmessagestatus)]
app_lock = e32.Ao_lock()
app_lock.wait()
Cyke64 pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/ |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
hi cyke
thankx for explaining how to use the new things in the latest version of our PyS60. ![]() For future use and reference i have written a wiki article on all these new advantages. have look at this. Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
Excellent example mate so thanx
![]() |
|
Quote:
Hello, I've used the above at Interactive Command Prompt at my S60 device and everything works fine. After i compile the source to sis (with ensymble.py py2sis) i get an error at the compiled app: "KErrPermissionDenied" Anyone have a clue? Thanks ahead, Liran. |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
Offline
Forum Nokia Champion
|
|
Hi Liran and welcome to the Python discussion board.
You most likely need to sign the sis file with some extra capabilities. So go to www.symbiansigned.com, Open Signed Online, enter your information there, tick all the capabilities available (and specify them when creating the sis file with ensymble) and submit the application for signing. It should work after that. |
|
Hello Bogdan,
10x for the warm wellcome ![]() I've already signed my app. |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
hi NakeD
can you explain the procedure you used to make the sis so that it will be easy to spot the error. Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
I'm using Ensymble.PY witch can be found on the web:
Ensymble developer utilities for Symbian OS usage: ensymble.py py2sis [--uid=0x01234567] [--appname=AppName] [--version=1.0.0] [--lang=EN,...] [--icon=icon.svg] [--shortcaption="App. Name",...] [--caption="Application Name",...] [--drive=C] [--textfile=mytext_%C.txt] [--cert=mycert.cer] [--privkey=mykey.key] [--passphrase=12345] [--caps=Cap1+Cap2+...] [--vendor="Vendor Name",...] [--autostart] [--runinstall] [--encoding=terminal,filesystem] [--verbose] <src> [sisfile] Create a SIS package for a "Python for S60" application. |
|
but again, as i mentioned, this occurs only when i'm using the compiled version of my program (the sis file) as the file seem to have no permissions to access the phone's msgs for editing.
at the interactive run of python i can get to msgs editing. anyone have a clue? |
|
Quote:
Also you missed out to add --caps when making the SIS file. Best Regards, Croozeus |
|
Hi Pankaj,
10XXX. You were right. I recompile the app using: --caps=WriteUserData+WriteDeviceData+ReadDeviceData+ReadUserData+NetworkServices and it works like a charm. Gr8 work mate. |
|
Glad to know that
![]() Br, Croozeus |
|
nice application, can anyone show me how to view address and content on selection list view. i have trial and error but still don't work.
BS |
|
Quote:
how to make a sis for the 2nd edition?the explain on the wiki is so complex,but what's is pysisng?can you help me ? |
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
|
Quote:
The name itself already tells you what it is: py2sis. It is the process to transform your .py file(script) into a .sis, so you will have a icon on the menu with your application. Check the PyS60 FAQ. There is a answer about making a .sis for 2nd edition ![]() Hope it helps, Rafael. |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Problem with Push registry for SMS interceptor | iworktech_kiran | Mobile Java General | 4 | 2007-11-02 23:13 |
| AT command for SMS status | saeedspd | General Messaging | 2 | 2004-08-16 23:07 |
| D211Ctl perform illegal operation when trying to send sms by Req_Sms_Send | bcchong | General Messaging | 1 | 2002-07-22 12:08 |
| D211Ctl perform illegal operation when trying to send sms by Req_Sms_Send | bcchong | Symbian Tools & SDKs | 0 | 2002-06-03 04:13 |
| The D211Ctl Illegal operation when trying to send sms using Req_Sms_Send! | bcchong | Multimodecards | 0 | 2002-06-03 04:11 |