Split travertino.properties#3209
Conversation
freakboy3742
left a comment
There was a problem hiding this comment.
Two comments:
- Agreed it makes sense for
shorthandto exist as a placeholder; are you anticipating thatcompositewill be a part ofshorthand? If not, then I'd suggest it might be worth pulling out directional into it's own class as well - Is there any need for the module-level
__init__aliases? Those would only be needed if the properties split was in the wild; but its not. In light of that, I'd rather expose a public interface of "import from where it's defined".
I am, yes — my idea was that It's not a strong preference, though.
Huh, I got my wires crossed and was thinking this was partly for backwards compatibility... but you're right, Toga <= 0.4.8 will never need to access any of these (except for |
Same. I wasn't sure how big
👍 |
Hopefully I haven't jinxed myself! |
|
...I'm now really confused how my local tests can pass despite the imports I missed. |
Stale |
Well, you were right. I found some time to start working on migrating the property aliasing down into Travertino, and while it's neither done nor presentable yet, I have enough to know that, with these additions plus
composite_property,properties.pywill probably end up longer thandeclaration.pywas to begin with!So here's a preemptive splitting.
__init__.pymaintains all the same symbols, so no imports break. Some bikeshedding could definitely be done on placement and naming, particularly:ImmutableListandChoicesdon't have a lot in common with each other, but they are both short classes used by properties; I could see grouping them intotypesorutilsor something.ImmutableList; it's not actually used anywhere yet except in Travertino's tests. And even once it is used, it probably won't be imported anywhere within Toga. But it is a type we'll be returning to users...validated_propertyandlist_propertytogether, as the latter is only a minor override. I've putdirectional_propertyin a file namedshorthand. In the draft forcomposite_property, I factored out a base class for directional and composite and named itproperty_alias. Especially in light of the alias and deprecations we're now supporting, I thinkshorthand_propertywould be a better name for it, and the three can live together.My in-progress work so far involves two classes:
paired_propertyhandles thealignment/align-itemssituation, where either one can be the source of truth and there's a translation process between them. This inherits fromvalidated_property.aliased_propertyis a standalone class that handles the "straight-through" aliases and deprecations, with the option to specify conditions in which it's valid.Since they conceptually share a goal, I'm thinking they could go together in a file, though I'm not sure what best to name it.
PR Checklist: