GithubHelp home page GithubHelp logo

Comments (7)

attzonko avatar attzonko commented on August 30, 2024 1

I am fine leaving it as is....its a side effect of 'click' :)

from mmpy_bot.

unode avatar unode commented on August 30, 2024

Hi @sw-dbrown this was fixed in f6d8b98 which hasn't been released yet. Would you mind trying the latest version from the main branch and see if the problem persists?

from mmpy_bot.

sw-dbrown avatar sw-dbrown commented on August 30, 2024

Hey @unode, thanks for the very fast response. I just manually applied the patch in my venv and I can confirm that the issue is fixed in f6d8b98. Is it intended behavior that the output of the --help command is also sent to the log of the bot?

Hi @sw-dbrown this was fixed in f6d8b98 which hasn't been released yet. Would you mind trying the latest version from the main branch and see if the problem persists?

from mmpy_bot.

unode avatar unode commented on August 30, 2024

Not intended but harder to control as it's pre-defined behavior in click.
There may be a workaround but the crash was the most important part.

Either way, I would discourage the use of --help as we can't easily control the content of the output.

from mmpy_bot.

unode avatar unode commented on August 30, 2024

I had a second look at the code and we could use:

with contextlib.redirect_stdout(io.StringIO()):
    ctx = self.function.make_context(
        info_name=self.plugin.__class__.__name__, args=list(args)
    )

at

ctx = self.function.make_context(

but I don't like this solution. It could accidentally discard other messages which would make it painful to debug.

I also don't think that filtering out --help from args is a good solution.

Any other from those in this thread? I'm tempted to close this issue as-is without additional patches.

from mmpy_bot.

attzonko avatar attzonko commented on August 30, 2024

So the remaining issue is that with plugins which use 'click' functions, when the plugin gets the '--help' command, the output shows up in the channel and also in the log?

from mmpy_bot.

unode avatar unode commented on August 30, 2024

Output is sent to stdout stream, not really the log.

from mmpy_bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.