Active Topics

 


Reply
Thread Tools
Posts: 402 | Thanked: 229 times | Joined on Nov 2009 @ Missouri, USA
#151
So continuing with my idea of modularizing the code, I have extracted the SMS classs and PyGObject class into their own modules inside a package called vertsms, and renamed vertsms.py to main.py. This has the following benefits:
  • Since main.py is shorter, it is easier to read*
  • It has allowed me to import my config system that I have written for ultimate-smash-friends
  • Having the forementioned config system means less things have to be hard-coded, and users have more options
  • I've also been able to adapt a plugin system from another project !

The last point is especially interesting albiet unfinished (I'm hoping to be done within the hour). What it means is that people that want to extend vertsms with features but either a) don't want to have to download the source from git, b) are still waiting to have their patches accepted or c) have wishes that only suit them can do so via a plugin.

I'm currently writing a plugin mount called KeyLayout. What does this mean? QWERTY layouts, or simple button arrangements are now possible. If I ever get this bad boy implemented fully, I'll post screenshots with accompanying plugin code (btw, which would just sit in a plugin directory of your choosing).

@ossipena: I can't help but think I'm over-stepping my bounds here. Should I just back off, or would these be welcome changes?

* my subjective opinion -- I do that a lot, huh?
__________________
aspidites | blog | aspidites@inbox.com
 

The Following 4 Users Say Thank You to aspidites For This Useful Post:
MohammadAG's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#152
I'll have my opinion on that post, but don't let it affect the decision.
"Modularizing" is indeed a good thing to do, it may also help users who're looking to improve the code/learn from it as an example to know where the should be looking. It also, as you said, shortens the main file.
I'd rename vertsms.py to vertsms_gui.py though (I think fMMS follows that way - and I like it best)
Importing modules when they're needed also reduces the resources needed to start the app.
It wouldn't affect packaging, some minor changes to the .desktop file, py_compilefiles currently runs on all *.py file so again it shouldn't matter.

Again, just my opinion
 
Posts: 402 | Thanked: 229 times | Joined on Nov 2009 @ Missouri, USA
#153
Originally Posted by MohammadAG View Post
I'd rename vertsms.py to vertsms_gui.py though (I think fMMS follows that way - and I like it best)
Again, just my opinion
Perhaps vertsms_gtk.py ? Nah, a lot of stuff is coupled tightly with gtk so vertsms_gui.py it is :-)
__________________
aspidites | blog | aspidites@inbox.com
 

The Following User Says Thank You to aspidites For This Useful Post:
ossipena's Avatar
Posts: 3,159 | Thanked: 2,023 times | Joined on Feb 2008 @ Finland
#154
I am so close but no cigar.

how in the hell can I add
RTCOM_EL_EVENT_SET_FIELD
to RTComEl -object with python?!?
example in C
Code:
 RTComElEvent *ev = rtcom_el_event_new ();
RTCOM_EL_EVENT_SET_FIELD (ev, service, “RTCOM_EL_SERVICE_SMS”);
RTCOM_EL_EVENT_SET_FIELD (ev, event_type, “RTCOM_EL_EVENTTYPE_SMS_INBOUND”);
RTCOM_EL_EVENT_SET_FIELD (ev, is_read, TRUE);
RTCOM_EL_EVENT_SET_FIELD (ev, local_uid, “ring/tel/ring”);
RTCOM_EL_EVENT_SET_FIELD (ev, remote_uid, “+123456”);
RTCOM_EL_EVENT_SET_FIELD (ev, start_time, time(NULL));
RTCOM_EL_EVENT_SET_FIELD (ev, remote_ebook_uid, 1);
RTCOM_EL_EVENT_SET_FIELD (ev, free_text, “Hello World”);

rtcom_el_add_event (el, ev, NULL);
rtcom_el_event_free (ev);
my python code
Code:
dbstring = rtcomm_eventlogger.rtcom_el_new()

dbstring.RTCOM_EL_EVENT_SET_FIELD (ev, service, “RTCOM_EL_SERVICE_SMS”)
rtcomm_eventlogger.RTCOM_EL_EVENT_SET_FIELD (ev, event_type, “RTCOM_EL_EVENTTYPE_SMS_INBOUND”)
rtcomm_eventlogger.RTCOM_EL_EVENT_SET_FIELD (ev, is_read, TRUE)
rtcomm_eventlogger.RTCOM_EL_EVENT_SET_FIELD(ev, local_uid, “ring/tel/ring”)
rtcomm_eventlogger.RTCOM_EL_EVENT_SET_FIELD(ev, remote_uid, number)
rtcomm_eventlogger.RTCOM_EL_EVENT_SET_FIELD (ev, start_time, time(NULL));
rtcomm_eventlogger.RTCOM_EL_EVENT_SET_FIELD (ev, remote_ebook_uid, 1);
rtcomm_eventlogger.RTCOM_EL_EVENT_SET_FIELD (ev, free_text, “Hello World”);

