switch to use hashlib

This commit is contained in:
sfaulds 2016-11-03 16:46:22 +11:00
parent e34734931d
commit aa99b1a3c3
2 changed files with 5 additions and 5 deletions

View file

@ -4,7 +4,7 @@ import traceback
import requests import requests
import logging import logging
import clientinfo import clientinfo
import md5 import hashlib
import xbmc import xbmc
import platform import platform
import xbmcgui import xbmcgui
@ -59,8 +59,8 @@ class GoogleAnalytics():
self.user_name = settings('username') or settings('connectUsername') or 'None' self.user_name = settings('username') or settings('connectUsername') or 'None'
# use md5 for client and user for analytics # use md5 for client and user for analytics
self.device_id = md5.new(self.device_id).hexdigest() self.device_id = hashlib.md5(self.device_id).hexdigest()
self.user_name = md5.new(self.user_name).hexdigest() self.user_name = hashlib.md5(self.user_name).hexdigest()
# resolution # resolution
self.screen_mode = xbmc.getInfoLabel("System.ScreenMode") self.screen_mode = xbmc.getInfoLabel("System.ScreenMode")

View file

@ -20,7 +20,7 @@ import videonodes
import websocket_client as wsc import websocket_client as wsc
from utils import window, settings, dialog, language as lang from utils import window, settings, dialog, language as lang
from ga_client import GoogleAnalytics from ga_client import GoogleAnalytics
import md5 import hashlib
################################################################################################# #################################################################################################
@ -160,7 +160,7 @@ class Service(object):
serverId = settings('serverId') serverId = settings('serverId')
if(serverId != None): if(serverId != None):
serverId = md5.new(serverId).hexdigest() serverId = hashlib.md5(serverId).hexdigest()
ga = GoogleAnalytics() ga = GoogleAnalytics()
ga.sendEventData("Application", "Startup", serverId) ga.sendEventData("Application", "Startup", serverId)