Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Commit

Permalink
Add an exists method (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdmatters authored Jun 9, 2022
1 parent e24aac5 commit d19075c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nle/dataset/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ def db(conn=None, filename=DB, new=False, rw=None, **kwargs):
conn.close()


def exists(filename=DB):
return os.path.exists(filename)


def connect(filename=DB, new=False, rw=None, **kwargs):
assert new ^ os.path.exists(filename)
if not new and not rw:
Expand Down

0 comments on commit d19075c

Please sign in to comment.