Bug 226024 - [webkitcorepy] Add shared terminal input code
Summary: [webkitcorepy] Add shared terminal input code
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-05-20 09:14 PDT by Jonathan Bedard
Modified: 2021-08-04 10:59 PDT (History)
6 users (show)

See Also:


Attachments
Patch (15.35 KB, patch)
2021-05-20 09:19 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (15.76 KB, patch)
2021-05-21 16:44 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (19.46 KB, patch)
2021-06-14 10:56 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (18.70 KB, patch)
2021-07-28 13:59 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (24.15 KB, patch)
2021-08-03 17:20 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch for landing (19.39 KB, patch)
2021-08-04 10:26 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Bedard 2021-05-20 09:14:28 PDT
Python 2 and 3 have slightly different stdin input functions, we should have shared code that centralizes these differences. In developing https://bugs.webkit.org/show_bug.cgi?id=225985, I found myself building a Yes/No command line input picker multiple times, that seems like something that should be shared as well.
Comment 1 Radar WebKit Bug Importer 2021-05-20 09:15:39 PDT
<rdar://problem/78261645>
Comment 2 Jonathan Bedard 2021-05-20 09:19:29 PDT
Created attachment 429178 [details]
Patch
Comment 3 Jonathan Bedard 2021-05-21 16:44:23 PDT
Created attachment 429362 [details]
Patch
Comment 4 Jonathan Bedard 2021-06-14 10:56:36 PDT
Created attachment 431344 [details]
Patch
Comment 5 Jonathan Bedard 2021-07-28 13:59:37 PDT
Created attachment 434461 [details]
Patch
Comment 6 Jonathan Bedard 2021-08-03 17:20:04 PDT
Created attachment 434873 [details]
Patch
Comment 7 dewei_zhu 2021-08-04 10:02:58 PDT
Comment on attachment 434461 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=434461&action=review

r=me

> Tools/Scripts/libraries/webkitcorepy/webkitcorepy/terminal.py:32
> +    def choose(cls, prompt, options=None, default=None, strict=False, numbered=False):

Is this used any where other than unit tests?
Comment 8 Jonathan Bedard 2021-08-04 10:03:58 PDT
(In reply to dewei_zhu from comment #7)
> Comment on attachment 434461 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=434461&action=review
> 
> r=me
> 
> > Tools/Scripts/libraries/webkitcorepy/webkitcorepy/terminal.py:32
> > +    def choose(cls, prompt, options=None, default=None, strict=False, numbered=False):
> 
> Is this used any where other than unit tests?

Not yet, but https://bugs.webkit.org/show_bug.cgi?id=225985 uses it. Patch for that change is up, needs some clean up before review, though.
Comment 9 Jonathan Bedard 2021-08-04 10:15:22 PDT
Comment on attachment 434461 [details]
Patch

Need to bump webkitcorepy version.
Comment 10 Jonathan Bedard 2021-08-04 10:26:23 PDT
Created attachment 434911 [details]
Patch for landing
Comment 11 EWS 2021-08-04 10:58:59 PDT
Committed r280640 (240253@main): <https://commits.webkit.org/240253@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 434911 [details].