<s> """<STR_LIT>""" <EOL> from base import OpenFireBase <EOL> from exception import UserNotFoundException <EOL> class Presence ( OpenFireBase ) : <EOL> STATUS_AVAILABLE = '<STR_LIT>' <EOL> STATUS_CHAT = '<STR_LIT>' <EOL> STATUS_AWAY = '<STR_LIT>' <EOL> STATUS_XA = '<STR_LIT>' <EOL> STATUS_DND = '<STR_LIT>' <EOL> STATUS_OFFLINE = '<STR_LIT>' <EOL> STATUS_FORBIDDEN = '<STR_LIT>' <EOL> RESPONSE_TYPE_IMAGE = '<STR_LIT:image>' <EOL> RESPONSE_TYPE_TEXT = '<STR_LIT:text>' <EOL> RESPONSE_TYPE_XML = '<STR_LIT>' <EOL> def __init__ ( self , url , api_path = '<STR_LIT>' ) : <EOL> """<STR_LIT>""" <EOL> super ( Presence , self ) . __init__ ( url , api_path ) <EOL> def status ( self , username , response_type = RESPONSE_TYPE_TEXT ) : <EOL> """<STR_LIT>""" <EOL> return self . _submit_request ( { <EOL> '<STR_LIT>' : self . _get_full_username ( username ) , <EOL> '<STR_LIT:type>' : response_type <EOL> } ) <EOL> def _get_full_username ( self , username ) : <EOL> return u'<STR_LIT>' % ( username , self . hostname ) <EOL> def _parse_response ( self , data ) : <EOL> status = data . strip ( ) <EOL> if '<STR_LIT:null>' == status : <EOL> raise UserNotFoundException ( ) <EOL> return status </s>
