Merge remote-tracking branch 'origin/linux_analytics'

This commit is contained in:
Jack Robison 2018-05-29 15:20:46 -04:00
commit 4b766eeea9
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
4 changed files with 11 additions and 1 deletions

View file

@ -59,6 +59,7 @@ at anytime.
* integration tests for bootstrapping the dht
* configurable `concurrent_announcers` and `s3_headers_depth` settings
* `peer_ping` command
* linux distro and desktop name added to analytics
### Removed
* `announce_all` argument from `blob_announce`

View file

@ -185,7 +185,7 @@ class Manager(object):
@staticmethod
def _make_context(platform, wallet):
return {
context = {
'app': {
'name': 'lbrynet',
'version': platform['lbrynet_version'],
@ -206,6 +206,10 @@ class Manager(object):
'version': '1.0.0'
},
}
if 'desktop' in platform and 'distro' in platform:
context['os']['desktop'] = platform['desktop']
context['os']['distro'] = platform['distro']
return context
@staticmethod
def _if_deferred(maybe_deferred, callback, *args, **kwargs):

View file

@ -36,6 +36,10 @@ def get_platform(get_ip=True):
"lbryschema_version": lbryschema_version,
"build": build_type.BUILD, # CI server sets this during build step
}
if p["os_system"] == "Linux":
import distro
p["distro"] = distro.info()
p["desktop"] = os.environ.get('XDG_CURRENT_DESKTOP', 'Unknown')
# TODO: remove this from get_platform and add a get_external_ip function using treq
if get_ip:

View file

@ -17,6 +17,7 @@ from setuptools import setup, find_packages
requires = [
'Twisted',
'appdirs',
'distro',
'base58',
'envparse',
'jsonrpc',