<s> """<STR_LIT>""" <EOL> from __future__ import with_statement <EOL> __author__ = '<STR_LIT>' <EOL> import atom <EOL> import logging <EOL> import gdata . contacts . client <EOL> import googlecl . client <EOL> import googlecl . base <EOL> import googlecl . contacts . base <EOL> from googlecl . contacts import SECTION_HEADER <EOL> LOG = logging . getLogger ( googlecl . contacts . LOGGER_NAME + '<STR_LIT>' ) <EOL> class ContactsClientCL ( gdata . contacts . client . ContactsClient , <EOL> googlecl . contacts . base . ContactsBaseCL , <EOL> googlecl . client . BaseClientCL ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , config ) : <EOL> """<STR_LIT>""" <EOL> gdata . contacts . client . ContactsClient . __init__ ( self ) <EOL> googlecl . client . BaseClientCL . __init__ ( self , SECTION_HEADER , config ) <EOL> def _add_email ( self , email , contact_entry ) : <EOL> contact_entry . email . append ( <EOL> gdata . data . Email ( address = email , label = '<STR_LIT>' ) ) <EOL> def _add_name ( self , name , contact_entry ) : <EOL> contact_entry . name = gdata . data . Name ( ) <EOL> contact_entry . name . full_name = gdata . data . FullName ( text = name ) <EOL> def _get_contact_entry ( self ) : <EOL> return gdata . contacts . data . ContactEntry ( ) <EOL> def get_contacts ( self , name ) : <EOL> """<STR_LIT>""" <EOL> uri = self . GetFeedUri ( ) <EOL> return self . GetEntries ( uri , name , <EOL> desired_class = gdata . contacts . data . ContactsFeed ) <EOL> GetContacts = get_contacts <EOL> def add_group ( self , name ) : <EOL> """<STR_LIT>""" <EOL> new_group = gdata . contacts . data . GroupEntry ( ) <EOL> new_group . title = atom . data . Title ( text = name ) <EOL> return self . CreateGroup ( new_group ) <EOL> AddGroup = add_group <EOL> def get_groups ( self , name ) : <EOL> """<STR_LIT>""" <EOL> uri = self . GetFeedUri ( kind = '<STR_LIT>' ) <EOL> return self . GetEntries ( uri , name , <EOL> desired_class = gdata . contacts . data . GroupsFeed ) <EOL> GetGroups = get_groups <EOL> def is_token_valid ( self , test_uri = None ) : <EOL> """<STR_LIT>""" <EOL> if not test_uri : <EOL> test_uri = self . GetFeedUri ( ) <EOL> return googlecl . client . BaseClientCL . is_token_valid ( self , test_uri ) <EOL> IsTokenValid = is_token_valid <EOL> SERVICE_CLASS = ContactsClientCL </s>
