Skip to content

Commit

Permalink
revert to autoinstall
Browse files Browse the repository at this point in the history
  • Loading branch information
jjshoots committed Feb 27, 2024
1 parent 700f14f commit 6ddc30a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@ homepage = "https://github.com/mgbellemare/Arcade-Learning-Environment"
documentation = "https://github.com/mgbellemare/Arcade-Learning-Environment/tree/master/docs"
changelog = "https://github.com/mgbellemare/Arcade-Learning-Environment/blob/master/CHANGELOG.md"

[project.scripts]
ale-accept-license-install-roms = "ale_py.roms:_download_roms"

[tool.setuptools]
packages = [
"ale_py",
Expand Down
19 changes: 10 additions & 9 deletions src/python/roms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import hashlib
import json
import tarfile
import time
import warnings
from pathlib import Path

Expand Down Expand Up @@ -84,17 +85,17 @@ def get_rom_path(name: str) -> Path | None:
warnings.warn(f"Rom {name} not supported.")
return None

if bin_path.exists():
# if the path exists, just return it
return bin_path
else:
# if it doesn't exist, prompt the user to download it, just quit here.
# if the bin_path doesn't exist, we assume the user already has the license and just download the roms
if not bin_path.exists():
print(
f"Looks like the rom {name} could not be found. "
"To install all roms, please run `ale-accept-license-install-roms` "
"to accept the license agreement and install all available roms."
f"Looks like the rom {name} could not be found, it may not have been downloaded. "
"\nWe will install all roms in the next 5 seconds, and we assume that you have accepted the license agreement beforehand. "
)
exit()
time.sleep(5)
_download_roms()

# return the path
return bin_path


def get_all_rom_ids() -> list[str]:
Expand Down

0 comments on commit 6ddc30a

Please sign in to comment.