コード例 #1
0
ファイル: contacts.py プロジェクト: vesellov/datahaven
def setCustomerIDs(idslist):
    """
    Set customers ID's list, called when ListContacts packet received from Central server.
    """
    global _CustomersChangedCallback
    global _ContactsChangedCallback
    oldcustomers = contactsdb.customers()
    oldcontacts = contactsdb.contacts()
    contactsdb.set_customers(idslist)
    if _CustomersChangedCallback is not None:
        _CustomersChangedCallback(oldcustomers, contactsdb.customers())
    if _ContactsChangedCallback is not None:
        _ContactsChangedCallback(oldcontacts, contactsdb.contacts())
コード例 #2
0
ファイル: contacts.py プロジェクト: vesellov/datahaven
def addCustomer(idurl):
    """
    Add a new customer, call event handlers.
    """
    global _CustomersChangedCallback
    global _ContactsChangedCallback
    oldcustomers = contactsdb.customers()
    oldcontacts = contactsdb.contacts()
    res = contactsdb.add_customer(idurl)
    if _CustomersChangedCallback is not None:
        _CustomersChangedCallback(oldcustomers, contactsdb.customers())
    if _ContactsChangedCallback is not None:
        _ContactsChangedCallback(oldcontacts, contactsdb.contacts())
    return res
コード例 #3
0
ファイル: contacts.py プロジェクト: vesellov/datahaven
def getCustomerNames():
    """
    Return a list of customers names: ['veselin', 'bob', 'alice', ...]
    """
    return map(nameurl.GetName, contactsdb.customers())
コード例 #4
0
ファイル: contacts.py プロジェクト: vesellov/datahaven
def getCustomerIDs():
    """
    Return list of customers ID's.
    """
    return contactsdb.customers()