-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #486 from ihabunek/diag
Added 'toot diag' command that outputs useful diagnostic info
- Loading branch information
Showing
4 changed files
with
109 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[flake8] | ||
exclude=build,tests,tmp,venv,toot/tui/scroll.py | ||
exclude=build,tests,tmp,venv,_env,toot/tui/scroll.py | ||
ignore=E128,W503,W504 | ||
max-line-length=120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import click | ||
from toot import api | ||
from toot.output import print_diags | ||
from toot.cli import ( | ||
cli, | ||
pass_context, | ||
Context, | ||
) | ||
|
||
|
||
@cli.command() | ||
@click.option( | ||
"-f", | ||
"--files", | ||
is_flag=True, | ||
help="Print contents of the config and settings files in diagnostic output", | ||
) | ||
@click.option( | ||
"-s", | ||
"--server", | ||
is_flag=True, | ||
help="Print information about the curren server in diagnostic output", | ||
) | ||
@pass_context | ||
def diag(ctx: Context, files: bool, server: bool): | ||
"""Display useful information for diagnosing problems""" | ||
|
||
instance_dict = api.get_instance(ctx.app.base_url).json() if server else None | ||
print_diags(instance_dict, files) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters