gvellut / jncep

Command-line tool to generate EPUB files for J-Novel Club pre-pub novels
GNU General Public License v3.0
43 stars 11 forks source link

AttributeError: 'JNCLabsAPI' object has no attribute 'api' #17

Closed avalitan closed 2 years ago

avalitan commented 2 years ago

Getting this error when I updated today:

2022-03-22 00:43:23,007 jncep.utils  INFO     Logged in with email '[highlight]**************[/]'
2022-03-22 00:43:23,007 jncep.utils  WARNING  ...
2022-03-22 00:43:23,008 jncep.utils  INFO     Logout...
2022-03-22 00:43:23,310 jncep.utils  ERROR    *** An unrecoverable error occured ***
2022-03-22 00:43:23,310 jncep.utils  ERROR    'JNCLabsAPI' object has no attribute 'api'
2022-03-22 00:43:23,311 jncep.cli    DEBUG    Traceback (most recent call last):
   File "$HOME/.py_envs/jncep/lib/python3.7/site-packages/jncep/cli/base.py", line 17, in invoke
    return super().invoke(ctx)
   File "$HOME/.py_envs/jncep/lib/python3.7/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
   File "$HOME/.py_envs/jncep/lib/python3.7/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
   File "$HOME/.py_envs/jncep/lib/python3.7/site-packages/jncep/trio_utils.py", line 31, in wrapper
    return trio.run(partial(f, *args, **kwargs))
   File "$HOME/.py_envs/jncep/lib/python3.7/site-packages/trio/_core/_run.py", line 1932, in run
    raise runner.main_task_outcome.error
   File "$HOME/.py_envs/jncep/lib/python3.7/site-packages/jncep/cli/epub.py", line 70, in generate_epub
    part_spec_analyzed = await core.to_part_spec(session, jnc_resource)
   File "$HOME/.py_envs/jncep/lib/python3.7/site-packages/jncep/core.py", line 345, in to_part_spec
    volumes = await fetch_volumes_for_series(session.api, series_slug)
   File "$HOME/.py_envs/jncep/lib/python3.7/site-packages/jncep/core.py", line 456, in fetch_volumes_for_series
    async for volume in session.api.paginate(
 AttributeError: 'JNCLabsAPI' object has no attribute 'api'

both in python 3.7 & python 3.10

also content of python3.7/site-packages/jncep/init.py: __version__ = "32"

jncep update seem to work fine though...

gvellut commented 2 years ago

Thank you for your feedback.

I have corrected the issue you reported. I will check if there is more like it and I will make a new release soon.