Example #1
0
def get_wine_versions():
    """Return the list of Wine versions installed"""
    versions = []

    for build in sorted(WINE_PATHS.keys()):
        version = get_system_wine_version(WINE_PATHS[build])
        if version:
            versions.append(build)

    if system.path_exists(WINE_DIR):
        dirs = version_sort(os.listdir(WINE_DIR), reverse=True)
        for dirname in dirs:
            if is_version_installed(dirname):
                versions.append(dirname)

    for proton_path in get_proton_paths():
        proton_versions = [p for p in os.listdir(proton_path) if "Proton" in p]
        for version in proton_versions:
            proton_path = os.path.join(proton_path, version, "dist/bin/wine")
            if os.path.isfile(proton_path):
                versions.append(version)

    if POL_PATH:
        for arch in ['x86', 'amd64']:
            builds_path = os.path.join(POL_PATH, "wine/linux-%s" % arch)
            if not system.path_exists(builds_path):
                continue
            for version in os.listdir(builds_path):
                if system.path_exists(
                        os.path.join(builds_path, version, "bin/wine")):
                    logger.debug("Adding PoL version %s", version)
                    versions.append("PlayOnLinux %s-%s" % (version, arch))
                else:
                    logger.warning(os.path.join(builds_path, "bin/wine"))
    return versions
Example #2
0
def get_wine_versions():
    """Return the list of Wine versions installed"""
    versions = []

    for build in sorted(WINE_PATHS.keys()):
        version = get_system_wine_version(WINE_PATHS[build])
        if version:
            versions.append(build)

    if system.path_exists(WINE_DIR):
        dirs = version_sort(os.listdir(WINE_DIR), reverse=True)
        for dirname in dirs:
            if is_version_installed(dirname):
                versions.append(dirname)

    for proton_path in get_proton_paths():
        proton_versions = [p for p in os.listdir(proton_path) if "Proton" in p]
        for version in proton_versions:
            path = os.path.join(proton_path, version, "dist/bin/wine")
            if os.path.isfile(path):
                versions.append(version)

    if POL_PATH:
        for arch in ['x86', 'amd64']:
            builds_path = os.path.join(POL_PATH, "wine/linux-%s" % arch)
            if not system.path_exists(builds_path):
                continue
            for version in os.listdir(builds_path):
                if system.path_exists(os.path.join(builds_path, version, "bin/wine")):
                    logger.debug("Adding PoL version %s", version)
                    versions.append("PlayOnLinux %s-%s" % (version, arch))
                else:
                    logger.warning(os.path.join(builds_path, "bin/wine"))
    return versions
Example #3
0
 def test_versions_are_correctly_sorted(self):
     versions = ['1.8', '1.7.4', '1.9.1', '1.9.10', '1.9.4']
     versions = strings.version_sort(versions)
     self.assertEqual(versions[0], '1.7.4')
     self.assertEqual(versions[1], '1.8')
     self.assertEqual(versions[2], '1.9.1')
     self.assertEqual(versions[3], '1.9.4')
     self.assertEqual(versions[4], '1.9.10')
Example #4
0
 def test_versions_are_correctly_sorted(self):
     versions = ["1.8", "1.7.4", "1.9.1", "1.9.10", "1.9.4"]
     versions = strings.version_sort(versions)
     self.assertEqual(versions[0], "1.7.4")
     self.assertEqual(versions[1], "1.8")
     self.assertEqual(versions[2], "1.9.1")
     self.assertEqual(versions[3], "1.9.4")
     self.assertEqual(versions[4], "1.9.10")
Example #5
0
 def test_versions_are_correctly_sorted(self):
     versions = ['1.8', '1.7.4', '1.9.1', '1.9.10', '1.9.4']
     versions = strings.version_sort(versions)
     self.assertEqual(versions[0], '1.7.4')
     self.assertEqual(versions[1], '1.8')
     self.assertEqual(versions[2], '1.9.1')
     self.assertEqual(versions[3], '1.9.4')
     self.assertEqual(versions[4], '1.9.10')
Example #6
0
def get_lutris_wine_versions():
    """Return the list of wine versions installed by lutris"""
    versions = []
    if system.path_exists(WINE_DIR):
        dirs = version_sort(os.listdir(WINE_DIR), reverse=True)
        for dirname in dirs:
            if is_version_installed(dirname):
                versions.append(dirname)
    return versions
