예제 #1
0
 def load_depot(self, depot_data):
     self.languages = depot_data["languages"] # TODO: normalize
     self.size = int(depot_data["size"])
     self.game_ids = [int(game_id) for game_id in depot_data["gameIDs"]]
     self.systems = [
         normalize_system(system) for system in depot_data["systems"]]
     self.manifest_name = depot_data["manifest"]
예제 #2
0
def parse_system_reqs(system_reqs):
    if not system_reqs:
        return None
    else:
        return {
            normalize_system(system): reqs
            for system, reqs in system_reqs.items()}
예제 #3
0
 def load_command(self, command_data):
     self.languages = command_data["languages"] # TODO: normalize
     self.executable = command_data["executable"]
     self.product_id = int(command_data["gameID"])
     self.systems = [
         normalize_system(system) for system in command_data["systems"]]
     self.argument = command_data["argument"]
예제 #4
0
 def load_command(self, command_data):
     if command_data["languages"]:
         self.language = normalize_language(command_data["languages"][0])
     else:
         self.language = None
     self.executable = command_data["executable"]
     self.product_id = int(command_data["gameID"])
     if command_data["systems"]:
         self.system = normalize_system(command_data["systems"][0])
     else:
         self.system = None
예제 #5
0
 def __init__(self, api, build_data):
     super().__init__(api)
     self.id = build_data["build_id"]
     self.product_id = int(build_data["product_id"])
     self.os = normalize_system(build_data["os"])
     self.branch = build_data["branch"]
     self.version_name = build_data["version_name"]
     self.tags = build_data["tags"]
     self.public = build_data["public"]
     self.date_published = build_data["date_published"]
     self.generation = build_data["generation"]
     self.link = build_data["link"]
     self.legacy_build_id = build_data.get("legacy_build_id", None)
예제 #6
0
 def load_depot(self, depot_data):
     self.languages = [
         normalize_language(lang) for lang in depot_data["languages"]
     ]
     if "size" in depot_data:
         self.size = int(depot_data["size"])
     else:
         self.size = None
     self.game_ids = [int(game_id) for game_id in depot_data["gameIDs"]]
     if depot_data["systems"]:
         self.system = normalize_system(depot_data["systems"][0])
     else:
         self.system = None
     self.manifest_name = depot_data["manifest"]
     self.manifest = DepotManifestV1(self.api, self.manifest_url)
예제 #7
0
 def load_repo(self, repo_data):
     self.base_product_id = int(repo_data["baseProductId"])
     self.client_id = repo_data["clientId"]
     self.client_secret = repo_data["clientSecret"]
     self.cloud_saves = repo_data["cloudSaves"]
     self.dependencies = repo_data.get("dependencies", None)
     self.depots = [
         DepotV2(self.api, depot_data)
         for depot_data in repo_data["depots"]]
     self.install_directory = repo_data["installDirectory"]
     self.offline_depot = DepotV2(self.api, repo_data["offlineDepot"])
     self.platform = normalize_system(repo_data["platform"])
     self.products = [
         RepositoryProductV2(self.api, product_data)
         for product_data in repo_data["products"]]
     self.tags = repo_data["tags"]
     assert repo_data["version"] == self.generation
예제 #8
0
def parse_systems(system_compat):
    return set(
        normalize_system(system)
        for system, supported in system_compat.items() if supported)