OwenCochell / cursepy

A CurseForge API written in python
MIT License
7 stars 1 forks source link

[BUG] TypeError: BaseClient.search() takes from 2 to 3 positional arguments but 4 were given #11

Open 3Diller opened 2 years ago

3Diller commented 2 years ago

It seems like MinecraftWrapper.search_mods method passes MinecraftWrapper.MODS as an argument to BaseClass.search method but it doesn't expect that argument.

Code to reproduce:

from cursepy import MinecraftWrapper
from cursepy.classes.search import SearchParam

API_KEY = '***'

mw = MinecraftWrapper(API_KEY)
sp = SearchParam(gameId=mw.GAME, slug='invmove')
print(mw.search_mods(sp))

Traceback (most recent call last):

  File "/usr/local/Cellar/python@3.10/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/Cellar/python@3.10/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/me/Projects/minebot/minebot/curseforge.py", line 15, in <module>
    print(mw.search_mods(sp))
  File "/Users/me/Projects/minebot/.venv/lib/python3.10/site-packages/cursepy/wrapper.py", line 423, in search_mods
    return self.search(MinecraftWrapper.GAME_ID, MinecraftWrapper.MODS, search)
3Diller commented 2 years ago

Also BaseClient.search and BaseClient.iter_search methods are missing category_id param described in their docstrings.

OwenCochell commented 2 years ago

I have corrected this issue on the newest release, the version you want is 2.1.0.

Thank you again for finding and reporting these bugs!