TechWiz-3 / who-unfollowed-me

😡 Python CLI tool that shows you who has unfollowed you on GitHub. PRs welcome!
GNU General Public License v3.0
11 stars 24 forks source link

Cache last week #33

Closed tintinthong closed 1 year ago

tintinthong commented 1 year ago

Issue https://github.com/TechWiz-3/who-unfollowed-me/issues/6

tintinthong commented 1 year ago

@TechWiz-3 the flake8 stuff was annoying. I added black here but I'm not sure if that was a good idea for reviewability. Main changes in commit https://github.com/TechWiz-3/who-unfollowed-me/pull/33/commits/d817c0608bde47183a148721c348e300fad35297

TechWiz-3 commented 1 year ago

Thank you 🙏, will review this when I get home tonight

TechWiz-3 commented 1 year ago

I'm getting an error when running NameError: name 'cached' is not defined

Full traceback:


Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/Peregrine/Desktop/Projects/forks/tests/tintin-unfollow/unfollow/cli.py", line 218, in main
    get_links()
  File "/Users/Peregrine/Desktop/Projects/forks/tests/tintin-unfollow/unfollow/cli.py", line 98, in get_links
    info = unfollow_main()
  File "/Users/Peregrine/Desktop/Projects/forks/tests/tintin-unfollow/unfollow/unfollow.py", line 268, in main
    return unfollowed_future.result()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/_base.py", line 433, in result
    return self.__get_result()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/Peregrine/Desktop/Projects/forks/tests/tintin-unfollow/unfollow/unfollow.py", line 233, in run_unfollow
    unfollows_last_week = get_unfollows_since(unfollows, 7) if cached else []
NameError: name 'cached' is not defined```
tintinthong commented 1 year ago

I'm getting an error when running NameError: name 'cached' is not defined

Full traceback:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/Peregrine/Desktop/Projects/forks/tests/tintin-unfollow/unfollow/cli.py", line 218, in main
    get_links()
  File "/Users/Peregrine/Desktop/Projects/forks/tests/tintin-unfollow/unfollow/cli.py", line 98, in get_links
    info = unfollow_main()
  File "/Users/Peregrine/Desktop/Projects/forks/tests/tintin-unfollow/unfollow/unfollow.py", line 268, in main
    return unfollowed_future.result()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/_base.py", line 433, in result
    return self.__get_result()
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/_base.py", line 389, in __get_result
    raise self._exception
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/concurrent/futures/thread.py", line 52, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/Peregrine/Desktop/Projects/forks/tests/tintin-unfollow/unfollow/unfollow.py", line 233, in run_unfollow
    unfollows_last_week = get_unfollows_since(unfollows, 7) if cached else []
NameError: name 'cached' is not defined```

Whoops sorry. I fixed the bug.

There was also another bug here 624758e

tintinthong commented 1 year ago

Hmmm internationalization going crazy. Hahah. I added like a piece of text but I don't speak other languages. So I have placeholded english for each and everyone of them. I was so tempted to run a translator over them.

TechWiz-3 commented 1 year ago

Ah cool

TechWiz-3 commented 1 year ago

yup i noticed lol, it can be another hacktoberfest issue for the translators

TechWiz-3 commented 1 year ago

I don't mind the messy output but I'm not getting the expected behaviour.

Expected: after detecting unfollowers, the next run will display the unfollowers previously displayed

Reality:

Detection of unfollowers:

Screen Shot 2022-10-13 at 9 27 59 pm

(Ignore the dodgy names please 🤣)

Run after that - does not display previously displayed unfollowers:

Screen Shot 2022-10-13 at 9 28 12 pm
TechWiz-3 commented 1 year ago

Ok this is because cached was never assigned

TechWiz-3 commented 1 year ago

Ok thanks for your work, I'll clean up the output and then merge

tintinthong commented 1 year ago

Ok this is because cached was never assigned

Ahhhhhhhhh makes sense

TechWiz-3 commented 1 year ago

Thanks a lot for your work

Just a tip for the future, you did a lot of really nice programming and you're definitely more knowledgeable technically then i am, when you submit the PR make sure that you clean up the output and finer details so all your good work comes through 👌