def get_server_info(prefix=""): #this function is for non UI thread info info = {} info.update(get_host_info(prefix)) info.update(get_platform_info(mk(prefix, "platform"))) info.update(get_version_info(mk(prefix, "build"))) return info
def main(): def print_dict(d): for k in sorted(d.keys()): v = d[k] print("* %s : %s" % (k.ljust(32), nonl(pver(v)))) from xpra.platform import init, clean try: init("Version-Info", "Version Info") print("Build:") print_dict(get_version_info()) print("") print("Platform:") pi = get_platform_info() #ugly workaround for the fact that "sys.platform" has no key.. if "" in pi: pi["sys"] = pi[""] del pi[""] print_dict(pi) print("") print("Host:") d = get_host_info() #add os specific version info: try: from xpra.platform.info import get_version_info as pvinfo d.update(pvinfo()) except: pass print_dict(d) finally: clean()
def get_server_info(): #this function is for non UI thread info info = {} info.update(get_host_info()) def up(prefix, d): updict(info, prefix, d) up("platform", get_platform_info()) up("build", get_version_info()) return info
def get_sys_info(): d = {} for k, v in { "version": get_version_info(), "platform": get_platform_info(), "host": get_host_info(), "paths": get_path_info(), "gtk": get_gtk_version_info(), "user": get_user_info(), "env": os.environ, }.items(): updict(d, k, v) return d
def make_hello_base(self): capabilities = get_network_caps() capabilities.update({ "version": local_version, "encoding.generic": True, "namespace": True, "file-transfer": self.file_transfer, "file-size-limit": self.file_size_limit, "printing": self.printing, "hostname": socket.gethostname(), "uuid": self.uuid, "username": self.username, "name": get_name(), "client_type": self.client_type(), "python.version": sys.version_info[:3], "compression_level": self.compression_level, }) if self.display: capabilities["display"] = self.display def up(prefix, d): updict(capabilities, prefix, d) up("platform", get_platform_info()) up("build", get_version_info()) mid = get_machine_id() if mid: capabilities["machine_id"] = mid if self.encryption: assert self.encryption in ENCRYPTION_CIPHERS iv = get_hex_uuid()[:16] key_salt = get_hex_uuid() + get_hex_uuid() iterations = 1000 capabilities.update({ "cipher": self.encryption, "cipher.iv": iv, "cipher.key_salt": key_salt, "cipher.key_stretch_iterations": iterations, }) key = self.get_encryption_key() if key is None: self.warn_and_quit(EXIT_ENCRYPTION, "encryption key is missing") return self._protocol.set_cipher_in(self.encryption, iv, key, key_salt, iterations) log("encryption capabilities: %s", [(k, v) for k, v in capabilities.items() if k.startswith("cipher")]) return capabilities
def make_hello_base(self): capabilities = get_network_caps() capabilities.update({ "version" : local_version, "encoding.generic" : True, "namespace" : True, "file-transfer" : self.file_transfer, "file-size-limit" : self.file_size_limit, "printing" : self.printing, "hostname" : socket.gethostname(), "uuid" : self.uuid, "username" : self.username, "name" : get_name(), "client_type" : self.client_type(), "python.version" : sys.version_info[:3], "compression_level" : self.compression_level, }) if self.display: capabilities["display"] = self.display def up(prefix, d): updict(capabilities, prefix, d) up("platform", get_platform_info()) up("build", get_version_info()) mid = get_machine_id() if mid: capabilities["machine_id"] = mid if self.encryption: assert self.encryption in ENCRYPTION_CIPHERS iv = get_hex_uuid()[:16] key_salt = get_hex_uuid()+get_hex_uuid() iterations = 1000 capabilities.update({ "cipher" : self.encryption, "cipher.iv" : iv, "cipher.key_salt" : key_salt, "cipher.key_stretch_iterations": iterations, }) key = self.get_encryption_key() if key is None: self.warn_and_quit(EXIT_ENCRYPTION, "encryption key is missing") return self._protocol.set_cipher_in(self.encryption, iv, key, key_salt, iterations) log("encryption capabilities: %s", [(k,v) for k,v in capabilities.items() if k.startswith("cipher")]) return capabilities
def get_sys_info(): from xpra.platform.info import get_user_info from xpra.scripts.config import read_xpra_defaults return { "argv": sys.argv, "path": sys.path, "exec_prefix": sys.exec_prefix, "executable": sys.executable, "version": get_version_info(), "platform": get_platform_info(), "host": get_host_info(), "paths": get_path_info(), "gtk": get_gtk_version_info(), "gui": get_gui_info(), "display": get_display_info(), "user": get_user_info(), "env": os.environ, "config": read_xpra_defaults(), }
def get_sys_info(): from xpra.platform.info import get_user_info from xpra.scripts.config import read_xpra_defaults return { "argv" : sys.argv, "path" : sys.path, "exec_prefix" : sys.exec_prefix, "executable" : sys.executable, "version" : get_version_info(), "platform" : get_platform_info(), "host" : get_host_info(), "paths" : get_path_info(), "gtk" : get_gtk_version_info(), "gui" : get_gui_info(), "display" : get_display_info(), "user" : get_user_info(), "env" : os.environ, "config" : read_xpra_defaults(), }
def get_sys_info(): d = { "argv" : sys.argv, "path" : sys.path, "exec_prefix" : sys.exec_prefix, "executable" : sys.executable, } for k,v in { "version" : get_version_info(), "platform" : get_platform_info(), "host" : get_host_info(), "paths" : get_path_info(), "gtk" : get_gtk_version_info(), "gui" : get_gui_info(), "display" : get_display_info(), "user" : get_user_info(), "env" : os.environ, "config" : read_xpra_defaults(), }.items(): updict(d, k, v) return d
def main(): from xpra.platform import program_context with program_context("Version-Info", "Version Info"): print("Build:") print_nested_dict(get_version_info()) print("") print("Platform:") pi = get_platform_info() #ugly workaround for the fact that "sys.platform" has no key.. if "" in pi: pi["sys"] = pi[""] del pi[""] print_nested_dict(pi) print("") print("Host:") d = get_host_info() #add os specific version info: from xpra.platform.info import get_version_info as pvinfo d.update(pvinfo()) print_nested_dict(d) return 0
def main(): from xpra.platform import program_context with program_context("Version-Info", "Version Info"): print("Build:") print_nested_dict(get_version_info()) print("") print("Platform:") pi = get_platform_info() #ugly workaround for the fact that "sys.platform" has no key.. if "" in pi: pi["sys"] = pi[""] del pi[""] print_nested_dict(pi) print("") print("Host:") d = get_host_info() #add os specific version info: try: from xpra.platform.info import get_version_info as pvinfo d.update(pvinfo()) except: pass print_nested_dict(d)
def get_version_info(self): return get_version_info()
def get_version_info(self) -> dict: return get_version_info()
def test_get_version_info(self): for x in ("version", "revision"): self.assertTrue(x in get_version_info())
def test_get_version_info(self): for x in ("version", "revision"): self.assertTrue(x in get_version_info(), "%s not found in version info" % x)