Example #7
0
 def test_version_sorting_supports_extra_strings(self):
     versions = [
         '1.8', '1.8-staging', '1.7.4', '1.9.1', '1.9.10-staging', '1.9.10',
         '1.9.4', 'staging-1.9.4'
     ]
     versions = strings.version_sort(versions)
     self.assertEqual(versions[0], '1.7.4')
     self.assertEqual(versions[1], '1.8')
     self.assertEqual(versions[2], '1.8-staging')
     self.assertEqual(versions[3], '1.9.1')
     self.assertEqual(versions[4], '1.9.4')
     self.assertEqual(versions[5], 'staging-1.9.4')
     self.assertEqual(versions[6], '1.9.10')
     self.assertEqual(versions[7], '1.9.10-staging')
Example #8
0
def get_wine_versions():
    """Return the list of Wine versions installed"""
    versions = []

    for build in sorted(WINE_PATHS.keys()):
        version = get_system_wine_version(WINE_PATHS[build])
        if version:
            versions.append(build)

    if os.path.exists(WINE_DIR):
        dirs = version_sort(os.listdir(WINE_DIR), reverse=True)
        for dirname in dirs:
            if is_version_installed(dirname):
                versions.append(dirname)
    return versions
Example #9
0
File: wine.py Project: Freso/lutris
def get_wine_versions():
    """Return the list of Wine versions installed"""
    versions = []

    for build in sorted(WINE_PATHS.keys()):
        version = get_system_wine_version(WINE_PATHS[build])
        if version:
            versions.append(build)

    if os.path.exists(WINE_DIR):
        dirs = version_sort(os.listdir(WINE_DIR), reverse=True)
        for dirname in dirs:
            if is_version_installed(dirname):
                versions.append(dirname)
    return versions
Example #10
0
 def test_version_sorting_supports_extra_strings(self):
     versions = [
         '1.8', '1.8-staging',
         '1.7.4', '1.9.1',
         '1.9.10-staging', '1.9.10',
         '1.9.4', 'staging-1.9.4'
     ]
     versions = strings.version_sort(versions)
     self.assertEqual(versions[0], '1.7.4')
     self.assertEqual(versions[1], '1.8')
     self.assertEqual(versions[2], '1.8-staging')
     self.assertEqual(versions[3], '1.9.1')
     self.assertEqual(versions[4], '1.9.4')
     self.assertEqual(versions[5], 'staging-1.9.4')
     self.assertEqual(versions[6], '1.9.10')
     self.assertEqual(versions[7], '1.9.10-staging')
Example #11
0
 def test_version_sorting_supports_extra_strings(self):
     versions = [
         "1.8",
         "1.8-staging",
         "1.7.4",
         "1.9.1",
         "1.9.10-staging",
         "1.9.10",
         "1.9.4",
         "staging-1.9.4",
     ]
     versions = strings.version_sort(versions)
     self.assertEqual(versions[0], "1.7.4")
     self.assertEqual(versions[1], "1.8")
     self.assertEqual(versions[2], "1.8-staging")
     self.assertEqual(versions[3], "1.9.1")
     self.assertEqual(versions[4], "1.9.4")
     self.assertEqual(versions[5], "staging-1.9.4")
     self.assertEqual(versions[6], "1.9.10")
     self.assertEqual(versions[7], "1.9.10-staging")
Example #12
0
def get_wine_versions():
    """Return the list of Wine versions installed"""
    versions = []

    for build in sorted(WINE_PATHS.keys()):
        version = get_system_wine_version(WINE_PATHS[build])
        if version:
            versions.append(build)

    if system.path_exists(WINE_DIR):
        dirs = version_sort(os.listdir(WINE_DIR), reverse=True)
        for dirname in dirs:
            if is_version_installed(dirname):
                versions.append(dirname)

    if PROTON_PATH:
        proton_versions = [p for p in os.listdir(PROTON_PATH) if "Proton" in p]
        for version in proton_versions:
            proton_path = os.path.join(PROTON_PATH, version, 'dist/bin/wine')
            if os.path.isfile(proton_path):
                versions.append(version)
    return versions
Example #13
0
 def test_versions_can_be_reversed(self):
     versions = ['1.9', '1.6', '1.7', '1.8']
     versions = strings.version_sort(versions, reverse=True)
     self.assertEqual(versions[0], '1.9')
     self.assertEqual(versions[3], '1.6')
Example #14
0
 def test_versions_can_be_reversed(self):
     versions = ["1.9", "1.6", "1.7", "1.8"]
     versions = strings.version_sort(versions, reverse=True)
     self.assertEqual(versions[0], "1.9")
     self.assertEqual(versions[3], "1.6")
Example #15
0
 def test_versions_can_be_reversed(self):
     versions = ['1.9', '1.6', '1.7', '1.8']
     versions = strings.version_sort(versions, reverse=True)
     self.assertEqual(versions[0], '1.9')
     self.assertEqual(versions[3], '1.6')