Logs for #nikola for 2021-02-04

10:05:45 <cipherrot> Hey folks, seems like a quiet channel but I hope there are humans around to answer questions! :)
10:07:19 <cipherrot> Is there a sane way to ensure a command (or Python function) is run once after every build (e.g. `nikola build` or each time `nikola auto` triggers a rebuild)?
10:09:11 <cipherrot> Specifically, I need to fix a few permissions of files in my output folder because they're being copied from a location where they're read-only. `utils.copy_tree` uses `shutils.copy2` which preserves permissions, so I end up with errors because any subsequent build fails to overwrite the read-only files in `OUTPUT_FOLDER`
15:30:26 <petrichor> Huh, well that's a bit annoying, freenode webchat kept disconnecting me, so I'll have to wait until tomorrow to check the logs and see if anyone answered my question 🤦
15:30:44  * petrichor is also cipherrot
15:46:19 <felixfontein> nikola uses blinker to emit events, that plugins can listen to. I'd guess there is an event for 'build is done' (I never checked so I can't say for sure), so you could create a small plugin which listens for that event.
15:46:46 <felixfontein> (and nobody answered so far, so you didn't miss anything :) )
15:53:24 <petrichor> Cool, thanks!
15:58:22 <felixfontein> yw
16:04:44 <petrichor> Hmm, doesn't look like there's a signal emitted at the right point
16:07:38 <petrichor> I also tried a `TaskMultiplier` plugin yesterday, but for some reason (presumably dependency-related) the extra tasks for the `copy_asset` tasks were never executed.
17:05:45 <petrichor> Which is here: https://gitlab.com/-/snippets/2071360
17:06:30 <petrichor> `FixPerms.process()` gets called for every other task, as expected, and generates a new task for anything that creates files, including `copy_assets`
17:06:57 <petrichor> But then the tasks derived from e.g. `render_site` get run but the ones derived from `copy_assets` never do.
17:15:54 <felixfontein> did you add a proper dependency, like here: https://github.com/getnikola/nikola/blob/master/nikola/plugins/task/gzip.py#L65 ?
17:16:15 <felixfontein> (sorry, your gitlab link doesn't work on this machine, don't want to configure all that javascript needed to look at it now)
17:20:35 <petrichor> Yup, I have `chmod_task['file_dep'].append(target)` for every `target` of the original task, and my messy debugging print statements show that the right files under `public/assets/*` are getting added as dependencies
17:21:00 <petrichor> Is there a pastebin-type site that will work for you?
17:22:42 <felixfontein> everything that doesn't require JS to look at the result :D
17:23:30 <felixfontein> IIRC there's a nikola cli command which allows you to inspect generated tasks, that might help you
17:26:01 <petrichor> Hehe, no worries. I'm increasingly using emacs to browse the web. Way less distracting.
19:16:02 <KwBot> [nikola-netlify-cms] Kwpolska closed pull request #20 (getnikola:dependabot/pip/bleach-3.3.0): Bump bleach from 3.2.1 to 3.3.0 https://github.com/getnikola/nikola-netlify-cms/pull/20