-
Notifications
You must be signed in to change notification settings - Fork 50
Conversation
|
@sagarmanchanda is this what you envisioned in terms of the shim-based singleton design? |
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.
Looks good. This is exactly what I was thinking.
Although we should now think about the folder structuring too.
src
|____microbit
_____|____tests
_____|____microbit_model
__________|____microbit_model.py
__________|____display # Could be a folder if it has multiple files, otherwise just files in root
_____|____shim.py
_____|____init.py
What do you guys think about the folder structuring?
|
@sagarmanchanda I think that that directory structure sounds good! I'll try to incorporate that into the upcoming work. Also, I was thinking that it might be better to replace in src/microbit/code_processing_shim.py with
To reduce repetition with static methods mapping to actual object methods. I believe that the new version uses pass-by-reference in order to assign a simple global "display" object with the microbit model's display. What do you think? |
|
|
||
| # EXAMPLE | ||
| # can be called simply as "show_message("string")" | ||
| def show_message(message): |
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.
That's awesome, it was exactly what I was thinking as well :)
|
@andreamah Good catch! Totally makes sense to directly use the methods rather than creating static mappings. |
|
Also thanks for doing this sample implementation! Good job. :) |
|
no intention to merge these changes yet, will ping coaches with new changes when it comes up |
DON'T MERGE; just an small-scale example of the python microbit model design (as requested by coaches)