New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a !plugin info admin command. #1226

Merged
merged 2 commits into from Oct 19, 2018

Conversation

Projects
None yet
2 participants
@gbin
Member

gbin commented May 26, 2018

The command allows you to get the all the states, namespaces, log etc...
from a plugin.

@gbin gbin requested review from zoni and sijis May 26, 2018

@wafflebot wafflebot bot assigned gbin May 26, 2018

@wafflebot wafflebot bot added the in progress label May 26, 2018

@sijis

This comment has been minimized.

Contributor

sijis commented May 30, 2018

You seem to be missing a docstring :)

• .plugin info - (undocumented)

It seems to fail if the plugin is disabled:

[@saviles ➡ @zombie] >>> .plugin info VersionChecker
Computer says nooo. See logs for details:
'NoneType' object has no attribute 'keys'

I like this very much!!

A couple of things that may need adjustment

  1. log destination: errbot.plugins.Health - I'm not sure what log destination means in this context. I'm guessing is the logging module reference. At first glance i was expecting a log file. So in short, this is a little confusing
  2. I wonder if having the .plug path as a separate item (like full_module_path) makes thing more uniform.
Plugin info
 name: Health
 module: health
 full_plug_path: /home/saviles/data/git/github/errbot/errbot/core_plugins/health.plug
 full_module_path: /home/saviles/data/git/github/errbot/errbot/core_plugins/health.py
...

@botcmd(admin_only=True, template='plugin_info')
def plugin_info(self, _, args):
pm = self._bot.plugin_manager

This comment has been minimized.

@sijis

sijis May 30, 2018

Contributor

Need docstring.

This comment has been minimized.

@gbin

gbin Oct 19, 2018

Member

done

@sijis

This comment has been minimized.

Contributor

sijis commented May 30, 2018

Ohh, also noticed that storage content is always showing

 storage content
┏━━━━━┳━━━━━━━┓
┃ Key ┃ Value ┃
┡━━━━━╇━━━━━━━┩
│     │       │
└─────┴───────┘

gbin added some commits May 26, 2018

Added a !plugin info admin command.
The command allows you to get the all the states, namespaces, log etc...
from a plugin.

@gbin gbin force-pushed the plugin-info branch from 5494716 to d2e8c09 Oct 19, 2018

@gbin

This comment has been minimized.

Member

gbin commented Oct 19, 2018

ha because it is empty, this is cosmetic
once your plugin wrote something in its storage you see something there
[@gbin@errbot] >>> !plugin info Poll
Plugin info from /home/gbin/projects/err-plugins/err-poll/poll.plug
name: Poll
module: poll
full_module_path: /home/gbin/projects/err-plugins/err-poll/poll.py
core: False
class: errbot.plugins.poll.Poll
storage namespace: Poll
log destination: errbot.plugins.Poll
log level: NOTSET
storage content
┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Key ┃ Value ┃
┡━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ current_poll │ hey │
├──────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────┤
│ polls │ {'hey': <errbot.plugins.poll.PollEntry object at 0x7f24a6df0e10>} │
└──────────────┴─────────────────────────────────────────────────────────────────────────────────────────────────┘

@gbin gbin merged commit c4ae3d1 into master Oct 19, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@wafflebot wafflebot bot removed the in progress label Oct 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment