|
From: Stas Z. <sta...@us...> - 2005-06-14 18:59:04
|
Update of /cvsroot/gmailagent/GA-libgmail2/frontend In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8918 Modified Files: Contrgcm.py Log Message: Added templates for the new contacts framework Index: Contrgcm.py =================================================================== RCS file: /cvsroot/gmailagent/GA-libgmail2/frontend/Contrgcm.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Contrgcm.py 14 Jun 2005 14:29:39 -0000 1.1 --- Contrgcm.py 14 Jun 2005 18:58:55 -0000 1.2 *************** *** 20,26 **** CG_DEBUG = 1 ! import libgmail2,logging,os def upload_local_contacts(addrfile,ga): """Returns the contacts from the local file which don't have a ID entry. --- 20,97 ---- CG_DEBUG = 1 ! import libgmail2,logging,os,shelve + def import_contacts_gmail(ga): + """import_contacts_gmail --> contacts in a list of tuples. + Import contacts from a gmail account and store them in a local + database. When the db exist it will be updated else it will be created. + @ga is a libgmail GmailAccount object. + """ + pass + def import_contacts_db(): + """import_contacts_db --> contacts in a list of tuples. + Import contacts from the local database and return them in a + list of tuples.""" + pass + def store_contacts_gmail(contacts,ga): + """store_contacts_gmail --> True on succes, False on faillure. + Stores the contacts in a Gmail account. + @contacts is a list of tuples containing the contacts. The format must be + the same as returnt by import_contacts_db. + @ga is a libgmail GmailAccount. + """ + pass + def store_contacts_db(contacts): + """store_contacts_db --> True on succes, False on faillure. + Stores the contacts in the local database. + @contacts is a list of tuples containing the contacts. The format must be + the same as returnt by import_contacts_db. + """ + pass + def store_contact_gmail(contact,ga): + """store_contact_db --> True on succes, False on faillure + Stores the contact in a Gmail account. + @contact is a tuple containing the contact. + """ + pass + def remove_contacts_gmail(ga): + """remove_contacts_gmail --> True on succes, False on faillure. + Remove all contacts from a Gmail account. + This should be used with care, the removal is final. + The contacts removed are stored in the local database and can be restored + by calling restore_contacts. + @ga is a libgmail GmailAccount. + """ + pass + def remove_contacts_db(): + """remove_contacts_db --> True on succes, False on faillure. + Remove all contacts from the local database. + The database can be restored by calling import_contacts_gmail. + """ + pass + def export_contacts(file): + """export_contacts --> True on succes, False on faillure. + Export contacts into the VCard format to a file. + @file must be a valid path writable by the user. + """ + pass + class DBase: + def __init__(self): + self.db_name = '.gcm_dbase' + self.DB_dict = shelve.open(self.db_name) + def _get_all_values(self): + pass + def _get_all_keys(self): + pass + def _store_value(self,key,*args): + pass + def _get_value(self,key): + pass + def _close(self): + pass + + + ###### Old stuff, perhaps we can use parts of it ########### def upload_local_contacts(addrfile,ga): """Returns the contacts from the local file which don't have a ID entry. |