Closed TechWiz-3 closed 2 years ago
Hi, can I work on this?
And how to run it? I read the readme file but didn't find any command to run it.
Sure, you can run the file src/unfollow/cli.py
manually when developing.
For actual personal use, pip install unfollow
, unfollow
Any updates @LunarMarathon ?
@TechWiz-3 Hey, I am getting this - 'unfollow' is not a package when I run cli.py. (I already installed it via pip) I changed this - #!/usr/bin/env python3 to my path since I'm using windows but I'm not sure what's wrong and how to test. You can assign it to someone else, sorry
The issue is to do with the imports because of the way the project and setup.py
are structured. See #9 for more info.
What you can do is in cli.py
and unfollow.py
replace any imports that start with from unfollow
to from src.unfollow
and do the same with the unfollow
script in the root dir. Then it will work.
Sorry about that, please let me know what happens
Thank you, I'll try that and send a PR today or tomorrow!
Hey Lunar, I've fixed the development issues, please check the new development instructions in the README.md out.
Thanks a lot for your patience 🙏
Ok, I'll check it
@TechWiz-3
There's a typo in the files but I checked after changing all the apperance's to appearance and without changing too, both gave Key error
Can you check ~/.unfollow/unfollow.toml
and tell me if it has contents or it's just an empty file?
There's no file called unfollow.toml but there's pyptoject.toml
I mean in your home directory you should have a .unfollow
directory?
It's a hidden directory
Found it, yeah it's empty
Ah ok, delete the file unfollow.toml
and re-run poetry run unfollow
I'm getting this now. Is it working fine on your end? Maybe I have to add encoding="utf-8" somewhere
I was getting this yesterday but i solved the issue, have you pulled the latest version?
Yes, I synced the fork and cloned to a new folder today
main
branch or your simple-mode
branchconfig.py
says in the big default_config = """
- the issue is most likely there~/.unfollow/unfollow.toml
so new one is copied over
Sorry you've been going through all this trouble man 😅 appreciate your perseverance ❤️ I'm almost losing it lol
but I'm not sure why the branch isn't visible on the repo. Not sure if it appears only* after I push something.
yes when you do git push --upstream origin <branchname>
Hmmm this is definetly the new version.
Ohhh i think i know why, command prompt can't render some characters in the same way other terminals can. How about you use vscode's terminal or download microsoft terminal
and use the command prompt
option from there, hopefully will work that way
It was the same in VS code (I was using microsoft terminal itself in the previous screenshot) but after adding encoding here - it's working!
Last time you had suggested that I remove the colors when the user is asked to enter their Github username when unfollow is used for the first time. That part is there in this piece of code in the input file (img1)
Now this function is called in unfollow file (img2)
Nothing is passed to this function get_input_username
and from img1 you can see that the default values for panels, bubbles and simple have been set to false. So whatever the theme, the color for "please enter your gh username" is always magenta. Now I need to add a separate if block for simple case with the same code without :label:, [magenta] and [red] in user invalid line. It'll look like the changes made to input file here - https://github.com/LunarMarathon/who-unfollowed-me/commit/41c67272f59042479605b64099b3c1efd55f5b94#diff-930a3e5ae0a392ab5a43f0a0e69722721cf2de947af72a1e2a53b0c9cb7a799c
Then if you see the changes in the unfollow.py file (https://github.com/LunarMarathon/who-unfollowed-me/commit/41c67272f59042479605b64099b3c1efd55f5b94#diff-fc47bb8c100fa4f81b4ae5600bf982cc60e62707be9327f19309330bc216f2a1) you'll see that I have to pass simple as true and for that I need the variable simple which is actually defined in the cli.py file. So, I had to import that from cli to unfollow.py.
When I do I get this error -
from unfollow.cli import simple
ImportError: cannot import name 'simple' from partially initialized module 'unfollow.cli' (most likely due to a circular import) (E:\gh\hf2\who-unfollowed-me\unfollow\cli.py)
The issue is that, everything starts at cli.py file (or I guess it's setup-> then cli) and cli has an import -
from unfollow.unfollow import main as unfollow_main
And then again unfollow.py would have from unfollow.cli import simple
So from what I've understood this is how the circular import is caused and throws import error. So what can be done about that? Either we can ignore the colored lines when the user first gives their username or some of the functions and variables should be shifted to other existing files such that circular import does that happen but that seems difficult since cli, unfollow and config are somewhat linked(imports made from one another) or else what can be done?
I'm not exactly sure why you're trying to import the variable simple
tho?
Ahhh i see
Nothing is passed to this function get_input_username and from img1 you can see that the default values for panels, bubbles and simple have been set to false. So whatever the theme, the color for "please enter your gh username" is always magenta. Now I need to add a separate if block for simple case with the same code without 🏷️, [magenta] and [red] in user invalid line. It'll look like the changes made to input file here
Currently we haven't added theme support for that prompt, it's not at all in the code. Don't worry about it for now, just all the other text in cli.py. I'll add support for it soon 🙏
Ok, I'll do that and send a PR
Create a no-color, no-emoji version called "simple". It will be dealt with similarly to
bubbles
andpanels
.All files will be relevant in this issue although I would start with
cli.py
.Code should be pretty self explanatory after looking at it tho 👍. Any questions please go ahead and ask 🙏