Skip to content

Commit

Permalink
Fix CI and Github action.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Oct 31, 2020
1 parent 7c2cc52 commit 41ac867
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 53 deletions.
10 changes: 8 additions & 2 deletions basic_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@ def __init__(self, game: "BasicGame"):
self.gameName = BasicGameMapping(game, "GameName", "gameName")
self.gameShortName = BasicGameMapping(game, "GameShortName", "gameShortName")
self.gameNexusName = BasicGameMapping(
game, "GameNexusName", "gameNexusName", default=lambda g: g.gameShortName(),
game,
"GameNexusName",
"gameNexusName",
default=lambda g: g.gameShortName(),
)
self.validShortNames = BasicGameMapping(
game,
Expand All @@ -246,7 +249,10 @@ def __init__(self, game: "BasicGame"):
)
self.binaryName = BasicGameMapping(game, "GameBinary", "binaryName")
self.launcherName = BasicGameMapping(
game, "GameLauncher", "getLauncherName", default=lambda g: "",
game,
"GameLauncher",
"getLauncherName",
default=lambda g: "",
)
self.dataDirectory = BasicGameMapping(game, "GameDataPath", "dataDirectory")
self.documentsDirectory = BasicGameMapping(
Expand Down
2 changes: 1 addition & 1 deletion basic_game_ini.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, path: str):

# Read the file:
config = configparser.ConfigParser()
config.optionxform = str
config.optionxform = str # type: ignore
config.read(path)

# Just fill the class with values:
Expand Down
4 changes: 0 additions & 4 deletions games/game_darksouls.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# -*- encoding: utf-8 -*-

from PyQt5.QtCore import QDir, QFileInfo, QStandardPaths

import mobase

from ..basic_game import BasicGame


Expand Down
5 changes: 0 additions & 5 deletions games/game_mirrorsedge.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# -*- encoding: utf-8 -*-

import mobase


from ..basic_game import BasicGame
from ..basic_features import BasicGameSaveGameInfo


class MirrorsEdgeGame(BasicGame):
Expand All @@ -20,4 +16,3 @@ class MirrorsEdgeGame(BasicGame):
GameGogId = 1893001152
GameBinary = "Binaries/MirrorsEdge.exe"
GameDataPath = "TdGame"

6 changes: 4 additions & 2 deletions games/game_mountandblade2.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ def executables(self):
mobase.ExecutableInfo(
"Mount & Blade II: Bannerlord",
QFileInfo(
self.gameDirectory(), "bin/Win64_Shipping_Client/Bannerlord.exe",
self.gameDirectory(),
"bin/Win64_Shipping_Client/Bannerlord.exe",
),
),
mobase.ExecutableInfo(
Expand All @@ -85,7 +86,8 @@ def executables(self):
mobase.ExecutableInfo(
"Mount & Blade II: Bannerlord (BE)",
QFileInfo(
self.gameDirectory(), "bin/Win64_Shipping_Client/Bannerlord_BE.exe",
self.gameDirectory(),
"bin/Win64_Shipping_Client/Bannerlord_BE.exe",
),
),
]
46 changes: 22 additions & 24 deletions games/game_stalkeranomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@

from ..basic_game import BasicGame


class StalkerAnomalyModDataChecker(mobase.ModDataChecker):
def __init__(self):
super().__init__()

