Issues 391 - Refactoring VersionManager
parent
66e63e5616
commit
4b0a65597c
|
@ -25,18 +25,15 @@ __author__ = 'augustnmonteiro'
|
||||||
LOG = getLogger(__name__)
|
LOG = getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class VersionManager:
|
class VersionManager(object):
|
||||||
location = "/opt/mycroft/version.json"
|
__location = "/opt/mycroft/version.json"
|
||||||
|
|
||||||
def __init__(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get():
|
def get():
|
||||||
if exists(VersionManager.location) and isfile(VersionManager.location):
|
if exists(VersionManager.__location) and isfile(VersionManager.__location):
|
||||||
try:
|
try:
|
||||||
with open(VersionManager.location) as f:
|
with open(VersionManager.__location) as f:
|
||||||
return json.load(f)
|
return json.load(f)
|
||||||
except:
|
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}
|
return {"coreVersion": None, "enclosureVersion": None}
|
||||||
|
|
Loading…
Reference in New Issue