Reformatted code with black

This commit is contained in:
Deorder
2021-03-10 20:27:23 +01:00
parent 7b78259365
commit 3d834a963a
+8 -4
View File
@@ -16,15 +16,19 @@ class MSFS2020Game(BasicGame):
GameName = "Microsoft Flight Simulator 2020"
GameShortName = "msfs2020"
GameBinary = r"FlightSimulator.exe"
GameDataPath = r"%USERPROFILE%\AppData\Roaming\Microsoft Flight Simulator\Packages\Community"
GameDataPath = (
r"%USERPROFILE%\AppData\Roaming\Microsoft Flight Simulator\Packages\Community"
)
GameSteamId = [1250410]
def dataDirectory(self) -> QDir:
# Find and use package path specified in Asobo engine options
# Find and use package path specified in Asobo engine options
AppDataPath = os.path.expandvars(r"%APPDATA%\Microsoft Flight Simulator")
UserCfgPath = os.path.join(AppDataPath, "UserCfg.opt")
InstalledPackagesPathPattern = re.compile("InstalledPackagesPath\s*=\s*\"(.*)\"", re.IGNORECASE)
with open(UserCfgPath, newline='') as f:
InstalledPackagesPathPattern = re.compile(
'InstalledPackagesPath\s*=\s*"(.*)"', re.IGNORECASE
)
with open(UserCfgPath, newline="") as f:
for _, line in enumerate(f):
for match in re.finditer(InstalledPackagesPathPattern, line):
return QDir(os.path.join(match.group(), "Community"))