def dataLooksValid(
self, tree: mobase.IFileTree
) -> mobase.ModDataChecker.CheckReturn:
Expand All @@ -20,6 +21,7 @@ def dataLooksValid(
else:
return mobase.ModDataChecker.INVALID


class StalkerAnomalyGame(BasicGame, mobase.IPluginFileMapper):
Name = "STALKER Anomaly"
Author = "Qudix"
Expand All @@ -30,14 +32,14 @@ class StalkerAnomalyGame(BasicGame, mobase.IPluginFileMapper):
GameShortName = "stalkeranomaly"
GameBinary = "AnomalyLauncher.exe"
GameDataPath = ""

GameSaveExtension = "scop"
GameSavesDirectory = "%GAME_PATH%/appdata/savedgames"

def __init__(self):
BasicGame.__init__(self)
mobase.IPluginFileMapper.__init__(self)

def init(self, organizer: mobase.IOrganizer):
BasicGame.init(self, organizer)
self._featureMap[mobase.ModDataChecker] = StalkerAnomalyModDataChecker()
Expand All @@ -46,49 +48,45 @@ def init(self, organizer: mobase.IOrganizer):
def executables(self):
return [
mobase.ExecutableInfo(
"Anomaly Launcher",
QFileInfo(self.gameDirectory(), "AnomalyLauncher.exe")
"Anomaly Launcher",
QFileInfo(self.gameDirectory(), "AnomalyLauncher.exe"),
),
mobase.ExecutableInfo(
"Anomaly (DX11-AVX)",
QFileInfo(self.gameDirectory(), "bin/AnomalyDX11AVX.exe")
"Anomaly (DX11-AVX)",
QFileInfo(self.gameDirectory(), "bin/AnomalyDX11AVX.exe"),
),
mobase.ExecutableInfo(
"Anomaly (DX11)",
QFileInfo(self.gameDirectory(), "bin/AnomalyDX11.exe")
"Anomaly (DX11)", QFileInfo(self.gameDirectory(), "bin/AnomalyDX11.exe")
),
mobase.ExecutableInfo(
"Anomaly (DX10-AVX)",
QFileInfo(self.gameDirectory(), "bin/AnomalyDX10AVX.exe")
"Anomaly (DX10-AVX)",
QFileInfo(self.gameDirectory(), "bin/AnomalyDX10AVX.exe"),
),
mobase.ExecutableInfo(
"Anomaly (DX10)",
QFileInfo(self.gameDirectory(), "bin/AnomalyDX10.exe")
"Anomaly (DX10)", QFileInfo(self.gameDirectory(), "bin/AnomalyDX10.exe")
),
mobase.ExecutableInfo(
"Anomaly (DX9-AVX)",
QFileInfo(self.gameDirectory(), "bin/AnomalyDX9AVX.exe")
"Anomaly (DX9-AVX)",
QFileInfo(self.gameDirectory(), "bin/AnomalyDX9AVX.exe"),
),
mobase.ExecutableInfo(
"Anomaly (DX9)",
QFileInfo(self.gameDirectory(), "bin/AnomalyDX9.exe")
"Anomaly (DX9)", QFileInfo(self.gameDirectory(), "bin/AnomalyDX9.exe")
),
mobase.ExecutableInfo(
"Anomaly (DX8-AVX)",
QFileInfo(self.gameDirectory(), "bin/AnomalyDX8AVX.exe")
"Anomaly (DX8-AVX)",
QFileInfo(self.gameDirectory(), "bin/AnomalyDX8AVX.exe"),
),
mobase.ExecutableInfo(
"Anomaly (DX8)",
QFileInfo(self.gameDirectory(), "bin/AnomalyDX8.exe")
)
"Anomaly (DX8)", QFileInfo(self.gameDirectory(), "bin/AnomalyDX8.exe")
),
]

def mappings(self) -> List[mobase.Mapping]:
self.gameDirectory().mkdir("appdata")

m = mobase.Mapping()
m.createTarget = True
m.isDirectory = True
m.source = self.gameDirectory().filePath("appdata")
m.destination = self.gameDirectory().filePath("appdata")
return [m]
return [m]
17 changes: 4 additions & 13 deletions games/game_thebindingofisaacrebirth.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# -*- encoding: utf-8 -*-

from PyQt5.QtCore import QDir, QFileInfo, QStandardPaths

from pathlib import Path

import mobase

from ..basic_game import BasicGame


Expand All @@ -20,11 +14,8 @@ class TheBindingOfIsaacRebirthGame(BasicGame):
GameNexusId = 1293
GameSteamId = 250900
GameBinary = "isaac-ng.exe"
GameDocumentsDirectory = str(Path(QStandardPaths.writableLocation(QStandardPaths.HomeLocation)).joinpath("Documents", "My Games", "Binding of Isaac Afterbirth+"))
GameDataPath = str(Path(QStandardPaths.writableLocation(QStandardPaths.HomeLocation)).joinpath("Documents", "My Games", "Binding of Isaac Afterbirth+ Mods"))


GameDocumentsDirectory = "%DOCUMENTS%/My Games/Binding of Isaac Afterbirth+"
GameDataPath = "%DOCUMENTS%/My Games/Binding of Isaac Afterbirth+ Mods"

def iniFiles(self):
return [
"options.ini"
]
return ["options.ini"]
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ deps =
flake8
flake8-black
commands =
black --check --diff setup.py deel tests
flake8 deel tests
black --check --diff .
flake8 .

0 comments on commit 41ac867

Please sign in to comment.