-
Notifications
You must be signed in to change notification settings - Fork 49
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
There was a problem hiding this 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): |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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: |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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'] |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
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.