Re: Getting a phone number from an OssoABookContact
Thanks Andrew, this seems to be roughly what I'm looking for. In particular, it seems an OssoABookContact is asubclass of an EContact, so I can just use this stuff directly. However, I've looked at the associated code in hermes: https://garage.maemo.org/plugins/ggit/browse.php/?p=hermes;a=blob;f=package/src/org/maemo/hermes/engine/contact.py;h=a309b290ee506ca6de7f46108adb1541ea4fbb58;hb=HEAD and I can't find where you get the "GList" and "EVCardAttribute" types. I've got my own implementation of a glist (stolen from somewhere online) but I'd prefer to not have to write the EVCardAttribute myself (wrapping the evolution code). My best guess is that it's coming through some long line of imports (maybe evolution?) or the pygobject library, but neither of these seem to have this type for the libraries I have access to. Any suggestions? Thanks! On Tue, Aug 24, 2010 at 11:40 PM, Andrew Flegg wrote: > Here's some code from Hermes'[1] org/maemo/hermes/engine/contact.py: > > 8<- > # Constants from > http://library.gnome.org/devel/libebook/stable/EContact.html#EContactField > ebook = CDLL('libebook-1.2.so.5') > E_CONTACT_PHONE_OTHER = 30 > > def get_phones(self): > """Return a list of phone numbers associated with this contact.""" > > nums = [] > ai = GList.new(ebook.e_contact_get_attributes(hash(self._contact), > E_CONTACT_PHONE_OTHER)) > while ai.has_next(): > attr = ai.next(as_a = EVCardAttribute) > types = set() > if attr.params: > params = > GList.new(ebook.e_vcard_attribute_param_get_values(attr.params.contents.next())) > while params.has_next(): > types.add(string_at(params.next())) > > device = 'VOICE' in types and 'landline' \ > or 'CELL' in types and 'mobile' \ > or None > type = 'HOME' in types and 'home' \ > or 'WORK' in types and 'work' \ > or None > number = string_at(attr.value().next()) > nums.append(PhoneNumber(number, type = type, device = device)) > > return nums > --->8 > > If you don't speak Python, what is basically does is (dealing with an > EContact, but you can get that from an OssoABookContact IIRC: > > 1) Get all attributes of type 30 - this returns all > phone numbers, I've found. > 2) Loop over each attribute, the value of which is > the phone number. > 3) The parameters of the attribute will tell you the different > types flagged against this number. > > HTH, > > Andrew > > [1] http://hermes.garage.maemo.org/ > > -- > Andrew Flegg -- mailto:and...@bleb.org | http://www.bleb.org/ > Maemo Community Council chair > - Original message - >> Hello maemo-developers! >> >> Does anyone know how to get a phone number (any number) out of an >> OssoABookContact instance? I'm at my wit's end; all of the online hits >> i've found have been doing the opposite and I can't figure this out. >> My guess was using the osso_abook_contact_get_value function, but I >> have no idea what the appropriate attribute would be. I've tried a >> great many (Cell, for instance) and gotten nothing. >> >> Ideas? >> >> Thanks! >> ___ >> maemo-developers mailing list >> maemo-developers@maemo.org >> https://lists.maemo.org/mailman/listinfo/maemo-developers > > ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Getting a phone number from an OssoABookContact
Hello maemo-developers! Does anyone know how to get a phone number (any number) out of an OssoABookContact instance? I'm at my wit's end; all of the online hits i've found have been doing the opposite and I can't figure this out. My guess was using the osso_abook_contact_get_value function, but I have no idea what the appropriate attribute would be. I've tried a great many (Cell, for instance) and gotten nothing. Ideas? Thanks! ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Default SIP calls
Hello Maemo Developers. I'm trying to get my N900 to make SIP calls the default for the generic call ui. I just have to make it easy for the user to send all calls though the sip line (which is connected to a locally running asterisk interface). This allows me to log some properties about calls for a research project I'm conducting. What is the best way to accomplish this goal? I was hoping that there was a conf file for rtcom-call-ui giving the available options, but it seems "cell" is a default that's built into the code. I could build my own version of it lacking that functionality, but I can't find the source to that package. The alternative would be removing the phone option, and placing all calls through a service like fring, which does not support cellular calls (so far as I know). Are there any easier alternatives I should be aware of? Has anyone done this before? Thanks! ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Re: Request internet connection with python
I'm curious about this problem, as I'm trying to use the same library but I'd prefer not to have to manage the archaic and poorly documented icd-dbus interface. I'm pulling the source for this library now to try and make progress, but did you figure out anything aside from the (slightly wonky) workaround? Thanks! On Sat, Oct 11, 2008 at 9:31 AM, Hermann Lacheiner <[EMAIL PROTECTED]> wrote: > >> I've also seen this problem. It never worked, even on chinook. > > As a workaround I am listening now for the status_changed signal of the > com.nokia.icd dbus service. > Strangely I get an DBusException when registering: "/com/nokia/icd: > Unsupported interface or method" but nevertheless the signal handler is > called on status change. > > Cheers, hermann > ___ > maemo-developers mailing list > maemo-developers@maemo.org > https://lists.maemo.org/mailman/listinfo/maemo-developers > ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Keyboard/Theme Questions
Hello Maemo developers. I've been working on a few projects, and I was hoping you guys/gals can help. First, the precursor. I'm a researcher working on technology for developing regions. I hope to use a few N800 and N810's this summer in Uganda. I've ported my technology to maemo, though I am unwilling to integrate hildon, for portability reasons. It's currently developed in python. So, my problems. First, is the font size. The default font size for the phone is too small, which will likely intimidate new users. I was hoping to bump this up. A search turned up alternate desktop themes that had different font sizes. However, these made the fonts smaller. I've built my own theme in an attempt to get the opposite effect, but I haven't the faintest of where in the theme file the font is. It should be easy to find, I'd assume. Am I barking up the wrong tree for this problem? Secondly, the keyboard. My application is a lot like a soft-phone, and it needs a numeric dial pad, as well as a more generic keyboard for entering email address. I began to implement this as the SIP client on the phone did, as a standalone pop-up. After an investigation, it seemed as though I should be able to implement a virtual keyboard for this purpose. So I compiled one of those (.vkb file) and stored it in /usr/share/keyboards as per the walkthroughs I found. I can't seem to enable this new keyboard though. I have the virtual keyboards enabled, but I am unable to switch to using mine. How do I do this? Thanks! ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers
Web Browser Problem
Hello developers, I am running into the strangest bug. First, i've deployed lighttpd on the N810 as a proxy server. It's going to run a google-gears like system for an app i'm building. That's running just fine, the 404 handler is a script that pings the DB for whatever the user is looking for. My problem actually deals with the webserver serving static pages. So, lighty's working just fine. When you go to http://localhost/foo it runs my script and works. http://localhost/foo.html (a file in the static hierarchy) the websbrowser attempts to download it. It's strange, you get a full "download type="text/html" yada yada" pop up. The likewise setup (same lighty conf) runs just fine on my computer. It's just the phone. I debugged the html file by downloading index.html from google and trying to serve that. The N810 webbrowser attempts to download that as well. The problem must be on the phone. Does anyone know what this could possibly be? Thanks. ___ maemo-developers mailing list maemo-developers@maemo.org https://lists.maemo.org/mailman/listinfo/maemo-developers