2016-06-11 04:40:21 +00:00
|
|
|
import platform
|
|
|
|
from netlib import version
|
|
|
|
|
|
|
|
"""
|
|
|
|
Some utilities to help with debugging.
|
|
|
|
"""
|
|
|
|
|
|
|
|
def sysinfo():
|
|
|
|
data = [
|
|
|
|
"Mitmproxy verison: %s"%version.VERSION,
|
|
|
|
"Python version: %s"%platform.python_version(),
|
|
|
|
"Platform: %s"%platform.platform(),
|
|
|
|
]
|
|
|
|
d = platform.linux_distribution()
|
2016-06-11 05:56:17 +00:00
|
|
|
t = "Linux distro: %s %s %s"%d
|
|
|
|
if d[0]: # pragma: no-cover
|
|
|
|
data.append(t)
|
2016-06-11 04:40:21 +00:00
|
|
|
|
|
|
|
d = platform.mac_ver()
|
2016-06-11 05:56:17 +00:00
|
|
|
t = "Mac version: %s %s %s"%d
|
|
|
|
if d[0]: # pragma: no-cover
|
|
|
|
data.append(t)
|
2016-06-11 04:40:21 +00:00
|
|
|
|
|
|
|
d = platform.win32_ver()
|
2016-06-11 05:56:17 +00:00
|
|
|
t = "Windows version: %s %s %s %s"%d
|
|
|
|
if d[0]: # pragma: no-cover
|
|
|
|
data.append(t)
|
2016-06-11 04:40:21 +00:00
|
|
|
|
|
|
|
return "\n".join(data)
|