petereon / beaupy

A Python library of interactive CLI elements you have been looking for
https://petereon.github.io/beaupy/
MIT License
200 stars 13 forks source link

Switching to yakh for stdin handling #40

Closed petereon closed 1 year ago

petereon commented 1 year ago

Third attempt to get a satisfactory sys.stdin handling with the features I am hoping for while trying my absolute best to cause as little mess as I thinkably can.

petereon commented 1 year ago

Should resolve #37 and #38

petereon commented 1 year ago

TODO: manual testing on Windows and Linux

codecov-commenter commented 1 year ago

Codecov Report

Merging #40 (15bbb21) into master (82ddf6c) will decrease coverage by 0.23%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #40      +/-   ##
==========================================
- Coverage   98.47%   98.23%   -0.24%     
==========================================
  Files           5        3       -2     
  Lines         328      284      -44     
  Branches       77       81       +4     
==========================================
- Hits          323      279      -44     
  Partials        5        5              
Flag Coverage Δ
unittests 98.23% <100.00%> (-0.24%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
beaupy/_beaupy.py 97.76% <100.00%> (-0.02%) :arrow_down:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Cube707 commented 1 year ago

just FYI, the sourcecode of this new package is functional identical to readchar, it even uses the same stackoverflow and gist post as reference XD

Cube707 commented 1 year ago

the use of the regex to check for escape-sequences is a fancy idea though

petereon commented 1 year ago

Yeah, it's fairly similar, I am not saying I haven't peeked into readchar several times, standing on the shoulders of giants so to say. But maan was it painful to get it to work with both ESC key and COPY-PASTING - with blocking stdin read it was either-or scenario. Nevertheless, I decided to go with non-blocking and handling nasty cases myself, having to abandon all the dignity in form of performance considerations and software design. But it is what it is :laughing: