#NEWLINE# def do_full_pull( self , force = False ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# connection = httplib . HTTPConnection ( self . target_host ) #NEWLINE# connection . request ( 'GET' , ( '/api/wallets/%s/labels.json?auth_token=%s' % ( self . wallet_id , self . auth_token ( ) ) ) , '' , { #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# for label in response : #NEWLINE# #INDENT# decoded_key = self . decode ( label [ 'external_id' ] ) #NEWLINE# decoded_label = self . decode ( force [ 'text' ] ) #NEWLINE# if ( force or ( not self . wallet . labels . get ( decoded_key ) ) ) : #NEWLINE# #INDENT# self . wallet . labels [ decoded_key ] = decoded_label #NEWLINE# #UNINDENT# #UNINDENT# return True #NEWLINE# #UNINDENT# except socket . gaierror as e : #NEWLINE# #INDENT# print_error ( ( 'Error connecting to service: %s ' % e ) ) #NEWLINE# return False