1
0
mirror of https://github.com/ihabunek/toot synced 2024-12-22 23:08:17 +01:00

Move imports to top

This commit is contained in:
Ivan Habunek 2024-08-12 09:12:09 +02:00
parent 93cfe2af75
commit 7e09c0b387
No known key found for this signature in database
GPG Key ID: 01DB3DD0D824504C

View File

@ -1,13 +1,18 @@
import click import click
import platform
import re import re
import shutil import shutil
import textwrap import textwrap
import typing as t import typing as t
from datetime import datetime, timezone
from importlib.metadata import version
from wcwidth import wcswidth
from toot import __version__, config, settings
from toot.entities import Account, Data, Instance, Notification, Poll, Status, List from toot.entities import Account, Data, Instance, Notification, Poll, Status, List
from toot.utils import get_text, html_to_paragraphs from toot.utils import get_text, html_to_paragraphs
from toot.wcstring import wc_wrap from toot.wcstring import wc_wrap
from wcwidth import wcswidth
DEFAULT_WIDTH = 80 DEFAULT_WIDTH = 80
@ -315,18 +320,12 @@ def format_account_name(account: Account) -> str:
def print_diags(instance_dict: t.Optional[Data], include_files: bool): def print_diags(instance_dict: t.Optional[Data], include_files: bool):
from importlib.metadata import version
click.echo(f'{green("Diagnostic Information")}') click.echo(f'{green("Diagnostic Information")}')
from datetime import datetime, timezone
now = datetime.now(timezone.utc) now = datetime.now(timezone.utc)
click.echo(f'{green("Current Date/Time:")} {now.strftime("%Y-%m-%d %H:%M:%S %Z")}') click.echo(f'{green("Current Date/Time:")} {now.strftime("%Y-%m-%d %H:%M:%S %Z")}')
from toot import __version__, config, settings
click.echo(f'{green("Toot version:")} {__version__}') click.echo(f'{green("Toot version:")} {__version__}')
import platform
click.echo(f'{green("Platform:")} {platform.platform()}') click.echo(f'{green("Platform:")} {platform.platform()}')
# print distro - only call if available (python 3.10+) # print distro - only call if available (python 3.10+)