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

Add Windows support + bugs fixes #47

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

idanpa
Copy link

@idanpa idanpa commented May 13, 2019

Using the recommended approach for calling the main script (which supports windows).

Fix some bugs that arose when testing on native Windows, Python 3.7.

Copy link

@chillerno1 chillerno1 left a comment

Choose a reason for hiding this comment

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

Tested and working great.

Copy link
Owner

@cslarsen cslarsen left a comment

Choose a reason for hiding this comment

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

Sorry for the long wait, but if you fix these I will pull the PR.

@@ -254,4 +255,6 @@ def save(self, filename):
game[0] = 1 + race
writer.writerow(game)

if os.path.exists(filename):
Copy link
Owner

Choose a reason for hiding this comment

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

Please remove this or put into another PR

tag = result[-1]
games[tag].append(result[:-1])
current_tag = tag
if len(row) == 9:
Copy link
Owner

Choose a reason for hiding this comment

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

What's going on here?

@@ -150,7 +150,7 @@ def lines(self):

def set_colors(self):
"""Sets up curses color pairs."""
hicolor = os.getenv("TERM").endswith("256color")
hicolor = os.getenv("TERM").endswith("256color") if os.getenv("TERM") else None
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
hicolor = os.getenv("TERM").endswith("256color") if os.getenv("TERM") else None
hicolor = os.getenv("TERM", "").endswith("256color")

return min((60.0 * self.position / 5.0) / elapsed, 999)

def cps(self, elapsed):
"""Characters per second."""
if self.start is None:
return 0
if not elapsed:
Copy link
Owner

Choose a reason for hiding this comment

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

I see why you do this, but I'd prefer to have it in a separate PR.

@@ -125,12 +125,16 @@ def wpm(self, elapsed):
"""Words per minute."""
if self.start is None:
return 0
if not elapsed:
return 0
Copy link
Owner

Choose a reason for hiding this comment

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

Please put in another PR, this is unrelated to windows support.

@@ -26,7 +27,9 @@ def get_version():

setup(
name="wpm",
scripts=["scripts/wpm"],
entry_points = {
"console_scripts": ['wpm = wpm.commandline:main']
Copy link
Owner

Choose a reason for hiding this comment

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

Will entry_points interfere with non-Windows systems?

@@ -12,6 +12,7 @@
"""

import os
import sys
Copy link
Owner

Choose a reason for hiding this comment

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

Is this used in the file?

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.

None yet

3 participants