×

Discussion Board

Results 1 to 3 of 3

Thread: Contacts DB

  1. #1
    Registered User
    Join Date
    Jul 2005
    Location
    Trento - ITALY
    Posts
    26

    Unhappy Contacts DB

    Hi, I have looked around for any type of example of script that claims to read the contacts database, but i cant figure how to use that examples. All i want is a simple, CLEAR, script that show how to open contact database and load all contacts present into a listbox, nothing else. This will be easy for the experts! please help me! Thanks in advance! I think many people really need this!

  2. #2
    Registered User
    Join Date
    May 2005
    Posts
    34
    'Bruto' example:
    Code:
    import Contacts
    import appuifw
    
    
       
    
    if __name__=='__main__':
    
        db=Contacts.open()
        appuifw.app.body=None
    
        
        while 1:
    
            data = appuifw.query(u'Look for: (cancel for all)','text')
            if not data: data=""
            li=[]
            l=db.find(data)
            if l:
                    for item in l:
                        li.append(item.title)
                    IDC = appuifw.selection_list(li)
                    if IDC==None: break
            if not li:        # empty list
                    appuifw.note(u"No contact found with: " + data,"error")
    
    
        db=None
    Pietro

  3. #3
    Regular Contributor
    Join Date
    Jan 2005
    Location
    Bangkok, Thailand
    Posts
    148
    I wrote an example of using contacts module here
    http://www.bigbold.com/snippets/posts/show/379

    See more snippets with tag 'series60'
    http://www.bigbold.com/snippets/tags/series60

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×