Skip to content

Add Windows support + bugs fixes - #47

Open
idanpa wants to merge 3 commits into
cslarsen:masterfrom
idanpa:master
Open

Add Windows support + bugs fixes#47
idanpa wants to merge 3 commits into
cslarsen:masterfrom
idanpa:master

Conversation

@idanpa

@idanpa idanpa commented May 13, 2019

Copy link
Copy Markdown

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.

@chillerno1 chillerno1 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Tested and working great.

@cslarsen cslarsen left a comment

Copy link
Copy Markdown
Owner

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.

Comment thread wpm/stats.py
game[0] = 1 + race
writer.writerow(game)

if os.path.exists(filename):

Copy link
Copy Markdown
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

Comment thread wpm/stats.py
tag = result[-1]
games[tag].append(result[:-1])
current_tag = tag
if len(row) == 9:

Copy link
Copy Markdown
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?

Comment thread wpm/screen.py
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
Copy Markdown
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")

Comment thread wpm/game.py
"""Characters per second."""
if self.start is None:
return 0
if not elapsed:

Copy link
Copy Markdown
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.

Comment thread wpm/game.py
if self.start is None:
return 0
if not elapsed:
return 0

Copy link
Copy Markdown
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.

Comment thread setup.py
name="wpm",
scripts=["scripts/wpm"],
entry_points = {
"console_scripts": ['wpm = wpm.commandline:main']

Copy link
Copy Markdown
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?

Comment thread setup.py
"""

import os
import sys

Copy link
Copy Markdown
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.

3 participants