-
Notifications
You must be signed in to change notification settings - Fork 65
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
issue-51-telegram refactored TelegramParser.parse to return Telegram … #121
Conversation
…object. Telegram object now does not do parsing anymore.
…e telegram attributes instead of keys;
we need a |
hi Nigel, why do you rewrite The same pattern can then be applied to the MBusDevice, as it also needs to be printable, iterable and jsonizable. Best, Hans Erik |
I've mainly refactored it because i removed I'm not sure if i like using the class attributes themselves for everything. It will probably by default expose all attributes of the class even the 'private' ones. I could maybe work around that for _mbus_devices, but i'd rather just have more visibility and control over it. |
No, The idea was to only expose the object attributes that are listed in What is the reason for using the |
I added getitem to have some form of backwards compatibility. I could remove it, but that would mean the refactor gets even bigger by having to update all unit tests as well. Made some progress again:
Edit: we could decide to fully remove all the key logic and only use attribute based method. Then release it as 2.0.0 (which we probably should anyway due to backwards compatibility issues) Edit2: made the Telegram fully compatible with the current dictionary. Replaced |
Refactored TelegramParser.parse to return Telegram object. Telegram object now does not do parsing anymore.