<commit_before>#!/usr/bin/env python

import Tkinter as tk
import praw
import xml.etree.cElementTree as ET

class RedditApp(tk.Frame):

    def __init__(self, master=None):
        tk.Frame.__init__(self, master)
        self.grid()
        self.createWidgets()
        
        # Make a connection to reddit and get the user
        self.r = praw.Reddit(user_agent='Reddit App made by Aodh')
        self.user = self.r.get_redditor('Unidan')         

    def createWidgets(self):
        self.quitButton = tk.Button(self, text='Quit', command=self.quit)
        self.quitButton.grid(column=1)
        
        self.label1 = tk.Label(self, text='Label')
        self.label1.bind('<Button-1>', self.setupUserData)
        self.label1.grid()

    def setupUserData(self, event):  
        gen = self.user.get_submitted(limit=5)
        for x in gen:
            print x

# Main application entry point
def main():
    app = RedditApp()
    app.master.title('RedditApp')
    app.mainloop()
    
# Standard main function
if __name__ == '__main__':
       main()<commit_msg>Added textbox to prompt user for a username. Currently prints the users top 2 submissions<commit_after>#!/usr/bin/env python

import Tkinter as tk
import praw
import xml.etree.cElementTree as ET

class RedditApp(tk.Frame):

    def __init__(self, master=None):
        tk.Frame.__init__(self, master)
        self.grid()
        self.createWidgets()
        
        # Make a connection to reddit
        self.r = praw.Reddit(user_agent='Reddit App made by Aodh')    

    def createWidgets(self):
        self.quitButton = tk.Button(self, text='Quit', command=self.quit)
        self.quitButton.grid(column=1)
        
        self.usernameInput = tk.Entry(self);
        self.usernameInput.insert(0, 'Type Username Here');
        self.usernameInput.grid(column=2)
        
        self.button = tk.Button(self, text='Login')
        self.button.bind('<Button-1>', self.setupUserData)
        self.button.grid(column=3)

    def setupUserData(self, event): 
        username = self.usernameInput.get()
        self.user = self.r.get_redditor(username)
        
        gen = self.user.get_submitted(limit=5)
        for x in gen:
            print x

# Main application entry point
def main():
    app = RedditApp()
    app.master.title('RedditApp')
    app.mainloop()
    
# Standard main function
if __name__ == '__main__':
       main()
{'fraction_non_alphanumeric': 0.11447532144338449, 'fraction_numerical': 0.005391953546246371, 'mean_word_length': 2.4905933429811866, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '705120', 'n_tokens_mistral': 774, 'n_tokens_neox': 758, 'n_words': 176}