Author terry.reedy
Recipients cheryl.sabella, terry.reedy
Date 2017-05-28.20:29:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1496003371.61.0.0539955460864.issue30495@psf.upfronthosting.co.za>
In-reply-to
Content
I believe you said elsewhere that you would like to try the refactoring that splits a window+frame class into a window class and a frame class. It would be great if you became good at doing this.

If the current class name is used externally, I might consider reusing it for the window class.  But since the external interface for textview is the two wrapper functions, 'TextView' is not used externally.

F:\dev\cpython\lib\idlelib\idle_test\test_textview.py: 3: Since all methods and functions create (or destroy) a TextViewer, which
F:\dev\cpython\lib\idlelib\idle_test\test_textview.py: 31: # If we call TextViewer or wrapper functions with defaults
F:\dev\cpython\lib\idlelib\idle_test\test_textview.py: 36: class TV(tv.TextViewer):  # Used in TextViewTest.
F:\dev\cpython\lib\idlelib\idle_test\test_textview.py: 73: # Call TextViewer with modal=False.
F:\dev\cpython\lib\idlelib\idle_test\test_textview.py: 88:         self.assertIsInstance(view, tv.TextViewer)
F:\dev\cpython\lib\idlelib\idle_test\test_textview.py: 93:         self.assertIsInstance(view, tv.TextViewer)
F:\dev\cpython\lib\idlelib\idle_test\test_textview.py: 113: # Call TextViewer with _utest=True.
F:\dev\cpython\lib\idlelib\pyshell.py: 895:             # XXX KBK 27Dec07 use TextViewer someday, but must work w/o subproc
F:\dev\cpython\lib\idlelib\textview.py: 11: class TextViewer(Toplevel):
F:\dev\cpython\lib\idlelib\textview.py: 78:     """Create TextViewer for given text.
F:\dev\cpython\lib\idlelib\textview.py: 87:     return TextViewer(parent, title, text, modal, _utest=_utest)
F:\dev\cpython\lib\idlelib\textview.py: 91:     """Create TextViewer for text in filename.
F:\dev\cpython\lib\idlelib\textview.py: 116:     run(TextViewer)

So lets try TextviewWindow and TextviewFrame.  Make the obvious substitutions, except in the PyShell and line 78 and 91 comments, 'TextViewer' should become a generic 'text viewer' that would apply to TextviewFrame if that became the main entry point.

If you want to show me an incomplete patch, you can still upload diffs here.
History
Date User Action Args
2017-05-28 20:29:31terry.reedysetrecipients: + terry.reedy, cheryl.sabella
2017-05-28 20:29:31terry.reedysetmessageid: <1496003371.61.0.0539955460864.issue30495@psf.upfronthosting.co.za>
2017-05-28 20:29:31terry.reedylinkissue30495 messages
2017-05-28 20:29:30terry.reedycreate