nvidia-patch/tools/readme-autogen/constants.py

67 lines
4.0 KiB
Python
Raw Normal View History

2019-11-18 20:49:40 +00:00
from enum import IntEnum, Enum
import os.path
2019-11-18 20:49:40 +00:00
class OSKind(Enum):
Linux = 'linux'
Windows = 'win'
def __str__(self):
return self.name
class Product(IntEnum):
GeForce = 10
Quadro = 20
2019-11-18 20:49:40 +00:00
def __str__(self):
return self.name
class WinSeries(IntEnum):
win10 = 10
win7 = 20
ws2012 = 30
ws2016 = 40
2019-11-18 20:49:40 +00:00
def __str__(self):
return self.name
BASE_PATH = os.path.dirname(os.path.abspath(__file__))
TEMPLATE_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)),
"templates")
DATAFILE_PATH = os.path.join(BASE_PATH,
"..", "..", "drivers.json")
LINUX_README_PATH = os.path.join(BASE_PATH,
"..", "..", "README.md")
WINDOWS_README_PATH = os.path.join(BASE_PATH,
"..", "..", "win", "README.md")
ENCODING='utf-8'
2019-11-18 20:49:40 +00:00
DRIVER_URL_TEMPLATE = {
(OSKind.Linux, None, None, None): ["https://international.download.nvidia.com/XFree86/Linux-x86_64/$version/NVIDIA-Linux-x86_64-$version.run",
"https://international.download.nvidia.com/tesla/$version/NVIDIA-Linux-x86_64-$version.run"],
2021-08-10 21:01:02 +00:00
(OSKind.Windows, Product.GeForce, WinSeries.win10, ''): "https://international.download.nvidia.com/Windows/$version/$version-desktop-win10-win11-64bit-international-whql.exe",
(OSKind.Windows, Product.GeForce, WinSeries.win10, 'DCH'): ["https://international.download.nvidia.com/Windows/$version/$version-desktop-win10-win11-64bit-international-dch-whql.exe",
"https://international.download.nvidia.com/tesla/$version/$version-data-center-tesla-desktop-win10-win11-64bit-dch-international.exe"],
(OSKind.Windows, Product.GeForce, WinSeries.win10, 'DCH (Hotfix)'): "https://international.download.nvidia.com/Windows/${version}hf/$version-desktop-notebook-win10-win11-64bit-international-dch.hf.exe",
(OSKind.Windows, Product.GeForce, WinSeries.win10, 'Studio Driver'): "https://international.download.nvidia.com/Windows/$version/$version-desktop-win10-win11-64bit-international-nsd-dch-whql.exe",
2020-01-17 22:21:57 +00:00
(OSKind.Windows, Product.GeForce, WinSeries.win10, 'Vulkan Beta'): "",
(OSKind.Windows, Product.GeForce, WinSeries.ws2016, 'DCH'): "https://international.download.nvidia.com/tesla/$version/$version-data-center-tesla-desktop-winserver-2016-2019-2022-dch-international.exe",
2021-08-10 21:01:02 +00:00
(OSKind.Windows, Product.Quadro, WinSeries.win10, ''): "https://international.download.nvidia.com/Windows/Quadro_Certified/$version/$version-quadro-rtx-desktop-notebook-win10-win11-64bit-international-whql.exe",
2019-11-18 20:49:40 +00:00
(OSKind.Windows, Product.GeForce, WinSeries.win7, ''): "https://international.download.nvidia.com/Windows/$version/$version-desktop-win8-win7-64bit-international-whql.exe",
2020-01-17 22:21:57 +00:00
(OSKind.Windows, Product.GeForce, WinSeries.win7, 'Vulkan Beta'): "",
2020-12-15 15:20:52 +00:00
(OSKind.Windows, Product.Quadro, WinSeries.win7, ''): "https://international.download.nvidia.com/Windows/Quadro_Certified/$version/$version-quadro-rtx-desktop-notebook-win8-win7-64bit-international-whql.exe",
(OSKind.Windows, Product.Quadro, WinSeries.ws2012, ''): "https://international.download.nvidia.com/Windows/Quadro_Certified/$version/$version-quadro-rtx-winserv-2012r2-64bit-international-whql.exe",
(OSKind.Windows, Product.Quadro, WinSeries.ws2016, ''): "https://international.download.nvidia.com/Windows/Quadro_Certified/$version/$version-quadro-rtx-winserv-2016-2019-64bit-international-whql.exe",
2019-11-18 20:49:40 +00:00
}
DRIVER_DIR_PREFIX = {
(Product.GeForce, ''): '',
2022-05-24 21:50:31 +00:00
(Product.GeForce, 'DCH'): '',
(Product.GeForce, 'DCH (Hotfix)'): '',
2019-11-18 20:49:40 +00:00
(Product.GeForce, 'Studio Driver'): 'nsd_',
2020-01-17 22:21:57 +00:00
(Product.GeForce, 'Vulkan Beta'): '',
2019-11-18 20:49:40 +00:00
(Product.Quadro, ''): 'quadro_',
}
2020-05-30 16:20:59 +00:00
REPO_BASE = "https://raw.githubusercontent.com/keylase/nvidia-patch/master/win/"