Skip to content

Commit

Permalink
change utils package to "core"
Browse files Browse the repository at this point in the history
  • Loading branch information
hitblast committed Aug 11, 2024
1 parent 4cb07f2 commit a6db2a2
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 17 deletions.
2 changes: 1 addition & 1 deletion avro/utils/__init__.py → avro/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: MIT

"""
Core utility package for avro.py
Core backend functionality package for avro.py
Licensed under the terms of the MIT License.
"""
File renamed without changes.
2 changes: 1 addition & 1 deletion avro/utils/count.py → avro/core/count.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


# Import local modules.
from avro.utils import config
from avro.core import config


# Functions.
Expand Down
13 changes: 6 additions & 7 deletions avro/utils/processor.py → avro/core/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def find_in_remap(text: str, *, reversed: bool = False) -> Tuple[str, bool]:
word == previous_word for word, previous_word in zip(text.split(), previous_text.split())
)

return (text, manual_required)
return text, manual_required


def match_patterns(
Expand Down Expand Up @@ -298,8 +298,7 @@ def rearrange_bijoy_text(text: str) -> str:
text = text[: i - 1] + text[i] + text[i + 1] + text[i - 1] + text[i + 2 :]

if (
i > 0
and i < len(text) - 1
0 < i < len(text) - 1
and text[i] == "\u09cd"
and text[i - 1] == "\u09b0"
and text[i - 2] != "\u09cd"
Expand Down Expand Up @@ -337,14 +336,14 @@ def rearrange_bijoy_text(text: str) -> str:
temp = text[:i] + text[i + 1 : i + j + 1]
if text[i] == "ে" and part == "া":
temp += "ো"
l = 1
add = 1
elif text[i] == "ে" and part == "ৗ":
temp += "ৌ"
l = 1
add = 1
else:
temp += text[i]
l = 0
temp += text[i + j + l + 1 :]
add = 0
temp += text[i + j + add + 1 :]
text = temp
i += j

Expand Down
5 changes: 2 additions & 3 deletions avro/utils/validate.py → avro/core/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@


# Import local modules.
from avro.utils import config
from avro.core import config


# Unicode-specific validation functions.
# These are only used for converting to and from Unicode characters.


def is_vowel(text: str) -> bool:
"""
Check if given string is a vowel.
Expand Down
11 changes: 9 additions & 2 deletions avro/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# SPDX-License-Identifier: MIT


"""
Avro Keyboard for Pythoneers
Licensed under the terms of the MIT License.
"""

# Import first-party Python libraries.
import re
from concurrent.futures import ThreadPoolExecutor, as_completed
Expand All @@ -9,8 +15,9 @@
from typing import Callable, Generator, List, Tuple, Union

# Import local modules.
from .utils import processor, validate
from .utils.config import BIJOY_MAP, BIJOY_MAP_REVERSE
from . import processor
from .core import validate
from .core.config import BIJOY_MAP, BIJOY_MAP_REVERSE


# Concurrency helper function for handling multithreaded workloads.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# Import local modules.
import avro
from avro.utils import config
from avro.core import config


# Test functions for this file.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))

# Import local modules.
from avro.utils import count
from avro.core import count


# Test functions for this file.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))

# Import local modules.
from avro.utils import validate
from avro.core import validate

# Set up test environments.
vowels = "aeiou"
Expand Down

0 comments on commit a6db2a2

Please sign in to comment.