예제 #1
0
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
예제 #2
0
파일: version.py 프로젝트: rudresh2319/Xpra
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()
예제 #3
0
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
예제 #4
0
파일: version.py 프로젝트: svn2github/Xpra
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()
예제 #5
0
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
예제 #6
0
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
예제 #7
0
 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
예제 #8
0
    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
예제 #9
0
    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
예제 #10
0
파일: bug_report.py 프로젝트: tardyp/Xpra
 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(),
     }
예제 #11
0
파일: bug_report.py 프로젝트: ljmljz/xpra
 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(),
             }
예제 #12
0
 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
예제 #13
0
파일: version.py 프로젝트: gitmirrors2/xpra
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
예제 #14
0
파일: version.py 프로젝트: ljmljz/xpra
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)
예제 #15
0
 def get_version_info(self):
     return get_version_info()
예제 #16
0
 def get_version_info(self) -> dict:
     return get_version_info()
예제 #17
0
 def test_get_version_info(self):
     for x in ("version", "revision"):
         self.assertTrue(x in get_version_info())
예제 #18
0
 def test_get_version_info(self):
     for x in ("version", "revision"):
         self.assertTrue(x in get_version_info())
예제 #19
0
 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)
예제 #20
0
파일: client_base.py 프로젝트: ljmljz/xpra
 def get_version_info(self):
     return get_version_info()