#NEWLINE# def get_counter( self , bucket , key , **options ) : #NEWLINE# #INDENT# if ( not bucket . bucket_type . is_default ( ) ) : #NEWLINE# #INDENT# raise NotImplementedError ( 'Counters are not supported with bucket-types, use datatypes instead.' ) #NEWLINE# #UNINDENT# if ( not self . counters ( ) ) : #NEWLINE# #INDENT# raise NotImplementedError ( ( 'Counters are not supported on %s' % self . server_version . vstring ) ) #NEWLINE# #UNINDENT# url = self . counters_path ( bucket . name , key , ** options ) #NEWLINE# ( status , headers , body ) = self . _request ( 'GET' , url ) #NEWLINE# self . check_http_code ( status , [ 200 , 404 ] ) #NEWLINE# if ( status == 200 ) : #NEWLINE# #INDENT# return str_to_long ( body . strip ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( status == 404 ) : #NEWLINE# #INDENT# return None