Skip to content

Commit

Permalink
Update version number and add error message box
Browse files Browse the repository at this point in the history
  • Loading branch information
Qirky committed Nov 8, 2018
1 parent f318ec2 commit 8c7292b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 34 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Troop v0.7.5
# Troop v0.8

## Real-time collaborative live coding

Expand All @@ -10,15 +10,15 @@ Troop is compatible with both Python 2 and 3, which can be downloaded from [here

## Getting started

There are two ways of using Troop; one is to download the latest release and run it as you would any other program on your computer, and the other is two run the files using Python. The first option does not require Python to be installed on your machine, but you do need to have correctly configured your live coding language of choice first.
There are two ways of using Troop; one is to download the latest release and run it as you would any other program on your computer, and the other is two run the files using Python. The first option does not require Python to be installed on your machine, but you do need to have correctly configured your live coding language of choice first e.g. FoxDot, which uses Python to run.

#### Using the downloadable executable

1. Download the latest version for your appropriate operating system [from this page](https://github.com/Qirky/Troop/releases).
2. Double-click the program to get started or run from the command line with arguments as you would below e.g.

```
Troop-Windows-0.7.4-client.exe --mode TidalCycles
Troop-Windows-0.8.0-client.exe --mode TidalCycles
```

#### Running the Python files
Expand Down
3 changes: 2 additions & 1 deletion src/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class Client:

version = '0.7'
version = '0.8'
ui = None
send = None
recv = None
Expand All @@ -30,6 +30,7 @@ def __init__(self, **kwargs):
# Start the UI

self.input = ConnectionInput(self, **kwargs)
self.input.start()

def setup(self, host="", port="", name="", password="", lang=FOXDOT, logging=False, ipv6=False):

Expand Down
35 changes: 18 additions & 17 deletions src/interface/conn_info.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
try:
import Tkinter as Tk
import tkMessageBox
except ImportError:
import tkinter as Tk
from tkinter import messagebox as tkMessageBox

from .interface import ROOT

Expand Down Expand Up @@ -57,24 +59,20 @@ def __init__(self, client, get_info=True, **kwargs):
# Enter shortcut
self.root.bind("<Return>", self.cleanup)

self.start() # run

else:

self.finish() # skip getting info if we have it already

def start(self):
# Start
self.center()
self.mainloop()

if self.using_gui_input:
self.center()
self.mainloop() # calls finish from the OK button
else:
self.finish()

def mainloop(self):
try:
self.client.mainloop_started = True
self.root.mainloop()
except KeyboardInterrupt:
self.client.kill()
if self.client.mainloop_started is False:
try:
self.client.mainloop_started = True
self.root.mainloop()
except KeyboardInterrupt:
self.client.kill()
return

def quit(self):
Expand Down Expand Up @@ -125,7 +123,10 @@ def get_info(self):

def exit(self, message):
""" Exits the interface with an input box but using sys.exit if -i flag was given """
import sys
err = "Fatal error: {}. Aborting.".format(message)
if self.using_gui_input:
pass # bell
tkMessageBox.showerror("Error", err)
else:
sys.exit(message)
print(err)
sys.exit()
14 changes: 1 addition & 13 deletions src/interface/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ class BasicInterface:
""" Class for displaying basic text input data.
"""
def __init__(self):
# self.root=Tk()
self.root = ROOT
self.root.configure(background=COLOURS["Background"])

Expand All @@ -58,19 +57,8 @@ def run(self):
""" Starts the Tkinter loop and exits cleanly if interrupted"""
# Continually check for messages to be sent
self.client.update_send()

self.update_graphs()

if not self.client.mainloop_started:

try:

self.root.mainloop()

except KeyboardInterrupt:

self.client.kill()

self.client.input.mainloop()
return

def kill(self):
Expand Down

0 comments on commit 8c7292b

Please sign in to comment.