#NEWLINE# def do_full_push( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# bundle = { #NEWLINE# #INDENT# 'labels' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# for ( key , value ) in self . wallet . labels . iteritems ( ) : #NEWLINE# #INDENT# encoded = self . encode ( key ) #NEWLINE# bundle [ 'labels' ] [ encoded ] = self . encode ( value ) #NEWLINE# #UNINDENT# params = json . dumps ( bundle ) #NEWLINE# connection = httplib . HTTPConnection ( self . target_host ) #NEWLINE# connection . request ( 'POST' , ( '/api/wallets/%s/labels/batch.json?auth_token=%s' % ( self . wallet_id , self . auth_token ( ) ) ) , params , { #NEWLINE# #INDENT# 'Content-Type' : 'application/json' , #NEWLINE# #UNINDENT# } ) #NEWLINE# response = connection . getresponse ( ) #NEWLINE# if ( response . reason == httplib . responses [ httplib . NOT_FOUND ] ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# response = json . loads ( response . read ( ) ) #NEWLINE# #UNINDENT# except ValueError as e : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# if ( 'error' in response ) : #NEWLINE# #INDENT# QMessageBox . warning ( None , _ ( 'Error' ) , _ ( ( 'Could not sync labels: %s' % response [ 'error' ] ) ) ) #NEWLINE# return False #NEWLINE# #UNINDENT# return True #NEWLINE# #UNINDENT# except socket . gaierror as e : #NEWLINE# #INDENT# print_error ( ( 'Error connecting to service: %s ' % e ) ) #NEWLINE# return False