Reply
Thread Tools
Posts: 6 | Thanked: 0 times | Joined on Sep 2011
#1
First, Sorry, I'm not good at English.

I want devel a application, it's can auto delete AD SMS,code use python.

this is code:

Code:
    conn = sqlite3.connect("/home/user/.rtcom-eventlogger/el-v1.db")
    cur = conn.cursor()
    cur.execute('delete from Events where service_id=3 and event_type_id=11 and remote_uid=\''+sendernumber+'\'')
    conn.commit()
    cur.close()
    conn.close()
it's not work. delete data from database,but this item also show in SMS UI. I think the are not synchronous?

I search some code form google.com.

like this:
Code:
def del_sms(id):
    OSSO_CTX      =   osso.Context("some_context_here", "0.1")
    OSSO_EL       =   ctypes.CDLL('librtcom-eventlogger.so.1')
    OSSO_OBJ      =   OSSO_EL.rtcom_el_new()
    OSSO_EL.rtcom_el_delete_event(OSSO_OBJ,int(id),None)
it's not work too.

I don't why? every body can help me?
 
Posts: 6 | Thanked: 0 times | Joined on Sep 2011
#2
I don't why?
Change:
I don't know why?


this forum can't edit thread?
 
Posts: 6 | Thanked: 0 times | Joined on Sep 2011
#3
oh. ****. no reply.....
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#4
Both ways should work, but
the direct sqlite3 commands only changes the database and
the conversation app (appname rtcom-messaging-ui) didn't
get notified about the database change.

A cleaner way is to use the conversation backend rtcom-eventlogger.
Every change through this interface notifies any listeners (like
the rtcom-messaging-ui).

The below code deletes an event with event_id 3332. As it
uses rtcom-eventlogger api, the conversation
app should be notified and don't list the message with this
id anymore.

Code:
import glib
import gobject
import ctypes
import osso
osso_context = osso.Context("test_rtcom", "0.1")
rtcom_el_lib = ctypes.CDLL("librtcom-eventlogger.so.1")
rtcom_el_obj = rtcom_el_lib.rtcom_el_new()
rtcom_el_lib.rtcom_el_delete_event(rtcom_el_obj, int(3332), None)
 
Reply

Tags
delete, python, rtcom, sqlite3

Thread Tools

 
Forum Jump


All times are GMT. The time now is 09:52.