-
-
Notifications
You must be signed in to change notification settings - Fork 15
Joyful Jaguars #36
base: master
Are you sure you want to change the base?
Joyful Jaguars #36
Conversation
- Added the files related to the EditorWindow class.
The former was done in order to avoid conflict with other potential test files in the same directory, and the latter to abide by PEP8.
- A tkinter.Text widget for entering text. - The method 'get_text' which other classes can use to access the contents of the text box in the editor window. Added code to test_editor_window.py for basic testing purposes.
- Added a menu bar to EditorWindow. Added three menus: File, Edit and Help. Implemented rudimentary code for opening and saving files. 'Save As' is commented out for now and will be implemented later. - Changed EditorWindow to a tk.Toplevel object as this seemed more appropriate for it. - Switched to using grid instead of pack inside EditorWindow. - Added set_text method to EditorWindow. Other objects can use this to alter the text inside the editor's text box. - Changed test_editor_window.py to run root.mainloop() instead of editor_window.mainloop(). Also hid the root window, and added some code for closing the root window when the editor window closes. - Various clean ups to comments and code throughout to improve wording and confirmation to linting rules.
Updated EditorWindow and test_editor_window
- Added right click context menus in the editor text box - Added a scroll bar to editor window. - Moved testing files into their own directory. - Implemented cut/copy/paste functionality. - Added methods to EditorWindow for getting and setting selected text, selected text indexes, the current word under/closest to the mouse/ a pixel position/a given index. - Added an event that is emitted every time the user types a word. The definitions for these are in a new file called editor_window_events.py. - Altered test_editor_window.py for testing the new word event. Check this for example. - Added the functionality directory along with the basic Event, Constants and Clipboard object. Clipboard object is currently unused as clipboard related code is relying on tkinter's own clipboard functionality. However, this object could come in handy later on i.e. for handling copy/cut/paste history/interception.
Updated EditorWindow and test_editor_window
Added basic spellchecking functionality
Fixed word detection to take into account apostrophes.
- Made the code for handling apostrophes a little clearer. It now uses the pairwise function to a new file called utility.py in the functionality folder. - Changed test_editor_window.py. Left clicking on a word in the window now underlines it. - Changed the documentation for EditorWindow.get_word_under_mouse to more accurately describe what values it returns.
Unneeded file
Cleaned up editor code, updated editor branch with changes from master.
- CloppyWindow is intended to be used as a dialog for asking the user for some input. Currently there are two subclasses of it: CloppyButtonWindow and CloppyInputWindow - One for multi-choice questions with buttons, the other for direct text input from the user. - Each CloppyWindow has a choice_made event to which callbacks can be assigned. It communicates the choice made with the callbacks by sending them a CloppyWindowChoiceMadeEventData object. - Added some constants for Cloppy's image and greeting. - Added settings window stub file. - Move around a bit of code in editor_window.py to make it cleaner, plus a comment to indicate that '\x08' is the character code for backspace.
- Removed whitespace on empty line in cloppy_window_events.py - Removed extra empty line at end of constants.py
- Added keyboard handling to CloppyButtonWindow for navigating choices. - Made CloppyWindow appear in the center of the editor's text box. - Changed EditorWindow to show a Cloppy dialog every time the user tries to erase some text. - Added some commentary to CloppyWindow. - Added a different version of the Cloppy image with a slightly rotated right eyebrow.
- Added more commentary to CloppyButtonWindow and CloppyTextInputWindow. - Fixed some issues with .flake8 file.
- Added keyboard handling to CloppyButtonWindow for navigating choices. - Made CloppyWindow appear in the center of the editor's text box. - Changed EditorWindow to show a Cloppy dialog every time the user tries to erase some text. - Added some commentary to CloppyWindow. - Added a different version of the Cloppy image with a slightly rotated right eyebrow.
- Added more commentary to CloppyButtonWindow and CloppyTextInputWindow. - Fixed some issues with .flake8 file.
- Added basic About dialog. - Changed .gitignore to ignore .idea files.
- Added a time limit option to CloppyWindow - Added a convenience function to CloppyWindow for creating Yes/No dialogs.
Merging remaining commits before finalization.
# Conflicts: # project/functionality/constants.py # project/windows/editor_window.py
Merge remaining commits before finalization.
- Added a CloppyWindow for handling spelling mistakes - shows up when a word is misspelled. - Fixed a lot of linting issues. - Fixed a misspell related bug with regards to a TypeError when picking random consonants from possible consonants. - Added a Cloppy dialog for exiting/closing the program. - Various bug fixes and commentary clean ups. - Added start script to pipfile
Finalization work.
Emergency patch to misspell.py
- Added some commentary - Removed security_window.py and spelling_window.py - Prepping the readme.
patch still has bug
- More commentary. - Filled in the readme.
Finalization
Added playsound to pipfile.
This project looks very cool and I can't wait to try it out on Sunday. Your documentation was fantastic, both docstrings and comments were very detailed. You've used modern parts of Python, including one of my favourite libraries pathlib, though there were a couple of places where you were using string when you could have used pathlib. There was a place where you had code like: else:
continue after an A few improvements could be made with error handling since some just printed an exception and others were just silently dropped. Also some inconsistency with quote types. I'll try add GitHub comments onto some of the things I've recorded here. Overall a very fun looking project! |
crop_length += len(extra.letters) + len(grapheme.letters) | ||
# Crop the word since we've already processed some letters | ||
word = word[crop_length:] | ||
else: |
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.
This is the no-op I was talking about.
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.
Yeah, I remembered I had something like that in the spelling code and I just forgot to get rid of it.
) | ||
|
||
# The path to the picture of Cloppy used in CloppyWindow | ||
cloppy_picture_path = str(resources_path/'cloppy.png') |
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.
Missed opportunity to use pathlib.
|
||
# The path to the audio of Cloppy used in CloppyWindow | ||
cloppy_sound_path = str( | ||
resources_path/'321947__n-audioman__horseneigh02-03.wav' |
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.
Again, could be pathlib.
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.
These were both originally just Path objects, but then it turned out that the playsound
module can only take a string as input. I switched cloppy_picture_path to a string as well for consistency.
The completed Joyful Jaguars code jams submtion (Text editor)