def __init__(self, parent, controller, **kwargs):
        tk.Frame.__init__(self, parent, **kwargs)
        self.controller = controller
        self.configure(bg=theme.background_color)
        self.grid_rowconfigure(1, weight=1)
        self.grid_columnconfigure(0, weight=1)
        self.grid_columnconfigure(1, weight=1)

        # labels
        self.reddit_label = common.Label(self, text="Download from Reddit")
        self.reddit_label.grid(columnspan=2, sticky="new")
        self.start_label = common.Label(self,
                                        text="Start Date and (optional) Time")
        self.start_label.grid(column=0, row=1, sticky="new")
        self.end_label = common.Label(self,
                                      text="End Date and (optional) Time")
        self.end_label.grid(column=0, row=2, sticky="new")
        self.subs_label = common.Label(self, text="Subreddit(s), one per line")
        self.subs_label.grid(column=0, row=3, sticky="new")
        self.name_label = common.Label(self, text="Corpus Name")
        self.name_label.grid(column=0, row=4, sticky="new")

        self.start_entry = common.Entry(self)
        self.start_entry.grid(column=1, row=1, sticky="new")
        self.end_entry = common.Entry(self)
        self.end_entry.grid(column=1, row=2, sticky="new")
        self.subs_entry = tk.Text(self)
        self.subs_entry.grid(column=1, row=3, sticky="new")
        self.name_entry = common.Entry(self)
        self.name_entry.grid(column=1, row=4, sticky="new")

        # button
        bottom_frame = tk.Frame(self)
        bottom_frame.configure(bg=theme.background_color_accent)
        bottom_frame.grid(column=0, columnspan=2, sticky="nesw")
        bottom_frame.grid_columnconfigure(0, weight=1)
        bottom_frame.grid_columnconfigure(2, weight=1)

        self.download_button = common.Button(
            bottom_frame,
            command=self.download,
            text="Download",
        )
        self.download_button.configure(padx=10, pady=5)
        self.download_button.grid(column=1, row=4, sticky="sew")
        self.download_in_progress = False

        self.download_progress = ttk.Progressbar(bottom_frame,
                                                 orient=tk.HORIZONTAL,
                                                 length=100,
                                                 mode="indeterminate")
    def __init__(self, parent: tk.Frame, controller: "App", **kwargs: Any):
        tk.Frame.__init__(self, parent, **kwargs)
        self.controller = controller
        self.configure(bg=theme.background_color)
        self.grid_rowconfigure(1, weight=1)
        self.grid_columnconfigure(0, weight=1)
        self.grid_columnconfigure(1, weight=1)

        # labels
        self.corpus_label = common.Label(self, text="Select a Corpus")
        self.corpus_label.grid(column=0, row=0, rowspan=1, sticky="sew")
        self.lexicon_label = common.Label(
            self, text="Select Lexica (click to select multiple)")
        self.lexicon_label.grid(column=1, row=0, rowspan=1, sticky="sew")

        self.corpus_listbox = common.Listbox(self, exportselection=0)
        self.corpus_listbox.grid(column=0, row=1, sticky="nsew")

        self.lexicon_listbox = common.Listbox(self,
                                              selectmode="multiple",
                                              exportselection=0)
        self.lexicon_listbox.grid(column=1, row=1, sticky="nsew")

        self.corpus_names: List[str] = []
        self.lexicon_names: List[str] = []

        self.controller.corpora.subscribe(self.update_corpora)
        self.controller.lexica.subscribe(self.update_lexica)

        # button
        bottom_frame = tk.Frame(self)
        bottom_frame.configure(bg=theme.background_color_accent)
        bottom_frame.grid(column=0, columnspan=2, sticky="nesw")
        bottom_frame.grid_columnconfigure(0, weight=1)
        bottom_frame.grid_columnconfigure(2, weight=1)

        report_name_label = common.Label(bottom_frame, text="Report Name:")
        report_name_label.grid(column=0, row=0)

        self.report_name_entry = common.Entry(bottom_frame)
        self.report_name_entry.grid(column=1, row=0, sticky="ns")

        report_params_button = common.Button(
            bottom_frame,
            command=self.create_report,
            text="Confirm Selections",
        )
        report_params_button.grid(column=2, row=0, sticky="ns")

        report_params_button.configure(padx=10, pady=5)
Exemple #3
0
    def __init__(self, parent: tk.Frame, controller: "App", **kwargs: Any):
        tk.Frame.__init__(self, parent, **kwargs)
        self.controller = controller
        self.configure(bg=theme.background_color_accent)
        self.grid_columnconfigure(0, weight=1)
        # self.grid_columnconfigure(1, weight=1)

        # labels
        self.name_label = common.Label(self, text="Name:")
        self.name_label.grid(column=0, row=0, rowspan=1, sticky="w")

        self.name_entry = common.Entry(self)
        self.name_entry.grid(column=0, row=1, sticky="w")

        self.words_label = common.Label(self, text="Words:")
        self.words_label.grid(column=0, row=2, sticky="w")

        self.words_text = common.Text(self)
        self.words_text.grid(column=0, row=3, sticky="ns")
        self.grid_rowconfigure(3, weight=1)

        # button
        bottom_frame = tk.Frame(self)
        bottom_frame.configure(bg=theme.background_color_accent)
        bottom_frame.grid(column=0, columnspan=1, sticky="nesw")
        bottom_frame.grid_columnconfigure(0, weight=1)
        # bottom_frame.grid_columnconfigure(2, weight=1)

        self.confirm_button = common.Button(
            bottom_frame,
            command=self.create_lexicon,
            text="Confirm Selections",
        )
        self.controller.current_lexicon.subscribe(self.update_info)
        self.confirm_button.grid(column=1, row=0, sticky="ns")

        self.confirm_button.configure(padx=10, pady=5)
    def __init__(self, parent, controller, **kwargs):
        tk.Frame.__init__(self, parent, **kwargs)
        self.controller = controller
        self.configure(bg=theme.background_color_accent)
        self.grid_rowconfigure(1, weight=1)
        self.grid_columnconfigure(0, weight=1)
        self.grid_columnconfigure(1, weight=1)

        # labels
        self.name_label = common.Label(self, text="Name")
        self.name_label.grid(column=0, row=0, rowspan=1, sticky="sew")
        self.words_label = common.Label(self, text="Words")
        self.words_label.grid(column=0, row=1, rowspan=1, sticky="new")

        self.name_listbox = common.Entry(self)
        self.name_listbox.grid(column=1, row=0, sticky="nsew")

        self.words_listbox = tk.Text(self)
        self.words_listbox.grid(column=1, row=1, sticky="nsew")

        # button
        bottom_frame = tk.Frame(self)
        bottom_frame.configure(bg=theme.background_color_accent)
        bottom_frame.grid(column=0, columnspan=2, sticky="nesw")
        bottom_frame.grid_columnconfigure(0, weight=1)
        bottom_frame.grid_columnconfigure(2, weight=1)

        report_params_button = common.Button(
            bottom_frame,
            command=self.create_lexicon,
            text="Confirm Selections",
        )
        self.controller.current_frame.subscribe(self.update_info)
        report_params_button.grid(column=1, row=0, sticky="ns")

        report_params_button.configure(padx=10, pady=5)