Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ENTER on macos #89

Closed
wants to merge 3 commits into from
Closed

Conversation

fleytman
Copy link
Contributor

After merge #79 in macos was broken enter. It's fix.

And i include #70

@coveralls
Copy link

Coverage Status

Coverage decreased (-3.2%) to 92.179% when pulling 0655497 on fleytman:fix_macos_keys into 5421325 on magmax:master.

@Cube707 Cube707 changed the title Fix macos keys Fix ENTER on macos Jul 31, 2022
Copy link
Collaborator

@Cube707 Cube707 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all, thanks for contributing, but your PR is not well formated.

Please keep your commits atomic (meaning each one should containe a single standalone change), so avoid commit that just fix a small mistake in a previos commit (like your last commit that just adds a missing \n). Please create a first commit for your refractoring of the if statements and than a second commit with your macos-fix.

Also your commit messages contain some random text. keep the first line short and descriptive and use the second line to give further explanations if necessary (see herer for more info). And only link other issues / PR's on commits that specifically fix them, not when the fix is mixed with other stuff.


Please remove #70 from this PR. I will take care of it once I have some time for it, but it is to complex and I don't know enought about macos to just handle it quick and dirty. For now this will have to stay a limitation (which is fine as MacOS is not supported anyway)

or platform == "darwin"
or platform.startswith("freebsd")
):
if platform.startswith(("linux", "darwin", "freebsd")):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thats a cool idea. very nice.

@@ -0,0 +1,4 @@
# common

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please import exsiting definitions from other files here

Suggested change
from ._posix_key import *

@@ -0,0 +1,4 @@
# common

CR = "\x0d"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is alread defined. no need to redefine it

Comment on lines +22 to +25
if sys.platform == "darwin":
ch = sys.stdin.readline(1)
else:
ch = sys.stdin.read(1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is defnetly to complex for me to just sign of on. Please remove #70 from this PR. I will decide if it makes sense to include it once I finde the time to get around to it.

from ._posix_key import *
elif platform.startswith("darwin"):
from ._posix_key import *
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like I said above, this should be part of the _mac_key.py file

Suggested change
from ._posix_key import *

@Cube707
Copy link
Collaborator

Cube707 commented Jul 31, 2022

I am not jet sure if I prefere the "proper" way of having a seperate file for mac, or if I am fine with a dirty override in the __init__ file (nobody needs a file with only one line...). I will have to sleep on that. leav it as is for now

@Cube707
Copy link
Collaborator

Cube707 commented Jul 31, 2022

also please rebase to current master, as some stuff changed in 77c1ac5

@Cube707
Copy link
Collaborator

Cube707 commented Jul 31, 2022

and do you have access to a mac? can you provide screenshot of the tests/manual-test.py file not working currently with ENTER but after the fix? That would be great for documentation.

@fleytman
Copy link
Contributor Author

fleytman commented Aug 2, 2022

Now my Mac uses \n, but I remember exactly what didn't work and was saved only by changing to \r. I think now you can close the MP, and if I reproduce there will already be additional data in what situation such a problem appears.

@fleytman fleytman closed this Aug 2, 2022
@Cube707
Copy link
Collaborator

Cube707 commented Aug 2, 2022

OK, thats weird 🤦🏼‍♂️
Definitely open a new issue if you can reproduce it 👍🏼

@Cube707
Copy link
Collaborator

Cube707 commented Aug 2, 2022

you can still open a PR for your refactoring of the if statements. Thats a nice idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants