]> us-delaporte.pagekite.me Git - dotfiles.git/blobdiff - files/pc/tasks.py
Fixup Ollama Django
[dotfiles.git] / files / pc / tasks.py
index 6e145b8c0f478d8eaeff121519afca600b032c18..e2f786ad5be13ce993c1803133df9bc65ad4f217 100644 (file)
@@ -6,12 +6,38 @@ import os
 
 HOME = os.path.expanduser('~')
 TODAY = dt.now().strftime('%Y.%m.%d')
 
 HOME = os.path.expanduser('~')
 TODAY = dt.now().strftime('%Y.%m.%d')
-KIDS_ALLOWANCE_URL=os.environ.get('KIDS_ALLOWANCE_URL')
 PAYROLL = os.environ.get('PAYROLL')
 PAYROLL = os.environ.get('PAYROLL')
-BUDGET_URL = os.environ.get('BUDGET_URL')
-CU_URL = os.environ.get('CU_URL')
 SCHOOL = f"{HOME}/School"
 SCHOOL = f"{HOME}/School"
-PAYROLL = f"{HOME}/Nanny.Payroll"
+
+expect_URLs = [
+'budget',
+'cu',
+'allowance'
+]
+
+expect_PATHs = [
+'podcasts',
+]
+
+
+
+URLS = {}
+for url in expect_URLs:
+    key = f'URL_{url.upper()}'
+    result = os.environ.get(key)
+    if not result:
+        raise ValueError(f'Missing expected {key} in environment.')
+    URLS[url] = result
+
+
+PATHS = {}
+for path in expect_PATHs:
+    key = f'PATH_{path.upper()}'
+    result = os.environ.get(key)
+    if not result:
+        raise ValueError(f'Missing expected {key} in environment.')
+    PATHS[path] = result
+
 
 def browse(c, url):
     c.run(f"librefox {url}", asynchronous=True)
 
 def browse(c, url):
     c.run(f"librefox {url}", asynchronous=True)
@@ -23,7 +49,17 @@ def code(c, path):
 
 def folder(c, path):
     c.run(f"nemo {path}")
 
 def folder(c, path):
     c.run(f"nemo {path}")
+    c.run(f"dolphin {path}")
 
 
+@task
+def go(c, bookmark):
+    var = f'URL_{bookmark.upper()}'
+    url = os.environ.get(var)
+    browse(c, url)
+
+@task
+def cloud_panel(c):
+    go(c, 'cloud')
 
 @task
 def debug(c):
 
 @task
 def debug(c):
@@ -71,20 +107,24 @@ def debug(c):
 
 @task
 def allowance(c):
 
 @task
 def allowance(c):
-    browse(c, KIDS_ALLOWANCE_URL)
+    browse(c, URLS['allowance'])
+
+@task
+def payroll_folders(c):
+    # For copying the latest file in
+    folder(c, f"{HOME}/pixel7adocuments")
+    folder(c, f"{PAYROLL}/data/payroll_inbox")
+    folder(c, f"{PAYROLL}")
 
 
 @task
 def payroll(c):
 
     allowance(c)
 
 
 @task
 def payroll(c):
 
     allowance(c)
-
-    # For copying the latest file in
-    folder(c, f"{HOME}/pixel7adocuments")
-    folder(c, f"{PAYROLL}/data/payroll_inbox")
+    payroll_folders(c)
 
     # For editing files
 
     # For editing files
-    folder_payroll(c)
+    code(c, f"{PAYROLL}")
     payroll_jupyter(c)
 
 @task
     payroll_jupyter(c)
 
 @task
@@ -93,10 +133,6 @@ def payroll_jupyter(c):
     # For running the payroll scripts
     c.run(f"cd {PAYROLL};{HOME}/envs/jupyter/bin/jupyter-lab")
 
     # For running the payroll scripts
     c.run(f"cd {PAYROLL};{HOME}/envs/jupyter/bin/jupyter-lab")
 
-@task
-def folder_payroll(c):
-    code(c, f"{PAYROLL}")
-
 
 @task()
 def screenshare(c):
 
 @task()
 def screenshare(c):
@@ -132,7 +168,18 @@ def mod_luanti(c):
 
 @task
 def budget(c):
 
 @task
 def budget(c):
-    browse(c, BUDGET_URL)
-    browse(c, CU_URL)
+    browse(c, URLS['budget'])
+    browse(c, URLS['cu'])
 
 
 
 
+@task
+def get_drive_info(c):
+    # List non-squash, non-tmp drives.
+    c.run('df -x squashfs -x tmpfs')
+    c.run('ls /dev/disk/by-label')
+
+
+@task
+def podcasts(c):
+    folder(c, PATHS['podcasts'])
+