Quote:
Originally Posted by JimmXinu
I've never done a template function before, so it's entirely possible I'm breaking rules for one or over-complicating it, but this is my version that can optionally return name or uuid for main, carda or cardb; defaulting to main and name.
|
The function breaks no rules that I know of. The most important rule is that the function is read-only vis-a-vis the database. Next is that the function doesn't try to keep static data. Yours doesn't break either of these.
The "not dm.is_device_present" doesn't prevent the bug where stale information is shown. The 'real' fix requires a change to gui2/device.py
What would someone do with the UUID in a template? In my original function I added it to the list, but after reflection I don't see use for it. And if you provide that, why not the path, the prefix, or the free space?