-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean RecCard #132
Clean RecCard #132
Conversation
gourmet/reccard.py
Outdated
self.rec_display: Optional[RecCardDisplay] = None | ||
self.conf: List = [] | ||
self.new: bool = True if recipe is None else False | ||
self.current_rec: 'RowProxy' = recipe if recipe else self.rec_gui.rd.new_rec() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all, good work! Also on the set_
and get_
translations.
Second: Are all these attributes to be "written" by other methods? Some of these look like they should be hidden via double-underscores, others are functional or read-only and could be properties. Do you have any deeper insight?
If we can slim the interface down even further, it would be great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not keen to tackle that, but doing so revealed that RecCard.conf
is a leftover from a previous architecture, and can be removed!
A more in-depth refactoring is needed to remove it
I spoke too soon: gourmet/gourmet/GourmetRecipeManager.py Lines 439 to 444 in 40e911a
The rest is okay, though |
If there are no further comments, I'll merge in a few hours, thanks! |
This is a follow-up of #130.
Here, we're cleaning the
RecCard
class by adding annotations, removing unreachable code, and modernising properties decorators.rec_gui
, formelyrg
, is neverNone
, a fact that was highlighted by the fact that the conditional import doesn't even work, thus removed.