INNER CODE UNIT · Python

_get_games_path

TacticalMetaphysics/Lisien · elide/elide/app.py:156

	def _get_games_path(self):
		return Path(self.prefix).joinpath(self.games_dir)

	def _set_games_path(self, str_or_pair: str | tuple[str, str]):
		if isinstance(str_or_pair, str):
			a, b = os.path.split(str_or_pair)
		elif isinstance(str_or_pair, Path):
			if not str_or_pair.is_dir():
				raise NotADirectoryError(str_or_pair)
			a = str_or_pair.parent
			b = str_or_pair.name
		else:
			a, b = str_or_pair
		self.prefix, self.games_dir = a, b

	games_path = AliasProperty(
		_get_games_path, _set_games_path, bind=("prefix", "games_dir")
	)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…