Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleades committed Mar 17, 2024
1 parent e75c47b commit 5da66c0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions copier/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
from importlib.metadata import version
from pathlib import Path
from types import TracebackType
from typing import Any, Callable, Literal, TextIO, cast
from typing import Any, Callable, Literal, Sequence, TextIO, cast

import colorama
from packaging.version import Version
from pydantic import StrictBool

from .types import IntSeq

colorama.just_fix_windows_console()


Expand Down Expand Up @@ -65,22 +63,22 @@ def copier_version() -> Version:
def printf(
action: str,
msg: Any = "",
style: IntSeq | None = None,
style: Sequence[str] | None = None,
indent: int = 10,
quiet: bool | StrictBool = False,
file_: TextIO = sys.stdout,
) -> str | None:
"""Print string with common format."""
if quiet:
return None # HACK: Satisfy MyPy
return None
_msg = str(msg)
action = action.rjust(indent, " ")
if not style:
return action + _msg

out = style + [action] + Style.RESET + [INDENT, _msg] # type: ignore[operator]
print(*out, sep="", file=file_)
return None # HACK: Satisfy MyPy
return None


def printf_exception(
Expand Down

0 comments on commit 5da66c0

Please sign in to comment.