Reply
Thread Tools
ossipena's Avatar
Posts: 3,159 | Thanked: 2,023 times | Joined on Feb 2008 @ Finland
#131
I solved the problem already. but now a question:

how can I write None (not a string) to a table?!?

when I read the os created table, there is such value and I am unable to write such to the table.

and I am a bit unsure if outside writes are possible: at least my otherwise except the None similar string write to db gets erased

e: damn it appears you should not touch the db manually. found an api for it though but it seems pretty complicated.
__________________
Want to know something?
K.I.S.S. approach:
wiki category:beginners. Browse it through and you'll be much wiser!
If the link doesn't help, just use
Google Custom Search

Last edited by ossipena; 2010-05-06 at 19:06.
 
Posts: 402 | Thanked: 229 times | Joined on Nov 2009 @ Missouri, USA
#132
@ossipena, to answer your original question:
You should write "Null" to the database. I worked a lot with the sqlite3 module in my old project. (don't let the pyqt code scare you, most of the code deals specifically with plain ole python: database.py
__________________
aspidites | blog | aspidites@inbox.com
 

The Following User Says Thank You to aspidites For This Useful Post:
Posts: 402 | Thanked: 229 times | Joined on Nov 2009 @ Missouri, USA
#133
So I finally refactored everyting into multiple classes in my branch. It's either a drastic improvement or a drastic disaster.

While everything is now separated into 4 classes located in a single file, they could technically e separated into 4 files now :-).

original version
my version

Not official, and I may end up scrapping it, but I thought I'd see what everyone else thought.
__________________
aspidites | blog | aspidites@inbox.com
 

The Following User Says Thank You to aspidites For This Useful Post:
Haus3r's Avatar
Posts: 311 | Thanked: 180 times | Joined on Dec 2009 @ London
#134
This is great Just reading through this thread made me - once more - aware of how great this idea of open source is and that everybody can get evolved!

Keep it up guys, this looks VERY promising!

PS: ...And will solve my problem of single-handedly texting my mates while on the loo Great!
__________________
|| Check it out: http://soundcloud.com/sebastian-hauser ||
 
Posts: 82 | Thanked: 214 times | Joined on Jan 2010 @ Cape town
#135
Originally Posted by aspidites View Post
So I finally refactored everyting into multiple classes in my branch. It's either a drastic improvement or a drastic disaster.
Awesome, I was thinking about doing this... Getting much more "pythonic" now... After my test today, I think I'll play around with abstracting away the button pressing from the handling of input, etc. That should allow a nice clean way to have T9 and be able to switch between predictive / non-predictive.

On a side note, I hacked my T9 support in... It was rather slow, as expected, but it was just a proof of concept. I'm going to look at creating a database with all the words in, and seeing what the speed of that is like vs a flat file. Should be much faster.
 

The Following 2 Users Say Thank You to cb22 For This Useful Post:
Posts: 508 | Thanked: 130 times | Joined on Sep 2009
#136
Loose the virtual keyboard override when enabled its highly anoying when switching from number to text and back. also you need directional keys
 
ossipena's Avatar
Posts: 3,159 | Thanked: 2,023 times | Joined on Feb 2008 @ Finland
#137
does someone know better place to search for rtcom eventlogger than http://docs.huihoo.com/maemo/5.0/eventlogger/

http://maemo.org/api_refs/5.0/5.0-final/eventlogger/

I have everything I need to write but how to write?

e: how does one say this in python:
Code:
static RTComElEvent *
event_new_full (time_t t)
{
    RTComElEvent *ev;

    ev = rtcom_el_event_new();
    g_return_val_if_fail (ev != NULL, NULL);

    /* Setting everything here for testing purposes, but usually
     * you wouldn't need to. */
    /* FIXME: RTComElEvent structure:
     * 1) OMG, it's full of string IDs that want to be quarks or enums;
     * 2) it's painful to care about string member ownership.
     */
    RTCOM_EL_EVENT_SET_FIELD(ev, service, g_strdup (SERVICE));
    RTCOM_EL_EVENT_SET_FIELD(ev, event_type, g_strdup (EVENT_TYPE));
    RTCOM_EL_EVENT_SET_FIELD(ev, start_time, t);
    RTCOM_EL_EVENT_SET_FIELD(ev, end_time, t);
    RTCOM_EL_EVENT_SET_FIELD(ev, flags, FLAGS);
    RTCOM_EL_EVENT_SET_FIELD(ev, bytes_sent, BYTES_SENT);
    RTCOM_EL_EVENT_SET_FIELD(ev, bytes_received, BYTES_RECEIVED);
    RTCOM_EL_EVENT_SET_FIELD(ev, local_uid, g_strdup (LOCAL_UID));
    RTCOM_EL_EVENT_SET_FIELD(ev, local_name, g_strdup (LOCAL_NAME));
    RTCOM_EL_EVENT_SET_FIELD(ev, remote_uid, g_strdup (REMOTE_UID));
    RTCOM_EL_EVENT_SET_FIELD(ev, remote_name, g_strdup (REMOTE_NAME));
    RTCOM_EL_EVENT_SET_FIELD(ev, channel, g_strdup (CHANNEL));
    RTCOM_EL_EVENT_SET_FIELD(ev, free_text, g_strdup (FREE_TEXT));

    return ev;
}
__________________
Want to know something?
K.I.S.S. approach:
wiki category:beginners. Browse it through and you'll be much wiser!
If the link doesn't help, just use
Google Custom Search
 
Posts: 402 | Thanked: 229 times | Joined on Nov 2009 @ Missouri, USA
#138
@ossipena: There aren't any python bindings, so you would have to use ctypes like you did for osso.abook, which I think would be a waste of time. I think it would be faster to just use sqlite3

[strike]I might have a go at a snippet once I get back from working out and school[/code]

There is no way I'm touching that database. The schema looks overly complicated and while it's obvious what a lot of the fields are for, it is not so obvious when they should be written to. The rtcom API looks sloppy at best*

* just my opinion...perhaps a bias against gobject, gtk, etc.
__________________
aspidites | blog | aspidites@inbox.com

Last edited by aspidites; 2010-05-07 at 15:51.
 
ossipena's Avatar
Posts: 3,159 | Thanked: 2,023 times | Joined on Feb 2008 @ Finland
#139
only problem is that the rows written by sqlite gets deleted almost immediately. so I have to use the api via ctypes. I managed to pull all necessary info from el.db so I know exactly what to write and where. but lack knowledge how.

now I only need to know how to use the event_new_full from above with python after binding the rtcom-event.so with ctypes.

I'll try to implement improved backspace then and hope someone knows how to get rtcom-events stuff working.
__________________
Want to know something?
K.I.S.S. approach:
wiki category:beginners. Browse it through and you'll be much wiser!
If the link doesn't help, just use
Google Custom Search
 
Posts: 402 | Thanked: 229 times | Joined on Nov 2009 @ Missouri, USA
#140
and you are sure you were committing your transactions with sqlite3?
__________________
aspidites | blog | aspidites@inbox.com
 
Reply

Tags
portrait sms, python

Thread Tools

 
Forum Jump


All times are GMT. The time now is 12:13.