Skip to content

Commit

Permalink
Push v0.5.0 to release status
Browse files Browse the repository at this point in the history
  • Loading branch information
mishaturnbull committed Feb 14, 2018
1 parent 29018ad commit 5914355
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 12 deletions.
26 changes: 23 additions & 3 deletions __version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,33 @@
"""

__major__ = 0
__minor__ = 4
__patch__ = 5
__minor__ = 5
__patch__ = 0

__version__ = '.'.join(map(str, [__major__, __minor__, __patch__]))
__int_version__ = int(''.join(map(str, [__major__, __minor__, __patch__])))

__author__ = "Michael Turnbull"
__author_email__ = "mishaturnbull@gmail.com"

__url__ = "https://github.com/mishaturnbull/PySpeedTest"
__url__ = "https://github.com/mishaturnbull/PySpeedTest"

def is_version_greater(ver1, ver2, safe=True):
"""
Assumes ver1 and ver2 are both of the form a.b.c
"""
maj1, min1, pat1 = [int(i) for i in ver1.split('-')[0].split('.')]
maj2, min2, pat2 = [int(i) for i in ver2.split('-')[0].split('.')]

if safe:
prerels = ['alpha', 'beta', 'pre', 'test']
if any(p in ver1 for p in prerels):
return False

if maj1 > maj2:
return True
if min1 > min2:
return True
if pat1 > pat2:
return True
return False
8 changes: 4 additions & 4 deletions autoupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import shutil
import platform

from __version__ import __int_version__
from __version__ import __version__, is_version_greater

# give github a user-agent so they don't block our requests
AGENT = {'user-agent': 'Python-urllib/3.0'}
Expand All @@ -31,8 +31,7 @@ def has_update():
"https://api.github.com/repos/mishaturnbull/PySpeedTest/releases")
data = json.loads(versions.data)
latest_version = data[0]['tag_name']
latest_int_version = int(''.join(latest_version[1:].split('.')))
return latest_int_version > __int_version__
return is_version_greater(latest_version, __version__)

def get_download_url(filetype):
if filetype not in ['exe', 'zipball', 'tarball']:
Expand All @@ -56,7 +55,8 @@ def get_download_url(filetype):
def download_file(url):
local_filename = url.split('/')[-1]
http = urllib3.PoolManager(headers=AGENT)
with http.request('GET', url, preload_content=False) as r, open(local_filename, 'wb') as out_file:
with http.request('GET', url, preload_content=False) as r, \
open(local_filename, 'wb') as out_file:
shutil.copyfileobj(r, out_file)
return local_filename

Expand Down
13 changes: 13 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Back to main page](index.html)

# Table of contents
1. [Problems](#problems)
1.1 [Why can't I close the program?](#why-cant-i-close-the-program)

# Problems

## Why can't I close the program?

Typically, when you try to close the program, it will display an error message and say it can't be closed at this time. This error message was built in very much intentionally to help prevent leaving programs running in the background. The speed testing is conducted in a background "thread" -- that is, a kind of "helper program" -- controlled by the graphical menu. While the tester thread is either running its test or waiting for the next one, it doesn't accept any instruction from the menu. The only times it checks for input is immediately before and immediately after running tests. This means that if you close the menu without stopping the thread first, it has nothing to tell it to stop. If you do this repeatedly, you now have 10 test threads running on your computer. And you can't stop them. This is bad.

All you have to do to not get this is click `Stop` and wait for the display `Thread status: dead` before closing the program.
5 changes: 2 additions & 3 deletions docs/gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ Put that file somewhere you'll remember it, then double-click it to run. The pr

## Mac

***UPDATE 2018/02/08***: I tested it on a friend's Mac and found [multiple issues](https://github.com/mishaturnbull/PySpeedTest/issues/8). It doesn't work right now. I'm working on making it work. Hopefully it will work soon.
***UPDATE 2018/02/13***: I tested it on a friend's Mac and found [more issues](https://github.com/mishaturnbull/PySpeedTest/issues/15). It is hard to run right now. I am working on making easier to run.

Problem here. I don't have a Mac, so I can't test anything on them. I also can't compile single-file builds for them either. You'll be stuck executing the Python source until I can find a better solution -- which I am working on. In the mean time, you can do this:

1. Download the zip file from the left side of the screen
2. Unzip it
3. Open a terminal window in the extracted directory
4. Type `python gui.py`
3. Double-click the file called `mac_run_this.command`. You may have to allow apps from unidentified developers.

## Linux/\*nix

Expand Down
3 changes: 1 addition & 2 deletions mac_run_this.command
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
#!/usr/bin bash
python gui.py
python gui.py | output.log

0 comments on commit 5914355

Please sign in to comment.