fastkml
fastkml copied to clipboard
Refactor times.py
Refactor times to use the registry.
- Add new classes
When,BeginandEnd - Remove the
etree_elementand_get_kwargsmethods fromTimeStampandTimeSpan - Add new function following the
GetKWArgsProtocol to parse theKmlDateTimefrom XML - Add new function following the
SetElementProtocol to create theetreerepresentation - Register the functions for the new classes
TimeStampto optionally take the abovewhenTimeSpanto optionally takebeginandend
Hi @cleder, I'm interested in working on this issue. Can you please assign it to me?
Thanks
Thanks @rishitc
Hi @cleder, I want to update you that I'm working on this. Progress is a bit slow, but I hope to have an initial patch soon.
Thanks
Can you document how to do it? For me, it is obvious, so I need an outsider's view on it to improve the documentation :wink:
BTW, make a draft pull request, ask questions, I am happy to provide some guidance
Hi @cleder,
Can you document how to do it? For me, it is obvious, so I need an outsider's view on it to improve the documentation 😉
Sure, I can work more on that as part of the #343
BTW, make a draft pull request, ask questions, I am happy to provide some guidance
Thank you so much 😄 I'll put up my draft PR by Saturday 👍
Hi @cleder,
In the file fastkml/times.py, TimeSpan already optionally accepts a begin and end of type Optional[KmlDateTime], so I think that sub-task is already taken care of, correct?
@cleder, also the new classes When, Begin, and End must derive from _TimePrimitive so that they can access the super()._get_kwargs and super().etree_element methods, correct?
I am not sure what you are trying to say, can you make a draft PR?
Sounds good, I'll put up my draft PR in the next hour 👍
Hi @cleder, My draft PR is up 🎉
Also, here's the current checklist status of my PR:
- [x] Add new classes
When,BeginandEnd - [x] Remove the
etree_elementand_get_kwargsmethods fromTimeStampandTimeSpan - [ ] Add new function following the
GetKWArgsProtocol to parse theKmlDateTimefrom XML- The new classes will need to import from
_TimePrimitiveto support this, right?
- The new classes will need to import from
- [ ] Add new function following the
SetElementProtocol to create theetreerepresentation- The new classes will need to import from
_TimePrimitiveto support this, right?
- The new classes will need to import from
- [ ] Register the functions for the new classes
- [x]
TimeStampto optionally take the above when - [x]
TimeSpanto optionally take begin and end- I think this has already been completed in an older commit.
Hi @cleder,
I took a look at the changes in https://github.com/cleder/fastkml/commit/6e4dba115107b403af88afe0fc073cfe6f52afdc and the changes look good 👍
I'll learn more about the codebase to work on issues faster next time.
Thanks for your patience and guidance as I worked through the issue.
Thanks