Skip to content

Commit

Permalink
- added an error message for import error on the run_server command, …
Browse files Browse the repository at this point in the history
…and a flush=True on the last print - this results in output in the GUI for the run server command but

- https.serve_forever() in the run_server function still leaves the GUI with no way to return other than “Close”
  • Loading branch information
photomedia committed Sep 6, 2018
1 parent 8487286 commit ae5cf69
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fluentdnagui.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,14 @@ def query_yes_no(question, default='yes'):

def run_server(home_directory):
try:
print("Setting up HTTP Server based from", home_directory)
from http import server
from socketserver import TCPServer
except ImportError: # Python 2 imports
print("Import error, trying with Python 2")
import SimpleHTTPServer as server
from SocketServer import TCPServer

print("Setting up HTTP Server based from", home_directory)
os.chdir(home_directory)

ADDRESS = "127.0.0.1"
Expand All @@ -109,10 +110,11 @@ def run_server(home_directory):
handler = server.SimpleHTTPRequestHandler
httpd = TCPServer((ADDRESS, PORT), handler)

print("Open a browser at http://%s:%s" %(ADDRESS, str(PORT)))
print("Open a browser at http://%s:%s" %(ADDRESS, str(PORT)), flush=True)
httpd.serve_forever()



def done(args, output_dir):
"""Ensure that server always starts when requested.
Otherwise system exit."""
Expand Down

0 comments on commit ae5cf69

Please sign in to comment.