<commit_before># -*- coding: utf-8 -*-
"""
Created on Mon Sep 16 08:07:15 2013

@author: timidger
"""

import Tkinter
from threading import Thread
from Client import Client
from Deck import Deck
from Stack import Stack
from Hand import Hand
from Chat import Chat


class Display(Tkinter.Frame, object):
    def __init__(self, master):
        super(Display, self).__init__(master)
        self.start_screen()

    def start_screen(self):
        self.start_frame = Tkinter.Frame(self.master)
        self.ip_box = Tkinter.Entry(self.start_frame, text="hey")
        self.port_box = Tkinter.Entry(self.start_frame)
        self.name_box = Tkinter.Entry(self.start_frame)
        start_button = Tkinter.Button(self.start_frame)
        start_button.config(text = 'Start the game!',
                            command = self.start_game,)
        self.start_frame.grid()
        self.ip_box.grid()
        self.port_box.grid()
        self.name_box.grid()
        start_button.grid()

    def start_game(self):
        self.client = Client(int(self.port_box.get()), self.ip_box.get(),
                        self.name_box.get())
        Thread(name = "Destroy wait thread",
               target = self.wait_to_destroy).start()
        self.start_frame.destroy()
        self.deck = Deck(self.master, self.client)
        self.pile = Stack(self.master, self.client)
        self.hand = Hand(self.master, self.client)
        self.chat = Chat(self.master, self.client)

        self.deck.grid(column = 0, row = 1)
        self.pile.grid(column = 2, row = 1)
        self.hand.grid(column = 1, row = 0)
        self.chat.grid(column = 1, row = 1)

    def destroy(self):
        try:
            self.client.disconnect()
        #In case the window is closed before joining a server
        #This will be removed when the login info is modularlised
        except AttributeError:
            pass
        super(Display, self).destroy()

if __name__ == '__main__':
    root = Tkinter.Tk()
    root.wm_title("Mao: Version 1.0")
    main = Display(root)
    root.mainloop()<commit_msg>Fixed bug that tried to start a thread that was removed<commit_after># -*- coding: utf-8 -*-
"""
Created on Mon Sep 16 08:07:15 2013

@author: timidger
"""

import Tkinter
from threading import Thread
from Client import Client
from Deck import Deck
from Stack import Stack
from Hand import Hand
from Chat import Chat


class Display(Tkinter.Frame, object):
    def __init__(self, master):
        super(Display, self).__init__(master)
        self.start_screen()

    def start_screen(self):
        self.start_frame = Tkinter.Frame(self.master)
        self.ip_box = Tkinter.Entry(self.start_frame, text="hey")
        self.port_box = Tkinter.Entry(self.start_frame)
        self.name_box = Tkinter.Entry(self.start_frame)
        start_button = Tkinter.Button(self.start_frame)
        start_button.config(text = 'Start the game!',
                            command = self.start_game,)
        self.start_frame.grid()
        self.ip_box.grid()
        self.port_box.grid()
        self.name_box.grid()
        start_button.grid()

    def start_game(self):
        self.client = Client(int(self.port_box.get()), self.ip_box.get(),
                        self.name_box.get())
        self.start_frame.destroy()
        self.deck = Deck(self.master, self.client)
        self.pile = Stack(self.master, self.client)
        self.hand = Hand(self.master, self.client)
        self.chat = Chat(self.master, self.client)

        self.deck.grid(column = 0, row = 1)
        self.pile.grid(column = 2, row = 1)
        self.hand.grid(column = 1, row = 0)
        self.chat.grid(column = 1, row = 1)

    def destroy(self):
        try:
            self.client.disconnect()
        #In case the window is closed before joining a server
        #This will be removed when the login info is modularlised
        except AttributeError:
            pass
        super(Display, self).destroy()

if __name__ == '__main__':
    root = Tkinter.Tk()
    root.wm_title("Mao: Version 1.0")
    main = Display(root)
    root.mainloop()
{'fraction_non_alphanumeric': 0.113930226884606, 'fraction_numerical': 0.01122224932910466, 'mean_word_length': 2.3940397350993377, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3887422', 'n_tokens_mistral': 1320, 'n_tokens_neox': 1259, 'n_words': 307}