View Single Post
Posts: 9 | Thanked: 6 times | Joined on Dec 2009
#73
I added configurable regexp option to this excellent widget.
It matches received data against user-provided regexp and returns first capturing parentheses data.

For example, for MTS Russia you have to provide
Code:
(.+?[\d\,\.]+)
regexp to get only "Balance: 123,34" in a message window.

Regexp matching applied at the end of message processing chain.

I've attached both diff file (for developers) and complete modified /usr/lib/hildon-desktop/ussd-widget.py for those who want to try it.

Python regexp documentation can be found there.
Attached Files
File Type: gz ussd-widget.regexp.diff.gz (1.3 KB, 181 views)
File Type: gz ussd-widget.py.gz (3.1 KB, 183 views)
 

The Following User Says Thank You to irmin For This Useful Post: