homa 0.17__tar.gz → 0.18__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of homa might be problematic. Click here for more details.

@@ -1,6 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: homa
3
- Version: 0.17
3
+ Version: 0.18
4
+ Maintainer: Taha Shieenavaz
5
+ Maintainer-email: tahashieenavaz@gmail.com
4
6
  Description-Content-Type: text/markdown
5
7
  License-File: LICENSE
6
8
 
@@ -7,16 +7,17 @@ import pkg_resources
7
7
 
8
8
  def resource(name: str):
9
9
  """
10
- The function `resource` takes a string parameter `name` and returns the filename of a resource in
11
- the "homa.wordlists" package with the given name.
12
-
10
+ The function `resource` takes a string `name` as input and returns the filename of a resource in the
11
+ "homa" package.
12
+
13
13
  :param name: The `name` parameter in the `resource` function is a string that represents the name of
14
- the resource file you want to access
14
+ the resource file you want to retrieve the filename for using `pkg_resources.resource_filename`
15
+ function
15
16
  :type name: str
16
- :return: The `resource` function is returning the filename of a resource from the package
17
- `homa.wordlists` with the given `name` and a `.txt` extension.
17
+ :return: The `resource` function is returning the filename of the specified resource within the
18
+ "homa" package using `pkg_resources.resource_filename`.
18
19
  """
19
- return pkg_resources.resource_filename("homa.wordlists", f"{name}.txt")
20
+ return pkg_resources.resource_filename("homa", name)
20
21
 
21
22
 
22
23
  def replaceVowels(raw: str) -> str:
@@ -98,20 +99,6 @@ def oneOf(values: list) -> any:
98
99
  return values[randint(0, len(values))]
99
100
 
100
101
 
101
- def root(path="") -> str:
102
- """
103
- The `root` function returns the absolute path of the directory containing the current script file,
104
- with an optional additional path appended to it.
105
-
106
- :param path: The `path` parameter in the `root` function is a string that represents the relative
107
- path from the current file's directory to another directory or file. It is used to construct the
108
- full absolute path by appending it to the directory of the current file
109
- :return: The function `root(path)` returns the absolute path of the directory containing the current
110
- Python script file (__file__) concatenated with the provided `path` argument.
111
- """
112
- return os.path.dirname(os.path.abspath(__file__)) + "/" + path
113
-
114
-
115
102
  def isVowel(letter: str) -> bool:
116
103
  """
117
104
  This Python function checks if a given letter is a vowel.
@@ -2,16 +2,19 @@ from random import shuffle
2
2
 
3
3
  from ..helpers import fileAsArray
4
4
  from ..helpers import oneOf
5
- from ..helpers import root
6
5
  from ..helpers import replaceVowels
7
6
  from ..helpers import resource
8
7
 
9
8
 
10
9
  class RandomNameRepository:
11
10
  def __init__(self) -> None:
12
- self.__masculine_firstnames = fileAsArray(resource("masculine_names"))
13
- self.__feminine_firstnames = fileAsArray(resource("feminine_names"))
14
- self.__surnames = fileAsArray(resource("surnames"))
11
+ self.__masculine_firstnames = fileAsArray(
12
+ resource("wordlists/masculine.txt"))
13
+
14
+ self.__feminine_firstnames = fileAsArray(
15
+ resource("wordlists/feminine.txt"))
16
+
17
+ self.__surnames = fileAsArray(resource("wordlists/surnames.txt"))
15
18
 
16
19
  shuffle(self.__masculine_firstnames)
17
20
  shuffle(self.__feminine_firstnames)
@@ -4,15 +4,13 @@ import random
4
4
  from ..helpers import randint
5
5
  from ..helpers import oneOf
6
6
  from ..helpers import fileAsArray
7
- from ..helpers import root
7
+ from ..helpers import resource
8
8
  from ..helpers import replaceVowels
9
9
 
10
10
 
11
11
  class RandomTextRepository:
12
12
  def __init__(self) -> None:
13
- self.titles = fileAsArray(
14
- root("wordlists/text/titles.txt")
15
- )
13
+ self.titles = fileAsArray(resource("wordlists/titles.txt"))
16
14
  random.shuffle(self.titles)
17
15
 
18
16
  def token(self, lowerBound: int = 4, upperBound: int = 14):
@@ -1,6 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: homa
3
- Version: 0.17
3
+ Version: 0.18
4
+ Maintainer: Taha Shieenavaz
5
+ Maintainer-email: tahashieenavaz@gmail.com
4
6
  Description-Content-Type: text/markdown
5
7
  License-File: LICENSE
6
8
 
@@ -1,10 +1,6 @@
1
1
  LICENSE
2
2
  README.md
3
3
  setup.py
4
- Homa.egg-info/PKG-INFO
5
- Homa.egg-info/SOURCES.txt
6
- Homa.egg-info/dependency_links.txt
7
- Homa.egg-info/top_level.txt
8
4
  homa/__init__.py
9
5
  homa/helpers.py
10
6
  homa/main.py
@@ -17,7 +13,7 @@ homa/repositories/RandomImageRepository.py
17
13
  homa/repositories/RandomNameRepository.py
18
14
  homa/repositories/RandomTextRepository.py
19
15
  homa/repositories/__init__.py
20
- homa/wordlists/feminine_names.txt
21
- homa/wordlists/masculine_names.txt
16
+ homa/wordlists/feminine.txt
17
+ homa/wordlists/masculine.txt
22
18
  homa/wordlists/surnames.txt
23
19
  homa/wordlists/titles.txt
@@ -6,14 +6,17 @@ with open("README.md") as fh:
6
6
 
7
7
  setup(
8
8
  name="homa",
9
- version="0.17",
9
+ maintainer="Taha Shieenavaz",
10
+ maintainer_email="tahashieenavaz@gmail.com",
11
+ version="0.18",
10
12
  packages=find_packages(),
11
13
  install_requires=[
12
14
  #
13
15
  ],
14
16
  long_description=description,
15
17
  long_description_content_type="text/markdown",
18
+ include_package_data=True,
16
19
  package_data={
17
- "homa": ["./wordlists/*"]
20
+ "": ["wordlists/*"]
18
21
  }
19
22
  )
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes