added method get_prim_contact_from_list

This commit is contained in:
Dimitur Kirov 2005-08-09 17:57:53 +00:00
parent ed1893ee9b
commit 62d54f3df1
1 changed files with 8 additions and 0 deletions

View File

@ -25,6 +25,14 @@ from common import i18n
_ = i18n._ _ = i18n._
def get_prim_contact_from_list(contacts):
prim_contact = None # primary contact
for contact in contacts:
if prim_contact == None or int(contact.priority) > \
int(prim_contact.priority):
prim_contact = contact
return prim_contact
def convert_bytes(string): def convert_bytes(string):
suffix = '' suffix = ''
# IEC standard says KiB = 1024 bytes KB = 1000 bytes # IEC standard says KiB = 1024 bytes KB = 1000 bytes