Skip to content

Commit

Permalink
Merge pull request #26 from RTIInternational/fix-interactive-windows
Browse files Browse the repository at this point in the history
Fix Unix-specific code to get directory creation time
  • Loading branch information
pmbaumgartner authored Sep 1, 2020
2 parents 8403c52 + 4717ac9 commit 2f4f6ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion gobbli/interactive/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,13 @@ def format_task(task_dir: Path) -> str:
String-formatted, human-readable task metadata.
"""
task_id = task_dir.name
task_creation_time = dt.datetime.fromtimestamp(task_dir.stat().st_birthtime)
try:
# Should work on OS X, Linux
task_creation_ts = task_dir.stat().st_birthtime
except AttributeError:
# Should work on Windows
task_creation_ts = task_dir.stat().st_ctime
task_creation_time = dt.datetime.fromtimestamp(task_creation_ts)
return f"{task_id[:5]} - Created {task_creation_time.strftime('%Y-%m-%d %H:%M:%S')}"


Expand Down
2 changes: 1 addition & 1 deletion meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"download_url": "",
"author": "RTI International",
"maintainer": "Jason Nance",
"version": "0.2.2",
"version": "0.2.3",
"description": "Uniform interface to deep learning approaches via Docker containers."
}

0 comments on commit 2f4f6ab

Please sign in to comment.