Skip to content

Commit

Permalink
Display of data age in update command
Browse files Browse the repository at this point in the history
  • Loading branch information
kfsone committed Feb 26, 2015
1 parent fd635ae commit 2a213ea
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions commands/update_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,19 @@ def guidedUpdate(tdb, cmdenv):
stationID = cmdenv.startStation.ID
tmpPath = getTemporaryPath(cmdenv)

cur = tdb.query("""
SELECT JULIANDAY('now') - JULIANDAY(MIN(modified)),
JULIANDAY('now') - JULIANDAY(MAX(modified))
FROM StationItem
WHERE station_id = ?
""", [stationID])
oldest, newest = cur.fetchone()
if oldest and newest:
cmdenv.NOTE(
"Current data {:.2f}-{:.2f} days old.",
oldest, newest,
)

from commands.update_gui import render
try:
render(tdb, cmdenv, tmpPath)
Expand Down

0 comments on commit 2a213ea

Please sign in to comment.