rtcomm_eventlogger.rtcom_el_add_event (el, dbstring, NULL);
rtcomm_eventlogger.rtcom_el_event_free (dbstring);
yes there is typo with rtcomm and no matter if I use rtcomm_eventlogger.RTCOM.... or
dbstring.RTCOM....

what am I doing wrong?!?

e: got a step further. error is now
AttributeError: /usr/lib/librtcom-eventlogger.so.0.0.0: undefined symbol: RTCOM_EL_EVENT_SET_FIELD

do I need something besides the eventlogger via ctypes?
__________________
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-08 at 22:33.
 
ossipena's Avatar
Posts: 3,159 | Thanked: 2,023 times | Joined on Feb 2008 @ Finland
#155
Originally Posted by aspidites View Post
So continuing with my idea of modularizing the code, I have extracted the SMS classs and PyGObject class into their own modules inside a package called vertsms, and renamed vertsms.py to main.py. This has the following benefits:
  • Since main.py is shorter, it is easier to read*
  • It has allowed me to import my config system that I have written for ultimate-smash-friends
  • Having the forementioned config system means less things have to be hard-coded, and users have more options
  • I've also been able to adapt a plugin system from another project !

The last point is especially interesting albiet unfinished (I'm hoping to be done within the hour). What it means is that people that want to extend vertsms with features but either a) don't want to have to download the source from git, b) are still waiting to have their patches accepted or c) have wishes that only suit them can do so via a plugin.

I'm currently writing a plugin mount called KeyLayout. What does this mean? QWERTY layouts, or simple button arrangements are now possible. If I ever get this bad boy implemented fully, I'll post screenshots with accompanying plugin code (btw, which would just sit in a plugin directory of your choosing).

@ossipena: I can't help but think I'm over-stepping my bounds here. Should I just back off, or would these be welcome changes?

* my subjective opinion -- I do that a lot, huh?
just keep going!

the code was good for one file in released version 0.1
now it is so big jungle that I concidered splitting it myself.

I am trying to find time merging your contributions to master repo in near future.
__________________
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
#156
Originally Posted by ossipena View Post
just keep going!

the code was good for one file in released version 0.1
now it is so big jungle that I concidered splitting it myself.

I am trying to find time merging your contributions to master repo in near future.
Hold off until I submit a request. I still need to backport your changes (conversation database, etc). Glad to hear I got your stamp of approval though :-)
__________________
aspidites | blog | aspidites@inbox.com
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#157
Originally Posted by ossipena View Post
how in the hell can I add
RTCOM_EL_EVENT_SET_FIELD
to RTComEl -object with python?!?
RTCOM_EL_EVENT_SET_FIELD isn't a function so it won't appear in any library - it's a macro that is processed and replaced in C apps by the preprocessor before it gets compiled.

event.h defines it thus:
Code:
#define RTCOM_EL_EVENT_SET_FIELD(ev, FIELD, value) \
    do {\
        (ev)->_mask |= _is_set_ ## FIELD; \
        (ev)->fld_ ## FIELD = value;\ 
    } while(0)
So, looking at the line "rtcomm_eventlogger.RTCOM_EL_EVENT_SET_FIELD (ev, is_read, TRUE)", you'd want to do, instead, something like:
ev._mask |= _is_set_is_read
ev.fld_is_read = True

Something like that anyway, I'm pretty **** at all this

P.S. Rtcomm-eventlogger source may help

Gah, after waking up: it's a struct, so you may need to define it in ctypes...

Last edited by qwerty12; 2010-05-10 at 09:18.
 

The Following 2 Users Say Thank You to qwerty12 For This Useful Post:
Hariainm's Avatar
Posts: 485 | Thanked: 708 times | Joined on Feb 2010 @ Galiza
#158
why i can't type nothing in the address bar? adding a contact number with the "To" button works fine, but when i want to type the number in it, the app automatically writes in the main box? :-(
 
ossipena's Avatar
Posts: 3,159 | Thanked: 2,023 times | Joined on Feb 2008 @ Finland
#159
Originally Posted by Hariainm View Post
why i can't type nothing in the address bar? adding a contact number with the "To" button works fine, but when i want to type the number in it, the app automatically writes in the main box? :-(
because the whole portrait text input has been written from zero because there isn't any in N900/M5 by default. So in order to get the first version out asap, there is helluva compromises to be made.

will be fixed as soon as I merge major changes to my code etc..
__________________
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
 

The Following User Says Thank You to ossipena For This Useful Post:
Posts: 15 | Thanked: 10 times | Joined on Apr 2010 @ Saint-Petersburg, Russia
#160
It maybe intresting somebody, for example russian user, here russian edition version for VertSms. Changes:
1. Russian number (ex. +7(code)1234567 and 8(code)1234567) work correctly.
2. Russian interface and ability to send messages to Russian


This post in this topic, because i develope this edition. If i mistake, i'am very sorry.

And i'am sorry for my bad english

Last edited by InoHacker; 2010-05-10 at 20:06.
 

The Following 4 Users Say Thank You to InoHacker For This Useful Post:
Reply

Tags
portrait sms, python


 
Forum Jump


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