X-Git-Url: https://apps.delaporte.us/gitweb/dotfiles.git/blobdiff_plain/2a32bb7e4b3f9c902f90d7e80adbc7ff42737557..0fc62b2d25ef0fd50b74b2ed52028928a1e00544:/files/pc/tasks.py?ds=inline diff --git a/files/pc/tasks.py b/files/pc/tasks.py index 6e145b8..a6f0c05 100644 --- a/files/pc/tasks.py +++ b/files/pc/tasks.py @@ -6,12 +6,23 @@ import os 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') -BUDGET_URL = os.environ.get('BUDGET_URL') -CU_URL = os.environ.get('CU_URL') SCHOOL = f"{HOME}/School" -PAYROLL = f"{HOME}/Nanny.Payroll" + +expect_URLs = [ +'budget', +'cu', +'allowance' +] + + +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 def browse(c, url): c.run(f"librefox {url}", asynchronous=True) @@ -24,6 +35,15 @@ def code(c, path): def folder(c, path): c.run(f"nemo {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): @@ -71,8 +91,7 @@ def debug(c): @task def allowance(c): - browse(c, KIDS_ALLOWANCE_URL) - + browse(c, URLS['allowance']) @task def payroll(c): @@ -136,3 +155,10 @@ def budget(c): browse(c, CU_URL) +@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') + +