mirror of
https://github.com/ihabunek/toot.git
synced 2024-09-29 04:35:54 -04:00
Added config and settings file output to toot diag
This commit is contained in:
parent
ded6ec98bc
commit
df98705627
@ -325,7 +325,31 @@ def print_diags():
|
|||||||
|
|
||||||
from toot import __version__, config, settings
|
from toot import __version__, config, settings
|
||||||
click.echo(f'{green(f"Toot version:")} {__version__}')
|
click.echo(f'{green(f"Toot version:")} {__version__}')
|
||||||
|
|
||||||
|
click.echo(f'{green(f"Settings path:")} {settings.get_settings_path()}')
|
||||||
|
click.echo(f'{green(f"Settings file contents:")}')
|
||||||
|
try:
|
||||||
|
with open(settings.get_settings_path(), 'r') as f:
|
||||||
|
print(f.read())
|
||||||
|
except: # noqa
|
||||||
|
click.echo(f'{yellow(f"Could not open settings file")}')
|
||||||
|
|
||||||
|
click.echo('')
|
||||||
|
|
||||||
|
click.echo(f'{green(f"Config path:")} {config.get_config_file_path()}')
|
||||||
|
click.echo(f'{green(f"Config file contents:")}')
|
||||||
|
try:
|
||||||
|
with open(config.get_config_file_path(), 'r') as f:
|
||||||
|
for line in f:
|
||||||
|
if "client_" not in line and "token" not in line:
|
||||||
|
click.echo(line, nl=False)
|
||||||
|
else:
|
||||||
|
click.echo(f'{yellow("***LINE REDACTED***")}')
|
||||||
|
except: # noqa
|
||||||
|
click.echo(f'{yellow(f"Could not open config file")}')
|
||||||
|
|
||||||
|
click.echo('')
|
||||||
|
|
||||||
import platform
|
import platform
|
||||||
click.echo(f'{green(f"Platform:")} {platform.platform()}')
|
click.echo(f'{green(f"Platform:")} {platform.platform()}')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user