Open dgw opened 11 months ago
Here's a small patch to version
that would implement the desired behavior, although it relies on accessing Sopel._plugins
directly, so it will need some support work to do it the Right Way™, either adding the modification time to the plugin metadata or adding a mechanism for retrieving the plugin from the bot.
Output before patch:
15:40 <testibot> [version] 8ball (unknown)
15:40 <SnoopJ> !reload version
Output after patch:
15:40 <SnoopJ> !version 8ball
15:40 <testibot> [version] 8ball (unknown) — last modified 02 Apr 2023
(note: I prefer using %b
where possible to avoid possible confusion over date order but I don't feel super strongly about that, it could just as easily be %Y.%m.%d
)
One can
.version pluginname
for any loaded plugin, but e.g. a single-file module stored in~/.sopel/plugins/pluginname.py
will simply return[version] pluginname (unknown)
if it doesn't contain a__version__
member.I propose that, at least for single-file plugins, the plugin machinery should fall back on the file modification timestamp in lieu of a version number.* It'd probably be reasonable to format the file's modification time as
yyyy.mm.dd
, and ignore hours or smaller units.**