Issues 391 - Refactoring VersionManager

pull/420/head
Augusto Monteiro 2016-12-08 23:07:36 -03:00 committed by Jonathan D'Orleans
parent 66e63e5616
commit 4b0a65597c
1 changed files with 5 additions and 8 deletions

View File

@ -25,18 +25,15 @@ __author__ = 'augustnmonteiro'
LOG = getLogger(__name__)
class VersionManager:
location = "/opt/mycroft/version.json"
def __init__(self):
pass
class VersionManager(object):
__location = "/opt/mycroft/version.json"
@staticmethod
def get():
if exists(VersionManager.location) and isfile(VersionManager.location):
if exists(VersionManager.__location) and isfile(VersionManager.__location):
try:
with open(VersionManager.location) as f:
with open(VersionManager.__location) as f:
return json.load(f)
except:
LOG.error("Failed to load version from '%s'" % VersionManager.location)
LOG.error("Failed to load version from '%s'" % VersionManager.__location)
return {"coreVersion": None, "enclosureVersion": None}