aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSan Jacobs2021-12-06 11:57:10 +0100
committerSan Jacobs2021-12-06 11:57:10 +0100
commite6d4675539d7b5eba382652d253dc68123a92eb2 (patch)
treeedbc4f12846a8d791bc82fc12b65c9f62aac3e33
parent563f4b5fa8bb88b10bed19c8833c0e9f8f2ddb2a (diff)
downloadsatscalc-e6d4675539d7b5eba382652d253dc68123a92eb2.tar.gz
satscalc-e6d4675539d7b5eba382652d253dc68123a92eb2.tar.bz2
satscalc-e6d4675539d7b5eba382652d253dc68123a92eb2.zip
Removed old stuff and started on new stuff
-rwxr-xr-xsatscalc.py35
1 files changed, 14 insertions, 21 deletions
diff --git a/satscalc.py b/satscalc.py
index 60a7cf3..c05d232 100755
--- a/satscalc.py
+++ b/satscalc.py
@@ -1,27 +1,13 @@
#!usr/bin/env python3
import datetime
-# NOTE: Maybe the whole thing should be re-thought to actually prompt for date.
-# That way you can easily fill in a calendar of sorts, which is much easier to loop through and calculate what hours were overtime etc.
-# This can probably be done with some smarts, which assume that if you start at 08:00, 07:00 doesn't mean the same day.
-# Meaning you only need to prompt for the date of the call time, not the date of the wrap time.
-# This will also automatically let you know if it was a weekend and stuff like that.
-
-# TODO: Prompt user for base rate, call time, wrap time, whether overtime was warned, and if it was a weekend.
-# This should be enough to calculate the pay for a single day's work.
-
-# These accumulate gradually as you enter hours
-normal_hours = 0.0
-ot1_hours = 0.0
-ot2_hours = 0.0
-ot3_hours = 0.0
-
-baserate = int(input("What's your base dayrate (sats)? "))
-hourly_rate = baserate/7.5
-
-print("Hourly rate:", str(hourly_rate))
-
-print("\nTime to add your hours of work.")
+class workday:
+ def __init__(self, calltime, wraptime, ot_warned=True, warned_until=wraptime):
+ self.call = calltime
+ self.wrap = wraptime
+ self.otw = ot_warned
+ self.ott = warned_until
+
def timeInput(prompt, fulldate=False):
@@ -50,6 +36,13 @@ def floatify(hour, minutes):
# Turns hour and minute into a single float that is easier to do math with
return float(hour+(minutes/60.0))
+baserate = int(input("What's your base dayrate (sats)? "))
+hourly_rate = baserate/7.5
+
+print("Hourly rate:", str(hourly_rate))
+
+print("\nTime to add your hours of work.")
+
# --- Data gathering loop ---
while True: