def __init__(self, appmanifest_path): self.appmanifest_path = appmanifest_path self.steamapps_path, filename = os.path.split(appmanifest_path) self.steamid = re.findall(r'(\d+)', filename)[-1] if os.path.exists(appmanifest_path): with open(appmanifest_path, "r") as appmanifest_file: self.appmanifest_data = vdf_parse(appmanifest_file, {})
def __init__(self, appmanifest_path): self.appmanifest_path = appmanifest_path self.steamapps_path, filename = os.path.split(appmanifest_path) self.steamid = re.findall(r'(\d+)', filename)[-1] if os.path.exists(appmanifest_path): with open(appmanifest_path, "r") as appmanifest_file: self.appmanifest_data = vdf_parse(appmanifest_file, {})
def __init__(self, appmanifest_path): self.appmanifest_path = appmanifest_path self.steamapps_path, filename = os.path.split(appmanifest_path) self.steamid = re.findall(r'(\d+)', filename)[-1] self.appmanifest_data = {} if path_exists(appmanifest_path): with open(appmanifest_path, "r") as appmanifest_file: self.appmanifest_data = vdf_parse(appmanifest_file, {}) else: logger.error("Path to AppManifest file %s doesn't exist", appmanifest_path)
def _get_installed_steamapps(runner): """Return a list of appIDs of the installed Steam games.""" if not runner.is_installed(): return [] installed = [] dirs = runner.get_steamapps_dirs() for dirname in dirs: appmanifests = [f for f in os.listdir(dirname) if re.match(r"^appmanifest_\d+.acf$", f)] for filename in appmanifests: basename, ext = os.path.splitext(filename) steamid = int(basename[12:]) appmanifest_path = os.path.join(dirname, "appmanifest_%s.acf" % str(steamid)) with open(appmanifest_path, "r") as appmanifest_file: appmanifest = vdf_parse(appmanifest_file, {}) appstate = appmanifest.get("AppState") or {} is_installed = appstate.get("LastOwner") or "0" if not is_installed == "0": installed.append(steamid) return installed
def _get_installed_steamapps(runner): """Return a list of appIDs of the installed Steam games.""" if not runner.is_installed(): return [] installed = [] dirs = runner.get_steamapps_dirs() for dirname in dirs: appmanifests = [f for f in os.listdir(dirname) if re.match(r'^appmanifest_\d+.acf$', f)] for filename in appmanifests: basename, ext = os.path.splitext(filename) steamid = int(basename[12:]) appmanifest_path = os.path.join( dirname, "appmanifest_%s.acf" % str(steamid) ) with open(appmanifest_path, "r") as appmanifest_file: appmanifest = vdf_parse(appmanifest_file, {}) appstate = appmanifest.get('AppState') or {} is_installed = appstate.get('LastOwner') or '0' if not is_installed == '0': installed.append(steamid) return installed