]> apps.delaporte.us Git - dotfiles.git/blobdiff - files/pc/tasks.py
Update babysitting scripts
[dotfiles.git] / files / pc / tasks.py
index ed127765b4ce5d3c8b87f3986d9f81889a7a3b82..edaf571855c478bbf0cef03a932486812dd426ba 100644 (file)
@@ -1,9 +1,27 @@
+
+
+# This file is meant to sit in ~ for use from all shells.
 from invoke import task
 
-import datetime
+from datetime import datetime as dt
 import os
 
 HOME = os.path.expanduser('~')
+TODAY = dt.now().strftime('%Y.%m.%d')
+
+KIDS_ALLOWANCE_URL=os.environ.get('KIDS_ALLOWANCE_URL')
+
+def browse(c, url):
+    c.run(f"librefox {url}", asynchronous=True)
+
+
+def code(c, path):
+    c.run(f"codium {path}")
+
+
+def folder(c, path):
+    c.run(f"nemo {path}")
+
 
 @task
 def debug(c):
@@ -13,6 +31,21 @@ def debug(c):
 PAYROLL = f"{HOME}/Nanny.Payroll"
 
 @task
+def folder_payroll(c):
+    code(c, f"{HOME}/Nanny.Payroll")
+
+@task
+def folder_allowance(c):
+    browse(c, KIDS_ALLOWANCE_URL)
+
+
+@task(folder_payroll)
 def payroll(c):
+
+    # For copying the latest file in
+    folder(c, f"{HOME}/pixel7adocuments")
+    folder(c, f"{HOME}/Nanny.Payroll/data/payroll_inbox")
+
+    # For running the payroll scripts
     c.run(f"cd {PAYROLL};{HOME}/envs/jupyter/bin/jupyter lab")
-    print('Payroll')
+