Skip to content

Instantly share code, notes, and snippets.

@jamesob
Created February 15, 2012 16:48
Show Gist options
  • Save jamesob/1837225 to your computer and use it in GitHub Desktop.
Save jamesob/1837225 to your computer and use it in GitHub Desktop.
Left the timer running in Harvest overnight...
#!/usr/bin/python
def hrs(curr_entry, left, started):
amt_sub = (24. - left) + started
return curr_entry - amt_sub
if __name__ == '__main__':
import sys
usage = (
"Usage:\n\n"
" ./harvover.py [yesterday's entry amount] "
"[time left yesterday] [time started today]\n"
" All times given on 24-hour scale in decimal.\n"
" Returns the correct amount for the entry you left running.\n"
)
if len(sys.argv) < 4:
print usage
else:
args = [float(a) for a in sys.argv[1:]]
print hrs(*args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment