jack-mil / bing-rewards

A script to automate daily Bing rewards points
MIT License
199 stars 26 forks source link

add `package` argument for `resources.files()` #49

Closed znarfm closed 4 months ago

znarfm commented 4 months ago

running bing-rewards in the terminal opens a browser window, however, exits prematurely since there happens to be something missing in the code itself.

note: bing-rewards installed using pipx.

$ bing-rewards
Doing 33 desktop searches
Press ESC to quit searching
Opening browser [1508]
Exception in thread Thread-1 (both):
Traceback (most recent call last):
  File "C:\Users\meina\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "C:\Users\meina\AppData\Local\Programs\Python\Python311\Lib\threading.py", line 982, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\meina\AppData\Local\pipx\pipx\venvs\bing-rewards\Lib\site-packages\bing_rewards\__init__.py", line 213, in both
    desktop()
  File "C:\Users\meina\AppData\Local\pipx\pipx\venvs\bing-rewards\Lib\site-packages\bing_rewards\__init__.py", line 201, in desktop
    search(count, words_gen, options.desktop_agent, options)
  File "C:\Users\meina\AppData\Local\pipx\pipx\venvs\bing-rewards\Lib\site-packages\bing_rewards\__init__.py", line 149, in search
    query = next(words_gen)
            ^^^^^^^^^^^^^^^
  File "C:\Users\meina\AppData\Local\pipx\pipx\venvs\bing-rewards\Lib\site-packages\bing_rewards\__init__.py", line 53, in word_generator
    word_data = resources.files().joinpath('data', 'keywords.txt')
                ^^^^^^^^^^^^^^^^^
TypeError: files() missing 1 required positional argument: 'package'
jack-mil commented 4 months ago

for reference, what version of python are you using?

znarfm commented 4 months ago

I'm using Python 3.11.9.

jack-mil commented 4 months ago

oops, I used a 3.12 feature. Thanks for the catch 👍 image