Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[wip-ish] Make click package optional#26

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
alberth wants to merge1 commit intoigordejanovic:master
base:master
Choose a base branch
Loading
fromalberth:unglue-clicker

Conversation

@alberth
Copy link
Contributor

@alberthalberth commentedFeb 7, 2018
edited
Loading

Not sure how you feel about this, if you don't like it, that's fine, I'll hack it locally then.

While the dominant use-case for a parser is in a batch-oriented program that you run from the command line, parsers are also used in other contexts. One big example is running in the background of an editor as compiler frontend to give GUI feedback while the user is editing. In my case, I intend to use your parser at a web server, as a compile service.

There is no "unix command-line" inside a web server (or an editor). I don't want to install 'click' at the server, as it's completely useless in that environment. If I want fancy coloured and formatted output (and I am far from sure about that currently), it would need to be HTML rather than some terminal escape sequences, or the web client can't display it.

Not installing 'click' currently breaks the parser, due to aparser -> exceptions -> termui -> click import chain. This patch make the final link optional, by allowing the click import to fail, which then falls back to standard Python stuff.

I have not tested this extensively yet, since I am still in the process of getting the grammar figured out and attaching actions to it. I thought it to be wise to ask you about this early in the process. If you are not interested, I will just hack a local patch until it works for me.

There is at least one other thing that looks scary to me, all the styled messages in the exceptions. I'll have to test how that behaves, but I need a working grammar/compiler for that first.

One possible direction can be to make exception objects just store the exceptions (and nothing else), and have a separateparglare.pretty_print module, that canpretty_print(my_exception). Slightly less nice thanprint(str(my_exception)) but more useful in environments that have no unix terminal.

@coveralls
Copy link

coveralls commentedFeb 7, 2018
edited
Loading

Coverage Status

Coverage decreased (-0.09%) to 85.1% when pullingaa60618 on alberth:unglue-clicker intodb66177 on igordejanovic:master.

@igordejanovic
Copy link
Owner

@alberth I fully agree with this. click is usable only during development and should not be required at all during run-time. I agree also with messages in exceptions. I've been bitten by this in several occasions and was planning to rework that part. Please, feel free to hack on that.

@alberth
Copy link
ContributorAuthor

As parglare doesn't look like the answer to my problem (I am fighting the parser and not the problem I am supposed to solve), and I can't afford to trying to make it work longer, I have to switch to a different more manual solution. As such, I won't work on this problem in the near future.

@igordejanovic
Copy link
Owner

No problem. Thanks for stopping by and for all your contributions.

@GabDugGabDug mentioned this pull requestJul 12, 2022
7 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@alberth@coveralls@igordejanovic

[8]ページ先頭

©2009-2025 Movatter.jp