Skip to content
This repository was archived by the owner on Sep 5, 2023. It is now read-only.

Commit 1744e84

Browse files
committed
refactor: Move text style to its own module
Text style classes have moved to its own module. Updated imports from relative to ensure they are all absolute now.
1 parent 7098138 commit 1744e84

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

gitcommit/gitcommit.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,18 @@
2929
from prompt_toolkit.history import FileHistory
3030
from prompt_toolkit.application.current import get_app
3131
from prompt_toolkit.styles import Style
32-
from .ansi import ANSI as Ansi
33-
from .validators import (
32+
from gitcommit.ansi import ANSI as Ansi
33+
from gitcommit.validators import (
3434
DescriptionValidator,
3535
TypeValidator,
3636
YesNoValidator,
3737
BodyValidator,
3838
FooterValidator,
3939
)
40-
from .completers import TypeCompleter, FooterCompleter
41-
from .updater import check_for_update
42-
from .utils import capitaliseFirst
40+
from gitcommit.completers import TypeCompleter, FooterCompleter
41+
from gitcommit.updater import check_for_update
42+
from gitcommit.utils import capitaliseFirst
43+
from gitcommit.style import style
4344

4445
CONFIG_HOME_DIR = "~/.gitcommit/"
4546

gitcommit/style.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from prompt_toolkit.styles import Style
2+
3+
style = Style.from_dict(
4+
{"green": "#a0d762 bold", "red": "#e67061 bold", "command": "#f78ae0 bold"}
5+
)

gitcommit/updater.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
from prompt_toolkit import print_formatted_text
55
from prompt_toolkit.formatted_text import FormattedText
66
from prompt_toolkit.styles import Style
7-
from .ansi import ANSI as Ansi
7+
from gitcommit.ansi import ANSI as Ansi
88
import pyperclip # pylint: disable=import-error
99
from packaging import version
10+
from gitcommit.style import style
1011

1112

1213
def get_github_tags():

0 commit comments

Comments
 (0)