text-summarizer-aweebtaku 1.2.7__py3-none-any.whl → 1.2.8.post1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- text_summarizer/__init__.py +1 -1
- text_summarizer/ui.py +121 -18
- {text_summarizer_aweebtaku-1.2.7.dist-info → text_summarizer_aweebtaku-1.2.8.post1.dist-info}/METADATA +1 -1
- text_summarizer_aweebtaku-1.2.8.post1.dist-info/RECORD +13 -0
- text_summarizer_aweebtaku-1.2.7.dist-info/RECORD +0 -13
- {text_summarizer_aweebtaku-1.2.7.dist-info → text_summarizer_aweebtaku-1.2.8.post1.dist-info}/WHEEL +0 -0
- {text_summarizer_aweebtaku-1.2.7.dist-info → text_summarizer_aweebtaku-1.2.8.post1.dist-info}/entry_points.txt +0 -0
- {text_summarizer_aweebtaku-1.2.7.dist-info → text_summarizer_aweebtaku-1.2.8.post1.dist-info}/licenses/LICENSE +0 -0
- {text_summarizer_aweebtaku-1.2.7.dist-info → text_summarizer_aweebtaku-1.2.8.post1.dist-info}/top_level.txt +0 -0
text_summarizer/__init__.py
CHANGED
text_summarizer/ui.py
CHANGED
|
@@ -13,13 +13,10 @@ class TextSummarizerUI:
|
|
|
13
13
|
self.root.title("Text Summarizer")
|
|
14
14
|
self.root.geometry("1000x700")
|
|
15
15
|
self.root.resizable(True, True)
|
|
16
|
-
self.root.configure(bg='#f0f0f0')
|
|
17
16
|
|
|
18
|
-
#
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
style.configure('TLabel', font=('Arial', 10))
|
|
22
|
-
style.configure('TFrame', background='#f0f0f0')
|
|
17
|
+
# Theme management
|
|
18
|
+
self.dark_mode = False
|
|
19
|
+
self.apply_theme()
|
|
23
20
|
|
|
24
21
|
self.summarizer = None
|
|
25
22
|
self.df = None
|
|
@@ -28,15 +25,63 @@ class TextSummarizerUI:
|
|
|
28
25
|
|
|
29
26
|
self.create_widgets()
|
|
30
27
|
|
|
28
|
+
def apply_theme(self):
|
|
29
|
+
"""Apply the current theme (light or dark) to the application."""
|
|
30
|
+
if self.dark_mode:
|
|
31
|
+
# Dark theme colors
|
|
32
|
+
bg_color = '#2b2b2b'
|
|
33
|
+
fg_color = '#ffffff'
|
|
34
|
+
text_bg = '#3c3c3c'
|
|
35
|
+
text_fg = '#ffffff'
|
|
36
|
+
button_bg = '#404040'
|
|
37
|
+
frame_bg = '#2b2b2b'
|
|
38
|
+
else:
|
|
39
|
+
# Light theme colors
|
|
40
|
+
bg_color = '#f0f0f0'
|
|
41
|
+
fg_color = '#000000'
|
|
42
|
+
text_bg = '#ffffff'
|
|
43
|
+
text_fg = '#000000'
|
|
44
|
+
button_bg = '#e1e1e1'
|
|
45
|
+
frame_bg = '#f0f0f0'
|
|
46
|
+
|
|
47
|
+
# Configure root window
|
|
48
|
+
self.root.configure(bg=bg_color)
|
|
49
|
+
|
|
50
|
+
# Configure styles
|
|
51
|
+
style = ttk.Style()
|
|
52
|
+
style.configure('TButton', font=('Arial', 10), background=button_bg)
|
|
53
|
+
style.configure('TLabel', font=('Arial', 10), background=frame_bg, foreground=fg_color)
|
|
54
|
+
style.configure('TFrame', background=frame_bg)
|
|
55
|
+
style.configure('TLabelframe', background=frame_bg, foreground=fg_color)
|
|
56
|
+
style.configure('TLabelframe.Label', background=frame_bg, foreground=fg_color)
|
|
57
|
+
|
|
58
|
+
# Update text widget colors if they exist
|
|
59
|
+
if hasattr(self, 'original_text'):
|
|
60
|
+
self.original_text.configure(bg=text_bg, fg=text_fg, insertbackground=fg_color)
|
|
61
|
+
if hasattr(self, 'summary_text'):
|
|
62
|
+
self.summary_text.configure(bg=text_bg, fg=text_fg, insertbackground=fg_color)
|
|
63
|
+
|
|
64
|
+
def toggle_theme(self):
|
|
65
|
+
"""Toggle between light and dark themes."""
|
|
66
|
+
self.dark_mode = not self.dark_mode
|
|
67
|
+
self.apply_theme()
|
|
68
|
+
|
|
31
69
|
def create_widgets(self):
|
|
32
70
|
"""Create and layout all UI widgets."""
|
|
33
71
|
# Main frame
|
|
34
72
|
main_frame = ttk.Frame(self.root, padding="10")
|
|
35
73
|
main_frame.pack(fill=tk.BOTH, expand=True)
|
|
36
74
|
|
|
37
|
-
# Title
|
|
38
|
-
|
|
39
|
-
|
|
75
|
+
# Title and theme toggle
|
|
76
|
+
title_frame = ttk.Frame(main_frame)
|
|
77
|
+
title_frame.pack(fill=tk.X, pady=10)
|
|
78
|
+
|
|
79
|
+
title_label = ttk.Label(title_frame, text="Text Summarizer", font=("Arial", 16, "bold"))
|
|
80
|
+
title_label.pack(side=tk.LEFT)
|
|
81
|
+
|
|
82
|
+
theme_button = ttk.Button(title_frame, text="🌙 Dark Mode" if not self.dark_mode else "☀️ Light Mode",
|
|
83
|
+
command=self.toggle_theme)
|
|
84
|
+
theme_button.pack(side=tk.RIGHT)
|
|
40
85
|
|
|
41
86
|
# Data loading section
|
|
42
87
|
load_frame = ttk.LabelFrame(main_frame, text="Load Data", padding="10")
|
|
@@ -149,7 +194,7 @@ class TextSummarizerUI:
|
|
|
149
194
|
|
|
150
195
|
def paste_single(self):
|
|
151
196
|
"""Open dialog to paste a single document."""
|
|
152
|
-
dialog = PasteDialog(self.root)
|
|
197
|
+
dialog = PasteDialog(self.root, self.dark_mode)
|
|
153
198
|
self.root.wait_window(dialog.top)
|
|
154
199
|
if dialog.result:
|
|
155
200
|
self.df = pd.DataFrame([{'article_id': 1, 'article_text': dialog.result}])
|
|
@@ -173,7 +218,7 @@ class TextSummarizerUI:
|
|
|
173
218
|
|
|
174
219
|
def create_csv(self):
|
|
175
220
|
"""Open dialog to create a new CSV with multiple documents."""
|
|
176
|
-
dialog = CreateCSVDialog(self.root)
|
|
221
|
+
dialog = CreateCSVDialog(self.root, self.dark_mode)
|
|
177
222
|
self.root.wait_window(dialog.top)
|
|
178
223
|
if dialog.result:
|
|
179
224
|
self.df = pd.DataFrame(dialog.result)
|
|
@@ -249,7 +294,21 @@ class TextSummarizerUI:
|
|
|
249
294
|
top.title("Original Document - Full View")
|
|
250
295
|
top.geometry("900x700")
|
|
251
296
|
top.resizable(True, True)
|
|
252
|
-
|
|
297
|
+
|
|
298
|
+
# Apply theme to popup window
|
|
299
|
+
if self.dark_mode:
|
|
300
|
+
bg_color = '#2b2b2b'
|
|
301
|
+
fg_color = '#ffffff'
|
|
302
|
+
text_bg = '#3c3c3c'
|
|
303
|
+
text_fg = '#ffffff'
|
|
304
|
+
else:
|
|
305
|
+
bg_color = '#f0f0f0'
|
|
306
|
+
fg_color = '#000000'
|
|
307
|
+
text_bg = '#ffffff'
|
|
308
|
+
text_fg = '#000000'
|
|
309
|
+
|
|
310
|
+
top.configure(bg=bg_color)
|
|
311
|
+
text = scrolledtext.ScrolledText(top, wrap=tk.WORD, bg=text_bg, fg=text_fg, insertbackground=fg_color)
|
|
253
312
|
text.pack(fill=tk.BOTH, expand=True, padx=10, pady=10)
|
|
254
313
|
text.insert(tk.END, self.original_text.get(1.0, tk.END))
|
|
255
314
|
text.config(state=tk.DISABLED) # Make it read-only
|
|
@@ -260,7 +319,21 @@ class TextSummarizerUI:
|
|
|
260
319
|
top.title("Summary - Full View")
|
|
261
320
|
top.geometry("900x700")
|
|
262
321
|
top.resizable(True, True)
|
|
263
|
-
|
|
322
|
+
|
|
323
|
+
# Apply theme to popup window
|
|
324
|
+
if self.dark_mode:
|
|
325
|
+
bg_color = '#2b2b2b'
|
|
326
|
+
fg_color = '#ffffff'
|
|
327
|
+
text_bg = '#3c3c3c'
|
|
328
|
+
text_fg = '#ffffff'
|
|
329
|
+
else:
|
|
330
|
+
bg_color = '#f0f0f0'
|
|
331
|
+
fg_color = '#000000'
|
|
332
|
+
text_bg = '#ffffff'
|
|
333
|
+
text_fg = '#000000'
|
|
334
|
+
|
|
335
|
+
top.configure(bg=bg_color)
|
|
336
|
+
text = scrolledtext.ScrolledText(top, wrap=tk.WORD, bg=text_bg, fg=text_fg, insertbackground=fg_color)
|
|
264
337
|
text.pack(fill=tk.BOTH, expand=True, padx=10, pady=10)
|
|
265
338
|
text.insert(tk.END, self.summary_text.get(1.0, tk.END))
|
|
266
339
|
text.config(state=tk.DISABLED) # Make it read-only
|
|
@@ -269,16 +342,31 @@ class TextSummarizerUI:
|
|
|
269
342
|
class PasteDialog:
|
|
270
343
|
"""Dialog for pasting a single document."""
|
|
271
344
|
|
|
272
|
-
def __init__(self, parent):
|
|
345
|
+
def __init__(self, parent, dark_mode=False):
|
|
273
346
|
self.top = tk.Toplevel(parent)
|
|
274
347
|
self.top.title("Paste Document")
|
|
275
348
|
self.top.geometry("700x600")
|
|
276
349
|
self.top.transient(parent)
|
|
277
350
|
self.top.grab_set()
|
|
278
351
|
self.result = None
|
|
352
|
+
self.dark_mode = dark_mode
|
|
353
|
+
|
|
354
|
+
# Apply theme
|
|
355
|
+
if self.dark_mode:
|
|
356
|
+
bg_color = '#2b2b2b'
|
|
357
|
+
fg_color = '#ffffff'
|
|
358
|
+
text_bg = '#3c3c3c'
|
|
359
|
+
text_fg = '#ffffff'
|
|
360
|
+
else:
|
|
361
|
+
bg_color = '#f0f0f0'
|
|
362
|
+
fg_color = '#000000'
|
|
363
|
+
text_bg = '#ffffff'
|
|
364
|
+
text_fg = '#000000'
|
|
365
|
+
|
|
366
|
+
self.top.configure(bg=bg_color)
|
|
279
367
|
|
|
280
368
|
ttk.Label(self.top, text="Paste your document:").pack(pady=5)
|
|
281
|
-
self.text = scrolledtext.ScrolledText(self.top, wrap=tk.WORD)
|
|
369
|
+
self.text = scrolledtext.ScrolledText(self.top, wrap=tk.WORD, bg=text_bg, fg=text_fg, insertbackground=fg_color)
|
|
282
370
|
self.text.pack(fill=tk.BOTH, expand=True, padx=10, pady=5)
|
|
283
371
|
|
|
284
372
|
button_frame = ttk.Frame(self.top)
|
|
@@ -297,13 +385,28 @@ class PasteDialog:
|
|
|
297
385
|
class CreateCSVDialog:
|
|
298
386
|
"""Dialog for creating a CSV with multiple documents."""
|
|
299
387
|
|
|
300
|
-
def __init__(self, parent):
|
|
388
|
+
def __init__(self, parent, dark_mode=False):
|
|
301
389
|
self.top = tk.Toplevel(parent)
|
|
302
390
|
self.top.title("Create CSV")
|
|
303
391
|
self.top.geometry("700x600")
|
|
304
392
|
self.top.transient(parent)
|
|
305
393
|
self.top.grab_set()
|
|
306
394
|
self.result = []
|
|
395
|
+
self.dark_mode = dark_mode
|
|
396
|
+
|
|
397
|
+
# Apply theme
|
|
398
|
+
if self.dark_mode:
|
|
399
|
+
bg_color = '#2b2b2b'
|
|
400
|
+
fg_color = '#ffffff'
|
|
401
|
+
text_bg = '#3c3c3c'
|
|
402
|
+
text_fg = '#ffffff'
|
|
403
|
+
else:
|
|
404
|
+
bg_color = '#f0f0f0'
|
|
405
|
+
fg_color = '#000000'
|
|
406
|
+
text_bg = '#ffffff'
|
|
407
|
+
text_fg = '#000000'
|
|
408
|
+
|
|
409
|
+
self.top.configure(bg=bg_color)
|
|
307
410
|
|
|
308
411
|
self.articles = []
|
|
309
412
|
self.counter = 1
|
|
@@ -318,7 +421,7 @@ class CreateCSVDialog:
|
|
|
318
421
|
self.id_entry.grid(row=0, column=1, padx=5)
|
|
319
422
|
|
|
320
423
|
ttk.Label(input_frame, text="Document Text:").grid(row=1, column=0, sticky=tk.W)
|
|
321
|
-
self.text_entry = scrolledtext.ScrolledText(input_frame, wrap=tk.WORD, height=5)
|
|
424
|
+
self.text_entry = scrolledtext.ScrolledText(input_frame, wrap=tk.WORD, height=5, bg=text_bg, fg=text_fg, insertbackground=fg_color)
|
|
322
425
|
self.text_entry.grid(row=1, column=1, padx=5, pady=5)
|
|
323
426
|
|
|
324
427
|
button_frame = ttk.Frame(self.top)
|
|
@@ -328,7 +431,7 @@ class CreateCSVDialog:
|
|
|
328
431
|
ttk.Button(button_frame, text="Done", command=self.done).pack(side=tk.LEFT, padx=5)
|
|
329
432
|
ttk.Button(button_frame, text="Cancel", command=self.cancel).pack(side=tk.RIGHT, padx=5)
|
|
330
433
|
|
|
331
|
-
self.listbox = tk.Listbox(self.top, height=10)
|
|
434
|
+
self.listbox = tk.Listbox(self.top, height=10, bg=text_bg, fg=text_fg)
|
|
332
435
|
self.listbox.pack(fill=tk.BOTH, expand=True, padx=10, pady=5)
|
|
333
436
|
|
|
334
437
|
def add_article(self):
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
text_summarizer/__init__.py,sha256=BfpaRdXt6PawcqNUQCIuYwV0MhuoNc6POu6Au_Ey-zQ,69
|
|
2
|
+
text_summarizer/cli.py,sha256=zMP4amFDj5F-GCOcQSRN924HrCHcrKrcqmTiwfSTCr8,3656
|
|
3
|
+
text_summarizer/create_shortcuts.py,sha256=1fwZkHG-2vim0HkIkb15BHEh-Xe2NbXcoidUtLvn1Tg,2436
|
|
4
|
+
text_summarizer/summarizer.py,sha256=80RamR76QFtOAZGdVGqy-Bi5xQb3WBbQ2pSYSnOnT5c,12733
|
|
5
|
+
text_summarizer/ui.py,sha256=c03OIvBulIjwkXVTaY1kH-c-3L0rCCAjYhuOYy4571o,20341
|
|
6
|
+
text_summarizer/data/__init__.py,sha256=keVAOKSXlHFknU6dXsWGV_4Vx8RKEyUdY76PK05_4Ug,34
|
|
7
|
+
text_summarizer/data/tennis.csv,sha256=oEPZr4Dy6cmCDtdQ2QYJyJpERzQseuNJ53JP2XyIfBk,12943
|
|
8
|
+
text_summarizer_aweebtaku-1.2.8.post1.dist-info/licenses/LICENSE,sha256=UdJHHpU6zYlYRsiLua2qeQwtJk2-UR17jXRV-MfxoVk,1093
|
|
9
|
+
text_summarizer_aweebtaku-1.2.8.post1.dist-info/METADATA,sha256=-KGUebq6Pns2df78rGQ2_RcMTzajIRNK5jLtKNo0Y-I,6051
|
|
10
|
+
text_summarizer_aweebtaku-1.2.8.post1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
11
|
+
text_summarizer_aweebtaku-1.2.8.post1.dist-info/entry_points.txt,sha256=jOt-WcgMjgjfoD1cvbYoPExPiyIbLn49Gh-A5OEgugw,195
|
|
12
|
+
text_summarizer_aweebtaku-1.2.8.post1.dist-info/top_level.txt,sha256=2s-4Uyii86k2iEeiIi0JghAXW47cEQ8qM_ONYPs9Gh8,16
|
|
13
|
+
text_summarizer_aweebtaku-1.2.8.post1.dist-info/RECORD,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
text_summarizer/__init__.py,sha256=j_M3vxnTaRsqHupCqqgY6bZOj7OSMkHFq0DzZ7GFDks,63
|
|
2
|
-
text_summarizer/cli.py,sha256=zMP4amFDj5F-GCOcQSRN924HrCHcrKrcqmTiwfSTCr8,3656
|
|
3
|
-
text_summarizer/create_shortcuts.py,sha256=1fwZkHG-2vim0HkIkb15BHEh-Xe2NbXcoidUtLvn1Tg,2436
|
|
4
|
-
text_summarizer/summarizer.py,sha256=80RamR76QFtOAZGdVGqy-Bi5xQb3WBbQ2pSYSnOnT5c,12733
|
|
5
|
-
text_summarizer/ui.py,sha256=Ky40zcr-_0zh5I7Kh4Bc8hKrEBdOALe5G4i3ukDJWts,16638
|
|
6
|
-
text_summarizer/data/__init__.py,sha256=keVAOKSXlHFknU6dXsWGV_4Vx8RKEyUdY76PK05_4Ug,34
|
|
7
|
-
text_summarizer/data/tennis.csv,sha256=oEPZr4Dy6cmCDtdQ2QYJyJpERzQseuNJ53JP2XyIfBk,12943
|
|
8
|
-
text_summarizer_aweebtaku-1.2.7.dist-info/licenses/LICENSE,sha256=UdJHHpU6zYlYRsiLua2qeQwtJk2-UR17jXRV-MfxoVk,1093
|
|
9
|
-
text_summarizer_aweebtaku-1.2.7.dist-info/METADATA,sha256=k_fFJx_b7QmkXjGzTlLELxAwcCgXa1svzrYIgWSUmlY,6045
|
|
10
|
-
text_summarizer_aweebtaku-1.2.7.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
11
|
-
text_summarizer_aweebtaku-1.2.7.dist-info/entry_points.txt,sha256=jOt-WcgMjgjfoD1cvbYoPExPiyIbLn49Gh-A5OEgugw,195
|
|
12
|
-
text_summarizer_aweebtaku-1.2.7.dist-info/top_level.txt,sha256=2s-4Uyii86k2iEeiIi0JghAXW47cEQ8qM_ONYPs9Gh8,16
|
|
13
|
-
text_summarizer_aweebtaku-1.2.7.dist-info/RECORD,,
|
{text_summarizer_aweebtaku-1.2.7.dist-info → text_summarizer_aweebtaku-1.2.8.post1.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|