Example #1
0
def do_get_ssh_conf_dirs():
    from xpra.scripts.config import python_platform
    if python_platform.architecture()[0]=="32bit":
        system32 = "SysNative"
    else:
        system32 = "System32"
    windows_dir = os.environ.get("SystemRoot", os.environ.get("WINDIR", "C:\\Windows"))
    openssh_dir = os.path.join(windows_dir, system32, "OpenSSH")
    return [
        os.path.join(get_program_data_dir(), "ssh"),    #ie: C:\ProgramData\ssh
        "%APPDATA%\\ssh",   #ie: C:\Users\Username\AppData\Roaming\ssh
        openssh_dir,        #ie: C:\Windows\system32\OpenSSH
        "~/.ssh",
        "~/ssh",
        ]
Example #2
0
def do_get_platform_info():
    from xpra.os_util import platform_name

    def get_processor_name():
        if pp.system() == "Windows":
            return pp.processor()
        elif pp.system() == "Darwin":
            os.environ['PATH'] = os.environ['PATH'] + os.pathsep + '/usr/sbin'
            command = "sysctl -n machdep.cpu.brand_string"
            import subprocess
            return subprocess.check_output(command).strip()
        elif pp.system() == "Linux":
            with open("/proc/cpuinfo") as f:
                data = f.read()
            import re
            for line in data.split("\n"):
                if "model name" in line:
                    return re.sub(".*model name.*:", "", line, 1).strip()
        assert False

    info = {}
    if sys.platform.startswith("linux") and hasattr(pp, "linux_distribution"):
        info["linux_distribution"] = pp.linux_distribution()
    info.update({
        "":
        sys.platform,
        "name":
        platform_name(sys.platform,
                      info.get("linux_distribution") or pp.release()),
        "release":
        pp.release(),
        "platform":
        pp.platform(),
        "machine":
        pp.machine(),
        "processor":
        pp.processor(),
        "architecture":
        pp.architecture(),
    })
    try:
        info["processor"] = get_processor_name()
    except:
        info["processor"] = pp.processor()
    return info
Example #3
0
def do_get_platform_info():
    from xpra.os_util import platform_name

    def get_processor_name():
        if pp.system() == "Windows":
            return pp.processor()
        elif pp.system() == "Darwin":
            os.environ["PATH"] = os.environ["PATH"] + os.pathsep + "/usr/sbin"
            command = "sysctl -n machdep.cpu.brand_string"
            import subprocess

            return subprocess.check_output(command).strip()
        elif pp.system() == "Linux":
            with open("/proc/cpuinfo") as f:
                data = f.read()
            import re

            for line in data.split("\n"):
                if "model name" in line:
                    return re.sub(".*model name.*:", "", line, 1).strip()
        assert False

    info = {}
    if sys.platform.startswith("linux") and hasattr(pp, "linux_distribution"):
        info["linux_distribution"] = pp.linux_distribution()
    info.update(
        {
            "": sys.platform,
            "name": platform_name(sys.platform, info.get("linux_distribution") or pp.release()),
            "release": pp.release(),
            "platform": pp.platform(),
            "machine": pp.machine(),
            "processor": pp.processor(),
            "architecture": pp.architecture(),
        }
    )
    try:
        info["processor"] = get_processor_name()
    except:
        info["processor"] = pp.processor()
    return info