#NEWLINE# def run( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# con = httplib . HTTPConnection ( 'electrum.org' , 80 , timeout = 5 ) #NEWLINE# con . request ( 'GET' , '/version' ) #NEWLINE# res = con . getresponse ( ) #NEWLINE# #UNINDENT# except socket . error as msg : #NEWLINE# #INDENT# print_error ( 'Could not retrieve version information' ) #NEWLINE# return #NEWLINE# #UNINDENT# if ( res . status == 200 ) : #NEWLINE# #INDENT# latest_version = res . read ( ) #NEWLINE# latest_version = latest_version . replace ( '\n' , '' ) #NEWLINE# if re . match ( '^\\d+(\\.\\d+)*$' , latest_version ) : #NEWLINE# #INDENT# self . label . callback ( latest_version )