erigones / Ludolph

Python Jabber Bot
Other
40 stars 7 forks source link

plugins version support #35

Closed ricco386 closed 9 years ago

ricco386 commented 9 years ago

Add ability for version command to support parameter for plugin name and return plugin version number so 3rd party plugins doesnt have to implement version command and can used built in one.

ricco386 commented 9 years ago

plugin creators just needs to add into instance of LudolphPlugin object variable __version__:

from sample_plugin import __version__

class SamplePlugin(LudolphPlugin):
    """
    Ludolph jabber bot sample plugin.
    """
    __version__ = __version__

updated sample in ludolph-skeleton: https://github.com/erigones/ludolph-skeleton/commit/dfa336c8b33cf017929ecb21874daa6defc55ade

Now jabber conversation will looks like this:

(04:45:10 PM) RicCo: version ludolph_skeleton.hello_world (04:45:10 PM) Ldlph: ludolph_skeleton.hello_world version: 1.3a

Updated wiki: https://github.com/erigones/Ludolph/wiki/How-to-create-a-plugin#plugin-versions