Code Issues I picked up(need help to understand!) #20
Replies: 5 comments 25 replies
-
Sorry to disturb you @Moosems but you are the person that added more changes than me. Daresay, you added the MOST changes here. I need your ideas and opinions on this discussion. I forked the repo to make my own changes. I know that I will get scathing reviews of my changes, but I wish to offer a link to a new thing I have going there: im-coder-lg#1 Please, I have very good reasons for this move. |
Beta Was this translation helpful? Give feedback.
-
This is very intentional. It's generally considered bad UI and UX for the app to resize itself when it can be avoided. The update labels method was purpose made to be powerful yet simple.
No comment, I don't care too much how this is implemented.
I personally disagree with this. "Explicit is better than implicit". Star imports or
That's not too difficult of a fix, but more a bug.
A settings window could be arranged if we forced users to use a personal API token.
I think it's simplicity is one of the things that makes it better than all the other ones out there. |
Beta Was this translation helpful? Give feedback.
-
In general, when proposing changes, it's also better to make a lot of small PRs than one big one. It's far nicer to review a few than one massive one. |
Beta Was this translation helpful? Give feedback.
-
@Futura-Py/reviewers Damm guys its been a while 😭 |
Beta Was this translation helpful? Give feedback.
-
@Futura-Py/reviewers is this gonna affect us for Weather? I think we use One Call API 2.5, and on Sep 17, it will be deprecated. |
Beta Was this translation helpful? Give feedback.
-
So, it has been a long time and I finally understand OOP. But I noticed some lengthy code and personally annoying things. So I want to speak about these issues I picked up, and want to know why it is so. This way, we could make this app better(and faster than it already is).
.configure
part in theupdate_labels
method with the specific labels and frame in__init__
and changing the reference/call fromupdate_labels
tocreate-labels
orcreate-data
).requests.get
at once. Let me explain:I understand PyOWM as a module where it sends a request, gets the data back, and formats it for us. The data is initially in a dictionary, consisting of nested lists, sets and whatnot, and it is not only formatted but converted to various units. That is something we get from the raw method of
requests.get
and data formatting we used(data["main"]
).But why use PyOWM? I understand importing specific modules, but using
requests.get
and creating a method to transform raw data into refined data surely is a better choice. It could be specific for Imperial and Metric units, and using comprehension(* if "metric" else *
where asterisks are data) is not entirely on the readability scale.What I propose:
Remove PyOWM, and implement methods that transform the integers on its own. A bit complex to implement at face value, but it is easy to do so.
ttk.Label
part for the "Weather" text isn't centered properly.I might have more issues later, but let's try reasoning out on this and mutually agreeing on a fix.
Finally, this app could become something better than what it already is.
Beta Was this translation helpful? Give feedback.
All reactions