Active Topics

 


Reply
Thread Tools
omeriko9's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#1
Hi,

A few questions I couldn't find much info about in the wiki nor google:

1.How can I access the eventlogger from Python?

I've found this API reference:
http://maemo.org/api_refs/5.0/5.0-final/eventlogger/

and this Python code example to access Maemo API's without binding:
http://wiki.maemo.org/PyMaemo/Access...ython_bindings

But I can't seem to bind these two into a working code.

A code example would be wonderful.

2. I don't know how to view a DB schema in sqlite3 - I can use ".databases" to view all DB (can see "0 main" and "1 temp") but no knowledge on how to view it's schema (".schema" command is supposed to be followed by a table name, and since I don't know the tables names...)?

3. Are the event logger data kept in the some sqlite3 file?
 
Posts: 29 | Thanked: 23 times | Joined on Jan 2009 @ Macedonia
#2
1. No python binding yet, just use sqlite3
2. .tables
3. /home/user/.rtcom-eventlogger/el.db

Here is some sample python code:

Code:
import sqlite3
EL_PATH = "/home/user/.rtcom-eventlogger/el.db"
conn = sqlite3.connect(EL_PATH)
cur = conn.cursor()
cur.execute("select event_type_id, start_time, E.remote_uid, remote_name from Events E, Remotes R " +
			"where R.remote_uid=E.remote_uid and E.local_uid=R.local_uid and service_id = 1 " +
			"order by start_time desc")

for datarow in cur:
	//do something with datarow[0], datarow[1] etc..
 

The Following User Says Thank You to kovach For This Useful Post:
omeriko9's Avatar
Posts: 385 | Thanked: 344 times | Joined on Jan 2010 @ Israel
#3
Thank you very much!
 
Reply


 
Forum Jump


All times are GMT. The time now is 11:57.