Skip to content

Commit

Permalink
Merge pull request #11 from rly0nheart/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
rly0nheart authored Aug 16, 2023
2 parents 52e5b0a + 782162e commit bc2ed76
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions glyphoji/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init_glyph():

glyph = __init_glyph()

__author__ = glyph.settings()["program"]["author"]["name"]
__email__ = glyph.settings()["program"]["author"]["email"]
__version__ = glyph.settings()["program"]["version"]
__description__ = glyph.settings()["program"]["about"]
__author__ = glyph.__settings()["program"]["author"]["name"]
__email__ = glyph.__settings()["program"]["author"]["email"]
__version__ = glyph.__settings()["program"]["version"]
__description__ = glyph.__settings()["program"]["about"]
2 changes: 1 addition & 1 deletion glyphoji/data/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"program": {
"name": "Glyphoji",
"about": "Modern hieroglyphs in the terminal.",
"version": "0.2.4",
"version": "0.2.5",
"author": {
"name": "Richard Mwewa",
"email": "[email protected]"
Expand Down
10 changes: 5 additions & 5 deletions glyphoji/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self):
"""
Initialises the Glyphoji class by loading the glyphs from settings.
"""
self._glyph_dictionary = self.settings()["glyphs"]
self._glyph_dictionary = self.__settings()["glyphs"]

def __getattr__(self, name: str) -> str:
"""
Expand All @@ -39,7 +39,7 @@ def glyphs(self) -> str:
:return: String containing all glyphs
"""
return self._get_glyphs(dict_object=self._glyph_dictionary)
return self.__get_glyphs(dict_object=self._glyph_dictionary)

def search(self, query: str) -> str:
"""
Expand All @@ -63,10 +63,10 @@ def search(self, query: str) -> str:
suggestions = difflib.get_close_matches(query, all_aliases)
return f"(did you mean {', '.join(suggestions)}?)"

return f"Close matches to `{query}`:\n{self._get_glyphs(dict_object=result)}"
return f"Close matches to `{query}`:\n{self.__get_glyphs(dict_object=result)}"

@staticmethod
def _get_glyphs(dict_object: dict) -> str:
def __get_glyphs(dict_object: dict) -> str:
"""
Formats the dictionary of glyphs into a string.
Expand All @@ -76,7 +76,7 @@ def _get_glyphs(dict_object: dict) -> str:
return "\n".join([f"{key}: {value}" for key, value in dict_object.items()])

@staticmethod
def settings() -> dict:
def __settings() -> dict:
"""
Loads the program's settings from /data/settings.json.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "glyphoji"
version = "0.2.4"
version = "0.2.5"
description = "Modern hieroglyphs in the terminal."
authors = ["Richard Mwewa <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit bc2ed76

Please sign in to comment.