Skip to content

Commit f919815

Browse files
antocunipablogsal
authored andcommitted
put _colorize.FancyCompleter in alphabetical order w.r.t. the other sections
1 parent d6b77e0 commit f919815

1 file changed

Lines changed: 28 additions & 28 deletions

File tree

Lib/_colorize.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,30 @@ class Difflib(ThemeSection):
199199
reset: str = ANSIColors.RESET
200200

201201

202+
@dataclass(frozen=True, kw_only=True)
203+
class FancyCompleter(ThemeSection):
204+
# functions and methods
205+
function: str = ANSIColors.BOLD_BLUE
206+
builtin_function_or_method: str = ANSIColors.BOLD_BLUE
207+
method: str = ANSIColors.BOLD_CYAN
208+
method_wrapper: str = ANSIColors.BOLD_CYAN
209+
wrapper_descriptor: str = ANSIColors.BOLD_CYAN
210+
method_descriptor: str = ANSIColors.BOLD_CYAN
211+
212+
# numbers
213+
int: str = ANSIColors.BOLD_YELLOW
214+
float: str = ANSIColors.BOLD_YELLOW
215+
complex: str = ANSIColors.BOLD_YELLOW
216+
bool: str = ANSIColors.BOLD_YELLOW
217+
218+
# others
219+
type: str = ANSIColors.BOLD_MAGENTA
220+
module: str = ANSIColors.CYAN
221+
NoneType: str = ANSIColors.GREY
222+
bytes: str = ANSIColors.BOLD_GREEN
223+
str: str = ANSIColors.BOLD_GREEN
224+
225+
202226
@dataclass(frozen=True, kw_only=True)
203227
class LiveProfiler(ThemeSection):
204228
"""Theme section for the live profiling TUI (Tachyon profiler).
@@ -344,30 +368,6 @@ class Unittest(ThemeSection):
344368
reset: str = ANSIColors.RESET
345369

346370

347-
@dataclass(frozen=True, kw_only=True)
348-
class FancyCompleter(ThemeSection):
349-
# functions and methods
350-
function: str = ANSIColors.BOLD_BLUE
351-
builtin_function_or_method: str = ANSIColors.BOLD_BLUE
352-
method: str = ANSIColors.BOLD_CYAN
353-
method_wrapper: str = ANSIColors.BOLD_CYAN
354-
wrapper_descriptor: str = ANSIColors.BOLD_CYAN
355-
method_descriptor: str = ANSIColors.BOLD_CYAN
356-
357-
# numbers
358-
int: str = ANSIColors.BOLD_YELLOW
359-
float: str = ANSIColors.BOLD_YELLOW
360-
complex: str = ANSIColors.BOLD_YELLOW
361-
bool: str = ANSIColors.BOLD_YELLOW
362-
363-
# others
364-
type: str = ANSIColors.BOLD_MAGENTA
365-
module: str = ANSIColors.CYAN
366-
NoneType: str = ANSIColors.GREY
367-
bytes: str = ANSIColors.BOLD_GREEN
368-
str: str = ANSIColors.BOLD_GREEN
369-
370-
371371
@dataclass(frozen=True, kw_only=True)
372372
class Theme:
373373
"""A suite of themes for all sections of Python.
@@ -377,22 +377,22 @@ class Theme:
377377
"""
378378
argparse: Argparse = field(default_factory=Argparse)
379379
difflib: Difflib = field(default_factory=Difflib)
380+
fancycompleter: FancyCompleter = field(default_factory=FancyCompleter)
380381
live_profiler: LiveProfiler = field(default_factory=LiveProfiler)
381382
syntax: Syntax = field(default_factory=Syntax)
382383
traceback: Traceback = field(default_factory=Traceback)
383384
unittest: Unittest = field(default_factory=Unittest)
384-
fancycompleter: FancyCompleter = field(default_factory=FancyCompleter)
385385

386386
def copy_with(
387387
self,
388388
*,
389389
argparse: Argparse | None = None,
390390
difflib: Difflib | None = None,
391+
fancycompleter: FancyCompleter | None = None,
391392
live_profiler: LiveProfiler | None = None,
392393
syntax: Syntax | None = None,
393394
traceback: Traceback | None = None,
394395
unittest: Unittest | None = None,
395-
fancycompleter: FancyCompleter | None = None,
396396
) -> Self:
397397
"""Return a new Theme based on this instance with some sections replaced.
398398
@@ -402,11 +402,11 @@ def copy_with(
402402
return type(self)(
403403
argparse=argparse or self.argparse,
404404
difflib=difflib or self.difflib,
405+
fancycompleter=fancycompleter or self.fancycompleter,
405406
live_profiler=live_profiler or self.live_profiler,
406407
syntax=syntax or self.syntax,
407408
traceback=traceback or self.traceback,
408409
unittest=unittest or self.unittest,
409-
fancycompleter=fancycompleter or self.fancycompleter,
410410
)
411411

412412
@classmethod
@@ -420,11 +420,11 @@ def no_colors(cls) -> Self:
420420
return cls(
421421
argparse=Argparse.no_colors(),
422422
difflib=Difflib.no_colors(),
423+
fancycompleter=FancyCompleter.no_colors(),
423424
live_profiler=LiveProfiler.no_colors(),
424425
syntax=Syntax.no_colors(),
425426
traceback=Traceback.no_colors(),
426427
unittest=Unittest.no_colors(),
427-
fancycompleter=FancyCompleter.no_colors(),
428428
)
429429

430430

0 commit comments

Comments
 (0)