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

Commit

Permalink
Fixes from review and tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdmatters committed May 9, 2022
1 parent 422b044 commit 1976efc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nle/dataset/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def create(filename=DB):
c.execute(
"""CREATE TABLE meta
(
time REAL,
ctime REAL,
mtime REAL
)"""
)
Expand Down
7 changes: 7 additions & 0 deletions nle/dataset/populate_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ def altorg_filename_to_timestamp(filename):
ts = filename.split("/")[-1][:-11]
try:
ts = datetime.datetime.fromisoformat(ts)
except AttributeError:
# Python 3.6 doesnt have fromisoformat
this_date, this_time = ts.split(".")
this_date = [int(x) for x in this_date.split("-")]
this_time = [int(x) for x in this_time.split(":")]
this_datetime = this_date + this_time
ts = datetime.datetime(*this_datetime)
except ValueError:
logging.info("Skipping: '%s'" % filename)
return -1
Expand Down
2 changes: 1 addition & 1 deletion third_party/converter/converter.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Conversion *conversion_create(size_t rows, size_t cols, size_t term_rows,
size_t term_cols, int is_v2);
void conversion_set_buffers(Conversion *c, unsigned char *chars, size_t chars_size,
signed char *colors, size_t colors_size,
int16_t *curcurs, size_t curcurs_size,
int16_t *cursors, size_t cursors_size,
int64_t *timestamps, size_t timestamps_size,
unsigned char *inputs, size_t inputs_size);
int conversion_load_ttyrec(Conversion *c, FILE *f);
Expand Down

0 comments on commit 1976efc

Please sign in to comment.