Created
February 15, 2012 16:48
-
-
Save jamesob/1837225 to your computer and use it in GitHub Desktop.
Left the timer running in Harvest overnight...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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