forked from LBRYCommunity/lbry-sdk
revert updates to git
This commit is contained in:
parent
a574c33ac6
commit
20a9e018f7
1 changed files with 26 additions and 17 deletions
|
@ -148,8 +148,8 @@ class LBRYDaemon(jsonrpc.JSONRPC):
|
||||||
self.connected_to_internet = True
|
self.connected_to_internet = True
|
||||||
self.connection_problem = None
|
self.connection_problem = None
|
||||||
self.query_handlers = {}
|
self.query_handlers = {}
|
||||||
self.pip_lbrynet_version = None
|
self.git_lbrynet_version = None
|
||||||
self.pip_lbryum_version = None
|
self.git_lbryum_version = None
|
||||||
self.ui_version = None
|
self.ui_version = None
|
||||||
self.ip = None
|
self.ip = None
|
||||||
# TODO: this is confusing to set here, and then to be reset below.
|
# TODO: this is confusing to set here, and then to be reset below.
|
||||||
|
@ -569,33 +569,42 @@ class LBRYDaemon(jsonrpc.JSONRPC):
|
||||||
def _check_remote_versions(self):
|
def _check_remote_versions(self):
|
||||||
def _get_lbryum_version():
|
def _get_lbryum_version():
|
||||||
try:
|
try:
|
||||||
r = pkg_resources.get_distribution("lbryum").version
|
r = urlopen("https://raw.githubusercontent.com/lbryio/lbryum/master/lib/version.py").read().split('\n')
|
||||||
log.info("Local lbryum: %s" % lbryum_version)
|
version = next(line.split("=")[1].split("#")[0].replace(" ", "")
|
||||||
log.info("Available lbryum: %s" % r)
|
for line in r if "LBRYUM_VERSION" in line)
|
||||||
self.pip_lbryum_version = r
|
version = version.replace("'", "")
|
||||||
|
log.info(
|
||||||
|
"remote lbryum %s > local lbryum %s = %s",
|
||||||
|
version, lbryum_version,
|
||||||
|
utils.version_is_greater_than(version, lbryum_version)
|
||||||
|
)
|
||||||
|
self.git_lbryum_version = version
|
||||||
return defer.succeed(None)
|
return defer.succeed(None)
|
||||||
except:
|
except:
|
||||||
log.info("Failed to get lbryum version from git")
|
log.info("Failed to get lbryum version from git")
|
||||||
self.pip_lbryum_version = None
|
self.git_lbryum_version = None
|
||||||
return defer.fail(None)
|
return defer.fail(None)
|
||||||
|
|
||||||
def _get_lbrynet_version():
|
def _get_lbrynet_version():
|
||||||
try:
|
try:
|
||||||
r = pkg_resources.get_distribution("lbrynet").version
|
version = get_lbrynet_version_from_github()
|
||||||
log.info("Local lbrynet: %s" % lbrynet_version)
|
log.info(
|
||||||
log.info("Available lbrynet: %s" % r)
|
"remote lbrynet %s > local lbrynet %s = %s",
|
||||||
self.pip_lbrynet_version = r
|
version, lbrynet_version,
|
||||||
|
utils.version_is_greater_than(version, lbrynet_version)
|
||||||
|
)
|
||||||
|
self.git_lbrynet_version = version
|
||||||
return defer.succeed(None)
|
return defer.succeed(None)
|
||||||
except:
|
except:
|
||||||
log.info("Failed to get lbrynet version from git")
|
log.info("Failed to get lbrynet version from git")
|
||||||
self.pip_lbrynet_version = None
|
self.git_lbrynet_version = None
|
||||||
return defer.fail(None)
|
return defer.fail(None)
|
||||||
|
|
||||||
d = _get_lbrynet_version()
|
d = _get_lbrynet_version()
|
||||||
d.addCallback(lambda _: _get_lbryum_version())
|
d.addCallback(lambda _: _get_lbryum_version())
|
||||||
|
|
||||||
def _check_connection_problems(self):
|
def _check_connection_problems(self):
|
||||||
if not self.pip_lbrynet_version or not self.pip_lbryum_version:
|
if not self.git_lbrynet_version or not self.git_lbryum_version:
|
||||||
self.connection_problem = CONNECTION_PROBLEM_CODES[0]
|
self.connection_problem = CONNECTION_PROBLEM_CODES[0]
|
||||||
|
|
||||||
elif self.startup_status[0] == 'loading_wallet':
|
elif self.startup_status[0] == 'loading_wallet':
|
||||||
|
@ -1537,10 +1546,10 @@ class LBRYDaemon(jsonrpc.JSONRPC):
|
||||||
'lbrynet_version': lbrynet_version,
|
'lbrynet_version': lbrynet_version,
|
||||||
'lbryum_version': lbryum_version,
|
'lbryum_version': lbryum_version,
|
||||||
'ui_version': self.ui_version,
|
'ui_version': self.ui_version,
|
||||||
'remote_lbrynet': self.pip_lbrynet_version,
|
'remote_lbrynet': self.git_lbrynet_version,
|
||||||
'remote_lbryum': self.pip_lbryum_version,
|
'remote_lbryum': self.git_lbryum_version,
|
||||||
'lbrynet_update_available': utils.version_is_greater_than(self.pip_lbrynet_version, lbrynet_version),
|
'lbrynet_update_available': utils.version_is_greater_than(self.git_lbrynet_version, lbrynet_version),
|
||||||
'lbryum_update_available': utils.version_is_greater_than(self.pip_lbryum_version, lbryum_version),
|
'lbryum_update_available': utils.version_is_greater_than(self.git_lbryum_version, lbryum_version),
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("Get version info: " + json.dumps(msg))
|
log.info("Get version info: " + json.dumps(msg))
|
||||||
|
|
Loading…
Reference in a new issue