Closed monkeez closed 4 years ago
Neat, but why does the context need a unit? :O
In case you want to evaluate in a time unit other than seconds. Should I rename the argument to timeUnit?
Or I could remove it and you'd just have to pass the time in the unit you want like in the second example:
with cmdx.DGContext(cmdx.Minutes(1)):
pass
Ah, yes of course. That makes sense.
with cmdx.DGContext(1, cmdx.Minutes):
pass
I think this reads the most clear.
Renamed UiUnit() to TimeUiUnit() for consistency
Better add an alias UiUnit = TimeUiUnit
to not break existing code.
Other than that, I think this looks good!
The other syntax, DGContext(cmdx.Minutes(1))
also works it looks like? I think that would be great as well, in case the value is being passed from some other function or is already an MTime.
That's correct, DGContext(cmdx.Minutes(1))
should already work.
UiUnit alias added.
Loving it.
Can I hand you permissions to merge and make releases for cmdx? It's a little tedious, but it'd help me out a lot. This time around, it would involve:
A release will be made to PyPI automatically from there.
Gotta run, but you can go ahead when ready. If not, no worries and I'll return to this later today.
Awesome, thanks. I'll take a look at this later today (Sydney time 😄). I might have some more questions about doing a release.
@mottosso do you still want me to do a release or should we wait for #24?
Let's make a release for every PR, keeps it bite-sized and without doubt about when to make releases. Please go ahead! :)
https://github.com/mottosso/cmdx/releases/tag/0.4.7
Great job. :)
AngleUiUnit()
andDistanceUiUnit()
UiUnit()
toTimeUiUnit()
for consistencyDGContext
now uses seconds by defaultDGContext
supports a unit argument for different time units