mirror of
https://github.com/ValveSoftware/Proton.git
synced 2025-01-15 16:18:20 +03:00
proton: Change 'not x in y' to 'x not in y'.
This commit is contained in:
parent
126f121b74
commit
3ea1bf2170
26
proton
26
proton
@ -54,13 +54,13 @@ def nonzero(s):
|
|||||||
return len(s) > 0 and s != "0"
|
return len(s) > 0 and s != "0"
|
||||||
|
|
||||||
def prepend_to_env_str(env, variable, prepend_str, separator):
|
def prepend_to_env_str(env, variable, prepend_str, separator):
|
||||||
if not variable in env:
|
if variable not in env:
|
||||||
env[variable] = prepend_str
|
env[variable] = prepend_str
|
||||||
else:
|
else:
|
||||||
env[variable] = prepend_str + separator + env[variable]
|
env[variable] = prepend_str + separator + env[variable]
|
||||||
|
|
||||||
def append_to_env_str(env, variable, append_str, separator):
|
def append_to_env_str(env, variable, append_str, separator):
|
||||||
if not variable in env:
|
if variable not in env:
|
||||||
env[variable] = append_str
|
env[variable] = append_str
|
||||||
else:
|
else:
|
||||||
env[variable] = env[variable] + separator + append_str
|
env[variable] = env[variable] + separator + append_str
|
||||||
@ -264,8 +264,8 @@ def getmtimestr(*path_fragments):
|
|||||||
return "0"
|
return "0"
|
||||||
|
|
||||||
def try_get_game_library_dir():
|
def try_get_game_library_dir():
|
||||||
if not "STEAM_COMPAT_INSTALL_PATH" in g_session.env or \
|
if "STEAM_COMPAT_INSTALL_PATH" not in g_session.env or \
|
||||||
not "STEAM_COMPAT_LIBRARY_PATHS" in g_session.env:
|
"STEAM_COMPAT_LIBRARY_PATHS" not in g_session.env:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
#find library path which is a subset of the game path
|
#find library path which is a subset of the game path
|
||||||
@ -277,7 +277,7 @@ def try_get_game_library_dir():
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def try_get_steam_dir():
|
def try_get_steam_dir():
|
||||||
if not "STEAM_COMPAT_CLIENT_INSTALL_PATH" in g_session.env:
|
if "STEAM_COMPAT_CLIENT_INSTALL_PATH" not in g_session.env:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return g_session.env["STEAM_COMPAT_CLIENT_INSTALL_PATH"]
|
return g_session.env["STEAM_COMPAT_CLIENT_INSTALL_PATH"]
|
||||||
@ -515,7 +515,7 @@ class CompatData:
|
|||||||
if old_ver is None:
|
if old_ver is None:
|
||||||
return
|
return
|
||||||
|
|
||||||
if not '-' in old_ver:
|
if '-' not in old_ver:
|
||||||
#How can this happen??
|
#How can this happen??
|
||||||
log("Prefix has an invalid version?! You may want to back up user files and delete this prefix.")
|
log("Prefix has an invalid version?! You may want to back up user files and delete this prefix.")
|
||||||
#If it does, just let the Wine upgrade happen and hope it works...
|
#If it does, just let the Wine upgrade happen and hope it works...
|
||||||
@ -1213,7 +1213,7 @@ class Session:
|
|||||||
self.compat_config.add(cur)
|
self.compat_config.add(cur)
|
||||||
|
|
||||||
#turn forcelgadd on by default unless it is disabled in compat config
|
#turn forcelgadd on by default unless it is disabled in compat config
|
||||||
if not "noforcelgadd" in self.compat_config:
|
if "noforcelgadd" not in self.compat_config:
|
||||||
self.compat_config.add("forcelgadd")
|
self.compat_config.add("forcelgadd")
|
||||||
|
|
||||||
appid = os.environ.get("SteamGameId", 0)
|
appid = os.environ.get("SteamGameId", 0)
|
||||||
@ -1265,7 +1265,7 @@ class Session:
|
|||||||
prepend_to_env_str(self.env, "PATH", g_proton.bin_dir, ":")
|
prepend_to_env_str(self.env, "PATH", g_proton.bin_dir, ":")
|
||||||
|
|
||||||
def check_environment(self, env_name, config_name):
|
def check_environment(self, env_name, config_name):
|
||||||
if not env_name in self.env:
|
if env_name not in self.env:
|
||||||
return False
|
return False
|
||||||
if nonzero(self.env[env_name]):
|
if nonzero(self.env[env_name]):
|
||||||
self.compat_config.add(config_name)
|
self.compat_config.add(config_name)
|
||||||
@ -1293,7 +1293,7 @@ class Session:
|
|||||||
#SteamGameId is not always available
|
#SteamGameId is not always available
|
||||||
lfile_path = basedir + "/steam-proton.log"
|
lfile_path = basedir + "/steam-proton.log"
|
||||||
else:
|
else:
|
||||||
if not "SteamGameId" in os.environ:
|
if "SteamGameId" not in os.environ:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
lfile_path = basedir + "/steam-" + os.environ["SteamGameId"] + ".log"
|
lfile_path = basedir + "/steam-" + os.environ["SteamGameId"] + ".log"
|
||||||
@ -1314,7 +1314,7 @@ class Session:
|
|||||||
try:
|
try:
|
||||||
import user_settings
|
import user_settings
|
||||||
for key, value in user_settings.user_settings.items():
|
for key, value in user_settings.user_settings.items():
|
||||||
if not key in self.env:
|
if key not in self.env:
|
||||||
self.env[key] = value
|
self.env[key] = value
|
||||||
used_user_settings[key] = value
|
used_user_settings[key] = value
|
||||||
except:
|
except:
|
||||||
@ -1370,7 +1370,7 @@ class Session:
|
|||||||
else:
|
else:
|
||||||
self.env["WINEESYNC"] = "1"
|
self.env["WINEESYNC"] = "1"
|
||||||
|
|
||||||
if not "noxim" in self.compat_config:
|
if "noxim" not in self.compat_config:
|
||||||
self.env.pop("WINE_ALLOW_XIM")
|
self.env.pop("WINE_ALLOW_XIM")
|
||||||
|
|
||||||
if "nofsync" in self.compat_config:
|
if "nofsync" in self.compat_config:
|
||||||
@ -1400,7 +1400,7 @@ class Session:
|
|||||||
append_to_env_str(self.env, "VKD3D_CONFIG", "force_bindless_texel_buffer", ",")
|
append_to_env_str(self.env, "VKD3D_CONFIG", "force_bindless_texel_buffer", ",")
|
||||||
|
|
||||||
if "vkd3dfl12" in self.compat_config:
|
if "vkd3dfl12" in self.compat_config:
|
||||||
if not "VKD3D_FEATURE_LEVEL" in self.env:
|
if "VKD3D_FEATURE_LEVEL" not in self.env:
|
||||||
self.env["VKD3D_FEATURE_LEVEL"] = "12_0"
|
self.env["VKD3D_FEATURE_LEVEL"] = "12_0"
|
||||||
|
|
||||||
if "hidevggpu" in self.compat_config:
|
if "hidevggpu" in self.compat_config:
|
||||||
@ -1550,7 +1550,7 @@ class Session:
|
|||||||
return rc
|
return rc
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if not "STEAM_COMPAT_DATA_PATH" in os.environ:
|
if "STEAM_COMPAT_DATA_PATH" not in os.environ:
|
||||||
log("No compat data path?")
|
log("No compat data path?")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user