2016-11-10 21:49:51 +01:00
|
|
|
import platform
|
2017-03-15 21:19:11 +01:00
|
|
|
import json
|
2016-11-10 21:49:51 +01:00
|
|
|
|
|
|
|
from urllib2 import urlopen
|
|
|
|
|
|
|
|
from lbrynet import __version__ as lbrynet_version
|
|
|
|
from lbrynet import build_type
|
|
|
|
from lbryum.version import LBRYUM_VERSION as lbryum_version
|
|
|
|
|
|
|
|
|
2017-03-15 21:19:11 +01:00
|
|
|
def get_platform(get_ip=True):
|
2016-11-10 21:49:51 +01:00
|
|
|
p = {
|
|
|
|
"processor": platform.processor(),
|
|
|
|
"python_version": platform.python_version(),
|
|
|
|
"platform": platform.platform(),
|
|
|
|
"os_release": platform.release(),
|
|
|
|
"os_system": platform.system(),
|
|
|
|
"lbrynet_version": lbrynet_version,
|
|
|
|
"lbryum_version": lbryum_version,
|
2017-03-15 21:33:41 +01:00
|
|
|
"build": build_type.BUILD, # CI server sets this during build step
|
2016-11-10 21:49:51 +01:00
|
|
|
}
|
|
|
|
|
2017-03-15 21:19:11 +01:00
|
|
|
if get_ip:
|
|
|
|
try:
|
|
|
|
p['ip'] = json.load(urlopen('http://jsonip.com'))['ip']
|
|
|
|
except:
|
|
|
|
p['ip'] = "Could not determine IP"
|
2016-11-10 21:49:51 +01:00
|
|
|
|
|
|
|
return p
|