Skip to content

Commit

Permalink
feat: revamp project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
aintbe committed Nov 6, 2024
1 parent abd2bb1 commit bd13bd6
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 14 deletions.
3 changes: 2 additions & 1 deletion example.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from ohmygod import OhMyGod, Buddha
from ohmygod import OhMyGod
from ohmygod.messenger import Buddha
import time

omg = OhMyGod(Buddha)
Expand Down
5 changes: 2 additions & 3 deletions ohmygod/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
"""OH MY GOD package built upon rich console interface"""

__version__ = "0.2.0"
__version__ = "0.2.1"

from .main import OhMyGod
from .utils import Color
from .messenger.buddha import Buddha

__all__ = ["OhMyGod", "Color", "Buddha"]
__all__ = ["OhMyGod", "Color"]
8 changes: 4 additions & 4 deletions ohmygod/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
from queue import Queue

from .messenger.buddha import Buddha
from .messenger.messenger import _Messenger as Messenger
from .messenger.messenger import Messenger


class OhMyGod(Console):
"""Console interface powered by Buddha"""
def __init__(self, messenger_cls: type[Messenger] = Buddha):
"""Console interface powered by gods and rich library"""
def __init__(self, messenger: type[Messenger] = Buddha):
super().__init__()
self.messenger = messenger_cls()
self.messenger = messenger()
self.bless()


Expand Down
4 changes: 4 additions & 0 deletions ohmygod/messenger/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .buddha import Buddha
from .messenger import Messenger

__all__ = ["Messenger", "Buddha"]
6 changes: 3 additions & 3 deletions ohmygod/messenger/buddha.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from rich.text import Text

from .messenger import _Messenger
from .messenger import Messenger
from ..utils import Color, _Message


Expand Down Expand Up @@ -73,7 +73,7 @@
_ERROR = _ERROR_TEMPLATE.clean() + _ERROR_ANIMATION


class Buddha(_Messenger):
class Buddha(Messenger):
@property
def BLESSING(self):
return _BLESSING
Expand All @@ -94,7 +94,7 @@ def ERROR_COLORED(self):
def ERROR_ANIMATION(self):
return _ERROR_ANIMATION

class Quotes(_Messenger.Quotes):
class Quotes(Messenger.Quotes):
@property
def BLESSING(self):
return Text(_BLESSING)
Expand Down
2 changes: 1 addition & 1 deletion ohmygod/messenger/messenger.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from ..utils import _Message


class _Messenger(ABC):
class Messenger(ABC):
@property
@abstractmethod
def BLESSING(self) -> _Message:
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[tool.poetry]
name = "ohmygod"
version = "0.2.0"
version = "0.2.1"
description = "Rich CLI tool powered by gods"
authors = ["Sori Lim <[email protected]>"]
authors = ["Sori Lim <[email protected]>"]
homepage = "https://github.com/aintbe/ohmygod"
license = "MIT"
readme = "README.md"

Expand Down

0 comments on commit bd13bd6

Please sign in to comment.