X-Git-Url: https://us-delaporte.pagekite.me/gitweb/dotfiles.git/blobdiff_plain/0fc62b2d25ef0fd50b74b2ed52028928a1e00544..9183d83c72880a0f27ab63ce6dbb3156f7fb7624:/files/pc/tasks.py diff --git a/files/pc/tasks.py b/files/pc/tasks.py index a6f0c05..e2f786a 100644 --- a/files/pc/tasks.py +++ b/files/pc/tasks.py @@ -15,6 +15,11 @@ expect_URLs = [ 'allowance' ] +expect_PATHs = [ +'podcasts', +] + + URLS = {} for url in expect_URLs: @@ -24,6 +29,16 @@ for url in expect_URLs: 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) @@ -34,6 +49,7 @@ def code(c, path): def folder(c, path): c.run(f"nemo {path}") + c.run(f"dolphin {path}") @task def go(c, bookmark): @@ -94,16 +110,21 @@ def allowance(c): browse(c, URLS['allowance']) @task -def payroll(c): - - allowance(c) - +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) + payroll_folders(c) # For editing files - folder_payroll(c) + code(c, f"{PAYROLL}") payroll_jupyter(c) @task @@ -112,10 +133,6 @@ def payroll_jupyter(c): # 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): @@ -151,8 +168,8 @@ def mod_luanti(c): @task def budget(c): - browse(c, BUDGET_URL) - browse(c, CU_URL) + browse(c, URLS['budget']) + browse(c, URLS['cu']) @task @@ -162,3 +179,7 @@ def get_drive_info(c): c.run('ls /dev/disk/by-label') +@task +def podcasts(c): + folder(c, PATHS['podcasts']) +