@@ -160,7 +160,6 @@ def open_link(url: QUrl):
160160
161161 if not settings .contains ('reporting/machine-id' ):
162162 settings .setValue ('reporting/machine-id' , str (uuid .uuid4 ()))
163- pass
164163 else :
165164 QDesktopServices .openUrl (url )
166165
@@ -332,8 +331,7 @@ def send_statistics(url):
332331
333332 is_anaconda = 'Continuum' in sys .version or 'conda' in sys .version
334333
335- usage = UsageStatistics ()
336- data = usage .load ()
334+ data = UsageStatistics .load ()
337335 for d in data :
338336 d ["Orange Version" ] = d .pop ("Application Version" , "" )
339337 d ["Anaconda" ] = is_anaconda
@@ -342,11 +340,11 @@ def send_statistics(url):
342340 r = requests .post (url , files = {'file' : json .dumps (data )})
343341 if r .status_code != 200 :
344342 log .warning ("Error communicating with server while attempting to send "
345- "usage statistics." )
343+ "usage statistics. Status code " + str ( r . status_code ) )
346344 return
347345 # success - wipe statistics file
348346 log .info ("Usage statistics sent." )
349- with open (usage .filename (), 'w' , encoding = "utf-8" ) as f :
347+ with open (UsageStatistics .filename (), 'w' , encoding = "utf-8" ) as f :
350348 json .dump ([], f )
351349 except (ConnectionError , requests .exceptions .RequestException ):
352350 log .warning ("Connection error while attempting to send usage statistics." )
0 commit comments