Created
September 15, 2010 10:18
-
-
Save richardlehane/580526 to your computer and use it in GitHub Desktop.
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
class PunchCard: | |
hourly_rate = 47.82 | |
notify_interval = 3600.0 | |
shift_start = 0 | |
lunch_start = 0 | |
lunch_mins = 0 | |
timer = 0 | |
def calculate_cost(): | |
start = to_mins(shift_start) | |
now = to_mins(rounded_time()) | |
mins = start - now - self.lunch | |
cost = dbl(hourly_rate/60 * mins) | |
def trigger_lunch(): | |
if self.lunch_start: | |
else: | |
self.lunch_start = self.rounded_time() | |
def notify() | |
def trigger_notify(): | |
if self.timer: | |
self.timer = 0 | |
else: | |
notify() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment