CSSG-Labs / PyNote

Text Editor Written in Python
GNU General Public License v3.0
3 stars 4 forks source link

custom prompt class creation #24

Closed AdamLaine closed 2 years ago

AdamLaine commented 2 years ago

Issue #18 I've created the custom prompt generator. In the comments it is written how to use it. Can be used in the future for the "open", "save" and etc things as any options may be provided to it. There is also inside a small testing program

AdamLaine commented 2 years ago

@mrHeavenli It's mostly done to show the workings of the thing (and to have an example for the future usage, because it may happen that a person using it will not know well how to use lambda, for example). In case it is not needed, I think during merge it can manually be deleted (or in case I am asked I'll do it myself). Anyway, 'if name == "main"' makes it usable only if the code is called directly, as in every other case the class will imported, so I don't see that much of a problem. I suggest to keep it as an example for now. I'm thinking maybe some better documentation can be done to make the example obsolete?

mrHeavenli commented 2 years ago

It's not a big problem, I know it won't be executed or cause any problems. On the other hand, I also don't think we should keep code that won't be used.

I'm thinking maybe some better documentation can be done to make the example obsolete?

Sounds good!

PatrickBruso commented 2 years ago

@SamReiCooper @mrHeavenli I'll take a look at this tomorrow. I probably go more towards removing the name == main bit as mrHeavenli said. I would suggest instead documenting the class via a docstring to explain how the class works and possible including some tests via unittest.

I view this project more as learning as we proceed so I'm not super strict about doing things the "correct" way from the beginning, and feel like we can add tests/docstrings later on to strengthen the code. For now, unless @SamReiCooper wants to update the file with a docstring to explain the class usage, I'm fine leaving in the last section because as stated it won't be called if the module is imported and shouldn't affect the program.

AdamLaine commented 2 years ago

@PatrickBruso @mrHeavenli Alright mates. Now it is documented. Tell me if the documentation is sufficiently clear in explaining the functionality and usage of the thing