Skip to content
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

Nice help #662

Closed
wants to merge 2 commits into from
Closed

Nice help #662

wants to merge 2 commits into from

Conversation

qsantos
Copy link

@qsantos qsantos commented Nov 23, 2014

A nicer and more intuitive help function

@elad661 elad661 self-assigned this Nov 24, 2014
@elad661
Copy link
Contributor

elad661 commented Nov 24, 2014

Since you didn't touch reload, reloading/loading modules won't change the help. Wouldn't it be better to have module loading update a dict of help messages instead of making the modules available at runtime and iterating on them?

@elad661
Copy link
Contributor

elad661 commented Nov 24, 2014

Overall, looks good. Apart from my minor nitpicks above (note they refer to specific lines) and the reload/load thing, it's almost good to be merged.

It's really awesome and it will greatly improve the user experience of the bot.

@qsantos
Copy link
Author

qsantos commented Nov 25, 2014

Thanks for the comments, I'll look into that.

I was assuming a particular list of mods, but obviously, ensure the presence of a space is easy. I tried combining spaces for CLI clients and '\t' for GUI clients, but '\t' appears weird in CLI (in my case irssi shows an "I" on white background).

I am fixing the situation for module loading anyway.

@elad661
Copy link
Contributor

elad661 commented Nov 26, 2014

No, sorry, load() and unload() is not something we want. When I talked about reloading module I talked about reload.py that is in the modules directory. This just overcomplicates everything and makes it harder to review.

We don't want an unload method because there's no real safe way to unload things and having such method might cause miscommunications about it. Even reload is presented as "it might work, but in some cases it will be buggy and you'd have to restart".

@elad661
Copy link
Contributor

elad661 commented Nov 26, 2014

Let me rephrase the requirements for this to be merged, just so it'll be clear:

  1. no unload() or load() methods in core.
  2. have some dict in bot.py to keep track of the help messages & module categories
  3. bot.register() and bot.unregister() should handle updating said dict.
  4. Don't make list of modules available at runtime unless there's a good reason for it.
  5. Focus on the help feature in this pull request. removing code duplication from module loading is a possible thing that can be done, but in a separate pull request

@elad661
Copy link
Contributor

elad661 commented Dec 19, 2014

I want this in for 5.0... Are you going to work on this or should I do it myself?

@embolalia
Copy link
Contributor

@qsantos are you going to address the above?

@qsantos
Copy link
Author

qsantos commented Feb 19, 2015

Sorry for the long wait. I have removed the commits that were off-topic and use a dictionnary of available commands per module instead of a dictionnary of modules.

Also, *register() takes the list of symbols as a parameter whereas I need the module name. I have thus added *register_help() which just takes the module. An alternative would be to change *register() so that they take a module as a parameter.

@elad661 elad661 assigned embolalia and unassigned elad661 Feb 19, 2015
@embolalia embolalia closed this in 1252d5c Aug 29, 2015
@embolalia
Copy link
Contributor

@qsantos: Sorry for leaving this open for so long. The change has been implemented and will be in 6.0. Thanks for the contribution.

fatalis pushed a commit to fatalis/sopel that referenced this pull request Jan 7, 2016
Close sopel-irc#662, close sopel-irc#791. They needed to be reworked to deal with the new
6.0 loader. Same general idea, so thanks to @qsantos and @firerogue for
their work there. Eventually, I'd like to open up that category to be
settable to something other than the module name, but I'm not sure how I
want to do that so we'll leave it as an undocumented little private hack
for now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants