psiutils 0.2.32__tar.gz → 0.2.34__tar.gz
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.
- {psiutils-0.2.32 → psiutils-0.2.34}/PKG-INFO +1 -2
- {psiutils-0.2.32 → psiutils-0.2.34}/pyproject.toml +1 -2
- psiutils-0.2.34/src/psiutils/_version.py +1 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/buttons.py +103 -98
- psiutils-0.2.34/src/psiutils/icons/backup.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/build.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/cancel.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/check.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/checkbox_checked.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/checkbox_unchecked.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/clear.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/code.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/compare.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/copy_clipboard.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/copy_docs.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/delete.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/diff.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/done.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/download.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/edit.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/gear.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/help.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/new.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/next.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/open.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/pause.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/preferences.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/previous.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/process.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/redo.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/refresh.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/rename.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/report.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/reset.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/restore.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/restore_database.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/restore_page.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/revert.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/run.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/save.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/script.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/search.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/send.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/start.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/update.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/upgrade.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/upload.png +0 -0
- psiutils-0.2.34/src/psiutils/icons/windows.png +0 -0
- psiutils-0.2.34/src/psiutils/text.py +125 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/treeview.py +2 -2
- psiutils-0.2.32/src/psiutils/_version.py +0 -1
- psiutils-0.2.32/src/psiutils/icons/backup.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/build.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/cancel.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/check.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/checkbox_checked.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/checkbox_unchecked.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/clear.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/code.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/compare.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/copy_clipboard.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/copy_docs.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/delete.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/diff.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/done.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/download.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/edit.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/gear.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/new.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/next.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/open.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/pause.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/preferences.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/previous.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/process.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/redo.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/refresh.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/rename.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/report.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/reset.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/restore.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/restore_database.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/restore_page.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/revert.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/save.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/script.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/search.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/send.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/start.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/update.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/upgrade.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/upload.png +0 -0
- psiutils-0.2.32/src/psiutils/icons/windows.png +0 -0
- psiutils-0.2.32/src/psiutils/text.py +0 -123
- {psiutils-0.2.32 → psiutils-0.2.34}/README.md +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/__init__.py +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/_about_frame.py +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/_logger.py +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/_notify.py +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/_scrolling_canvas.py +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/constants.py +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/date_picker.py +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/drag_manager.py +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/errors.py +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/icecream_init.py +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/icons/convert.png +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/images/icon-error.png +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/images/icon-info.png +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/images/icon-query.png +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/known_paths.py +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/menus.py +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/messagebox.py +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/utilities.py +0 -0
- {psiutils-0.2.32 → psiutils-0.2.34}/src/psiutils/widgets.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: psiutils
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.34
|
|
4
4
|
Summary: Various TKinter utilities.
|
|
5
5
|
Author: Jeff
|
|
6
6
|
Author-email: Jeff <<jeffwatkins2000@gmail.com>>
|
|
@@ -14,7 +14,6 @@ Requires-Dist: psi-toml>=0.0.12
|
|
|
14
14
|
Requires-Dist: psiconfig>=0.0.14
|
|
15
15
|
Requires-Dist: pycairo>=1.28.0
|
|
16
16
|
Requires-Dist: pygments>=2.19.2
|
|
17
|
-
Requires-Dist: pygobject>=3.54.2
|
|
18
17
|
Requires-Dist: pytest>=9.0.2
|
|
19
18
|
Requires-Dist: structlog>=25.4.0
|
|
20
19
|
Requires-Dist: tkcalendar>=1.6.1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "psiutils"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.34"
|
|
4
4
|
description = "Various TKinter utilities."
|
|
5
5
|
authors = [{name = "Jeff", "email" = "<jeffwatkins2000@gmail.com>"}]
|
|
6
6
|
requires-python = '>= 3.10, < 3.13'
|
|
@@ -19,7 +19,6 @@ dependencies = [
|
|
|
19
19
|
"psiconfig>=0.0.14",
|
|
20
20
|
"pycairo>=1.28.0",
|
|
21
21
|
"pygments>=2.19.2",
|
|
22
|
-
"pygobject>=3.54.2",
|
|
23
22
|
"pytest>=9.0.2",
|
|
24
23
|
"structlog>=25.4.0",
|
|
25
24
|
"tkcalendar>=1.6.1",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = '0.2.34'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""Button class for Tkinter applications."""
|
|
2
|
+
|
|
2
3
|
import tkinter as tk
|
|
3
4
|
from tkinter import ttk
|
|
4
5
|
from pathlib import Path
|
|
@@ -14,16 +15,17 @@ txt = Text()
|
|
|
14
15
|
|
|
15
16
|
class IconButton(ttk.Frame):
|
|
16
17
|
def __init__(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
self,
|
|
19
|
+
master,
|
|
20
|
+
button_text,
|
|
21
|
+
icon,
|
|
22
|
+
command=None,
|
|
23
|
+
dimmable: bool = False,
|
|
24
|
+
sticky: str = "",
|
|
25
|
+
icon_path: str = "",
|
|
26
|
+
**kwargs,
|
|
27
|
+
):
|
|
28
|
+
super().__init__(master, borderwidth=1, relief="raised", **kwargs)
|
|
27
29
|
self.command = command
|
|
28
30
|
self._state = tk.NORMAL
|
|
29
31
|
self.text = button_text
|
|
@@ -31,12 +33,13 @@ class IconButton(ttk.Frame):
|
|
|
31
33
|
|
|
32
34
|
# Icon and text
|
|
33
35
|
if not icon_path:
|
|
34
|
-
icon_path = f
|
|
35
|
-
image = Image.open(f
|
|
36
|
+
icon_path = f"{Path(__file__).parent}/icons/"
|
|
37
|
+
image = Image.open(f"{icon_path}{icon}.png").resize((16, 16))
|
|
36
38
|
photo_image = ImageTk.PhotoImage(image)
|
|
37
39
|
|
|
38
40
|
self.button_label = ttk.Label(
|
|
39
|
-
self, text=button_text, image=photo_image, compound=tk.LEFT
|
|
41
|
+
self, text=button_text, image=photo_image, compound=tk.LEFT
|
|
42
|
+
)
|
|
40
43
|
self.button_label.image = photo_image # Prevent garbage collection
|
|
41
44
|
self.button_label.pack(padx=(3, 5), pady=5)
|
|
42
45
|
self.widget = self.button_label
|
|
@@ -48,7 +51,7 @@ class IconButton(ttk.Frame):
|
|
|
48
51
|
self.dimmable = dimmable
|
|
49
52
|
|
|
50
53
|
def __repr__(self) -> str:
|
|
51
|
-
return f
|
|
54
|
+
return f"IconButton: {self.text} {self.icon}"
|
|
52
55
|
|
|
53
56
|
def state(self, *args, **kwargs) -> dict:
|
|
54
57
|
return self._state
|
|
@@ -65,14 +68,14 @@ class IconButton(ttk.Frame):
|
|
|
65
68
|
|
|
66
69
|
def bind_widgets(self):
|
|
67
70
|
for widget in (self, self.button_label):
|
|
68
|
-
widget.bind(
|
|
69
|
-
widget.bind(
|
|
70
|
-
widget.bind(
|
|
71
|
+
widget.bind("<Button-1>", self._on_click)
|
|
72
|
+
widget.bind("<Enter>", self._enter_button)
|
|
73
|
+
widget.bind("<Leave>", lambda e: self.config(relief="raised"))
|
|
71
74
|
|
|
72
75
|
def _enter_button(self, event) -> None:
|
|
73
76
|
if self._state == tk.DISABLED:
|
|
74
77
|
return
|
|
75
|
-
self.config(relief=
|
|
78
|
+
self.config(relief="sunken")
|
|
76
79
|
event.widget.winfo_toplevel().config(cursor=HAND)
|
|
77
80
|
|
|
78
81
|
def _on_click(self, *args):
|
|
@@ -84,12 +87,12 @@ class IconButton(ttk.Frame):
|
|
|
84
87
|
|
|
85
88
|
class Button(ttk.Button):
|
|
86
89
|
def __init__(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
self,
|
|
91
|
+
*args,
|
|
92
|
+
sticky: str = "",
|
|
93
|
+
dimmable: bool = False,
|
|
94
|
+
**kwargs: dict,
|
|
95
|
+
) -> None:
|
|
93
96
|
super().__init__(*args, **kwargs)
|
|
94
97
|
|
|
95
98
|
self.sticky = sticky
|
|
@@ -97,26 +100,24 @@ class Button(ttk.Button):
|
|
|
97
100
|
|
|
98
101
|
def enable(self, enable: bool = True) -> None:
|
|
99
102
|
state = tk.NORMAL if enable else tk.DISABLED
|
|
100
|
-
self[
|
|
103
|
+
self["state"] = state
|
|
101
104
|
|
|
102
105
|
def disable(self, disable: bool = True) -> None:
|
|
103
106
|
state = tk.DISABLED if disable else tk.NORMAL
|
|
104
|
-
self[
|
|
107
|
+
self["state"] = state
|
|
105
108
|
|
|
106
109
|
|
|
107
110
|
class ButtonFrame(ttk.Frame):
|
|
108
111
|
def __init__(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
orientation: str = tk.HORIZONTAL,
|
|
112
|
-
**kwargs: dict) -> None:
|
|
112
|
+
self, master: tk.Frame, orientation: str = tk.HORIZONTAL, **kwargs: dict
|
|
113
|
+
) -> None:
|
|
113
114
|
super().__init__(master, **kwargs)
|
|
114
115
|
self._buttons = []
|
|
115
116
|
self._enabled = False
|
|
116
117
|
self.orientation = orientation
|
|
117
118
|
|
|
118
|
-
if
|
|
119
|
-
self._enabled = kwargs[
|
|
119
|
+
if "enabled" in kwargs:
|
|
120
|
+
self._enabled = kwargs["enabled"]
|
|
120
121
|
|
|
121
122
|
self.icon_buttons = {
|
|
122
123
|
name: IconButton(self, button[0], button[1])
|
|
@@ -124,10 +125,11 @@ class ButtonFrame(ttk.Frame):
|
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
def icon_button(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
self,
|
|
129
|
+
id_: str,
|
|
130
|
+
command: object = None,
|
|
131
|
+
dimmable: bool = False,
|
|
132
|
+
) -> IconButton:
|
|
131
133
|
button = self.icon_buttons[id_]
|
|
132
134
|
button.dimmable = dimmable
|
|
133
135
|
button.command = command
|
|
@@ -154,8 +156,8 @@ class ButtonFrame(ttk.Frame):
|
|
|
154
156
|
def enabled(self, value: bool) -> None:
|
|
155
157
|
self._enabled = value
|
|
156
158
|
state = tk.NORMAL if value else tk.DISABLED
|
|
157
|
-
for button in self.
|
|
158
|
-
button.widget[
|
|
159
|
+
for button in self.buttons:
|
|
160
|
+
button.widget["state"] = state
|
|
159
161
|
|
|
160
162
|
def enable(self, enable: bool = True) -> None:
|
|
161
163
|
self._enabled = enable
|
|
@@ -166,7 +168,7 @@ class ButtonFrame(ttk.Frame):
|
|
|
166
168
|
self._enable_buttons(self.buttons, False)
|
|
167
169
|
|
|
168
170
|
def _vertical_buttons(self) -> None:
|
|
169
|
-
self.rowconfigure(len(self.buttons)-1, weight=1)
|
|
171
|
+
self.rowconfigure(len(self.buttons) - 1, weight=1)
|
|
170
172
|
for row, button in enumerate(self.buttons):
|
|
171
173
|
pady = PAD
|
|
172
174
|
if row == 0:
|
|
@@ -180,7 +182,7 @@ class ButtonFrame(ttk.Frame):
|
|
|
180
182
|
clickable_widget(button)
|
|
181
183
|
|
|
182
184
|
def _horizontal_buttons(self) -> None:
|
|
183
|
-
self.columnconfigure(len(self.buttons)-1, weight=1)
|
|
185
|
+
self.columnconfigure(len(self.buttons) - 1, weight=1)
|
|
184
186
|
for col, button in enumerate(self.buttons):
|
|
185
187
|
padx = PAD
|
|
186
188
|
if col == 0:
|
|
@@ -199,8 +201,8 @@ class ButtonFrame(ttk.Frame):
|
|
|
199
201
|
for button in buttons:
|
|
200
202
|
if button.dimmable:
|
|
201
203
|
if isinstance(button, Button):
|
|
202
|
-
button[
|
|
203
|
-
button.bind(
|
|
204
|
+
button["state"] = state
|
|
205
|
+
button.bind("<Enter>", enter_widget)
|
|
204
206
|
elif isinstance(button, IconButton):
|
|
205
207
|
if enable:
|
|
206
208
|
button.enable()
|
|
@@ -212,55 +214,57 @@ def enable_buttons(buttons: list[Button], enable: bool = True):
|
|
|
212
214
|
state = tk.NORMAL if enable else tk.DISABLED
|
|
213
215
|
for button in buttons:
|
|
214
216
|
if button.dimmable:
|
|
215
|
-
button[
|
|
216
|
-
button.bind(
|
|
217
|
+
button["state"] = state
|
|
218
|
+
button.bind("<Enter>", enter_widget)
|
|
217
219
|
|
|
218
220
|
|
|
219
221
|
icon_buttons = {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
222
|
+
"backup": (txt.BACKUP, "backup"),
|
|
223
|
+
"build": (txt.BUILD, "build"),
|
|
224
|
+
"check": (txt.CHECK, "check"),
|
|
225
|
+
"clear": (txt.CLEAR, "clear"),
|
|
226
|
+
"close": (txt.CLOSE, "cancel"),
|
|
227
|
+
"code": (txt.CODE, "code"),
|
|
228
|
+
"compare": (txt.COMPARE, "compare"),
|
|
229
|
+
"config": (txt.CONFIG, "gear"),
|
|
230
|
+
"convert": (txt.CONVERT, "convert"),
|
|
231
|
+
"copy_docs": (txt.COPY, "copy_docs"),
|
|
232
|
+
"copy_clipboard": (txt.COPY, "copy_clipboard"),
|
|
233
|
+
"delete": (txt.DELETE, "delete"),
|
|
234
|
+
"download": (txt.DOWNLOAD, "download"),
|
|
235
|
+
"diff": (txt.DIFF, "diff"),
|
|
236
|
+
"done": (txt.DONE, "done"),
|
|
237
|
+
"edit": (txt.EDIT, "edit"),
|
|
238
|
+
"exit": (txt.EXIT, "cancel"),
|
|
239
|
+
"help": (txt.HELP, "help"),
|
|
240
|
+
"new": (txt.NEW, "new"),
|
|
241
|
+
"next": (txt.NEXT, "next"),
|
|
242
|
+
"open": (txt.OPEN, "open"),
|
|
243
|
+
"pause": (txt.PAUSE, "pause"),
|
|
244
|
+
"preferences": (txt.PREFERENCES, "preferences"),
|
|
245
|
+
"previous": (txt.PREVIOUS, "previous"),
|
|
246
|
+
"process": (txt.PROCESS, "process"),
|
|
247
|
+
"redo": (txt.REDO, "redo"),
|
|
248
|
+
"refresh": (txt.REFRESH, "refresh"),
|
|
249
|
+
"rename": (txt.RENAME, "rename"),
|
|
250
|
+
"report": (txt.REPORT, "report"),
|
|
251
|
+
"reset": (txt.RESET, "reset"),
|
|
252
|
+
"restore": (txt.RESTORE, "restore"),
|
|
253
|
+
"restore_database": (txt.RESTORE, "restore_database"),
|
|
254
|
+
"restore_page": (txt.RESTORE, "restore_page"),
|
|
255
|
+
"revert": (txt.REVERT, "revert"),
|
|
256
|
+
"run": (txt.RUN, "start"),
|
|
257
|
+
"save": (txt.SAVE, "save"),
|
|
258
|
+
"script": (txt.SCRIPT, "script"),
|
|
259
|
+
"search": (txt.SEARCH, "search"),
|
|
260
|
+
"send": (txt.SEND, "send"),
|
|
261
|
+
"start": (txt.START, "start"),
|
|
262
|
+
"undo": (txt.UNDO, "revert"),
|
|
263
|
+
"update": (txt.UPDATE, "update"),
|
|
264
|
+
"upgrade": (txt.UPGRADE, "upgrade"),
|
|
265
|
+
"upload": (txt.UPLOAD, "upload"),
|
|
266
|
+
"use": (txt.USE, "done"),
|
|
267
|
+
"windows": (txt.WINDOWS, "windows"),
|
|
264
268
|
}
|
|
265
269
|
|
|
266
270
|
|
|
@@ -268,16 +272,17 @@ def list_icon_buttons() -> None:
|
|
|
268
272
|
"""List of icon_button."""
|
|
269
273
|
name_length, text_length, icon_length = 15, 10, 15
|
|
270
274
|
|
|
271
|
-
print(
|
|
272
|
-
(f'{"name":<{name_length}} '
|
|
273
|
-
f'{"text":<{text_length}} '
|
|
274
|
-
f'{"icon":<{icon_length}}'))
|
|
275
|
+
print((f"{'name':<{name_length}} {'text':<{text_length}} {'icon':<{icon_length}}"))
|
|
275
276
|
|
|
276
|
-
print(
|
|
277
|
-
|
|
278
|
-
|
|
277
|
+
print(
|
|
278
|
+
f"{'-' * name_length:<{name_length}} "
|
|
279
|
+
f"{'-' * text_length:<{text_length}} "
|
|
280
|
+
f"{'-' * icon_length:<{icon_length}}"
|
|
281
|
+
)
|
|
279
282
|
|
|
280
283
|
for name, button in icon_buttons.items():
|
|
281
|
-
print(
|
|
282
|
-
|
|
283
|
-
|
|
284
|
+
print(
|
|
285
|
+
f"{name:<{name_length}} "
|
|
286
|
+
f"{button[0]:<{text_length}} "
|
|
287
|
+
f"{button[1]:<{icon_length}}"
|
|
288
|
+
)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"""Handle standard text for psiutils."""
|
|
2
|
+
|
|
3
|
+
from copy import copy
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
psi_strings = {
|
|
7
|
+
"BACKUP": "Backup",
|
|
8
|
+
"BUILD": "Build",
|
|
9
|
+
"CANCEL": "Cancel",
|
|
10
|
+
"CHECK": "Check",
|
|
11
|
+
"CLEAR": "Clear",
|
|
12
|
+
"CLOSE": "Close",
|
|
13
|
+
"CODE": "Code",
|
|
14
|
+
"COMPARE": "Compare",
|
|
15
|
+
"CONFIG": "Config",
|
|
16
|
+
"CONVERT": "Convert",
|
|
17
|
+
"COPY": "Copy",
|
|
18
|
+
"DECREMENT_ARROW": "▼",
|
|
19
|
+
"DELETE": "Delete",
|
|
20
|
+
"DELETE_THESE_ITEMS": "Are you sure you want to delete these item(s)?",
|
|
21
|
+
"DIFF": "Diff",
|
|
22
|
+
"DONE": "Done",
|
|
23
|
+
"DOWNLOAD": "Download",
|
|
24
|
+
"EDIT": "Edit",
|
|
25
|
+
"ELLIPSIS": " ...",
|
|
26
|
+
"EVENT": "Event",
|
|
27
|
+
"EXIT": "Exit",
|
|
28
|
+
"HELP": "Help",
|
|
29
|
+
"INCREMENT_ARROW": "▲",
|
|
30
|
+
"LOGS": "Logs",
|
|
31
|
+
"NEW": "New",
|
|
32
|
+
"NEXT": "Next",
|
|
33
|
+
"NO": "No",
|
|
34
|
+
"NO_SUCH_FILE": "no such file or directory",
|
|
35
|
+
"OK": "OK",
|
|
36
|
+
"OPEN": "Open",
|
|
37
|
+
"PAUSE": "Pause",
|
|
38
|
+
"PREFERENCES": "Preferences",
|
|
39
|
+
"PREVIOUS": "Prev",
|
|
40
|
+
"PROCESS": "Process",
|
|
41
|
+
"QUIT": "Quit",
|
|
42
|
+
"REDO": "Redo",
|
|
43
|
+
"REFRESH": "Refresh",
|
|
44
|
+
"REPORT": "Report",
|
|
45
|
+
"RENAME": "Rename",
|
|
46
|
+
"RESET": "Reset",
|
|
47
|
+
"RESTORE": "Restore",
|
|
48
|
+
"REVERT": "Revert",
|
|
49
|
+
"RUN": "Run",
|
|
50
|
+
"SAVE": "Save",
|
|
51
|
+
"SCRIPT": "Script",
|
|
52
|
+
"SAVE_PDF": "Save as PDF",
|
|
53
|
+
"SEARCH": "Search",
|
|
54
|
+
"SEND": "Send",
|
|
55
|
+
"START": "Start",
|
|
56
|
+
"UNDO": "Undo",
|
|
57
|
+
"UPDATE": "Update",
|
|
58
|
+
"UPGRADE": "Upgrade",
|
|
59
|
+
"UPLOAD": "Upload",
|
|
60
|
+
"USE": "Use",
|
|
61
|
+
"WINDOWS": "Windows",
|
|
62
|
+
"YES": "Yes",
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
strings = copy(psi_strings)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class Text:
|
|
69
|
+
"""Combines package level and psiutils strings."""
|
|
70
|
+
|
|
71
|
+
def __init__(self) -> None:
|
|
72
|
+
"""
|
|
73
|
+
Initialise the object with attributes based on the key-value pairs
|
|
74
|
+
in the `strings` dictionary.
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
self: The instance of the class.
|
|
78
|
+
|
|
79
|
+
Returns:
|
|
80
|
+
None
|
|
81
|
+
"""
|
|
82
|
+
self.strings = strings
|
|
83
|
+
for key, string in strings.items():
|
|
84
|
+
setattr(self, key, string)
|
|
85
|
+
|
|
86
|
+
# Optionally display contents of `strings`
|
|
87
|
+
|
|
88
|
+
def display(self, compare: dict = None) -> None:
|
|
89
|
+
"""Print out contents of `strings` and compare if
|
|
90
|
+
a dict of strings is provided."""
|
|
91
|
+
duplicates = 0
|
|
92
|
+
overrides = 0
|
|
93
|
+
app_strings = 0
|
|
94
|
+
if not compare:
|
|
95
|
+
compare = {}
|
|
96
|
+
|
|
97
|
+
for key, item in compare.items():
|
|
98
|
+
if key not in strings:
|
|
99
|
+
strings[key] = item
|
|
100
|
+
|
|
101
|
+
for item in sorted(list(strings)):
|
|
102
|
+
output = f"{item:.<20} {strings[item]}"
|
|
103
|
+
if item in compare:
|
|
104
|
+
if strings[item] != compare[item]:
|
|
105
|
+
output = f"{output}, {compare[item]} <{'-' * 10} //override//"
|
|
106
|
+
overrides += 1
|
|
107
|
+
elif item not in psi_strings:
|
|
108
|
+
output = f"{output} <{'=' * 10} //app string//"
|
|
109
|
+
app_strings += 1
|
|
110
|
+
else:
|
|
111
|
+
output = f"{output} <{'=' * 10} //duplicate//"
|
|
112
|
+
duplicates += 1
|
|
113
|
+
print(output)
|
|
114
|
+
|
|
115
|
+
if duplicates:
|
|
116
|
+
print()
|
|
117
|
+
print(f"{duplicates} duplicates found")
|
|
118
|
+
|
|
119
|
+
if overrides:
|
|
120
|
+
print()
|
|
121
|
+
print(f"{overrides} overrides found")
|
|
122
|
+
|
|
123
|
+
if app_strings:
|
|
124
|
+
print()
|
|
125
|
+
print(f"{app_strings} application strings found")
|
|
@@ -55,14 +55,14 @@ class Treeview(ttk.Treeview):
|
|
|
55
55
|
for column, col_defn in enumerate(self.column_defs)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
def _heading(self, col_id: str, heading: str) -> Treeview.heading:
|
|
58
|
+
def _heading(self, col_id: str, heading: str) -> ttk.Treeview.heading:
|
|
59
59
|
return self.heading(
|
|
60
60
|
col_id,
|
|
61
61
|
text=heading,
|
|
62
62
|
command=lambda c=col_id: self._sort_columns(c, False)
|
|
63
63
|
)
|
|
64
64
|
|
|
65
|
-
def populate(self, values: dict[
|
|
65
|
+
def populate(self, values: dict[tuple]) -> None:
|
|
66
66
|
self.delete(*self.get_children())
|
|
67
67
|
for item in values:
|
|
68
68
|
item = self.insert('', 'end', values=item)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = '0.2.32'
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
""" Handle standard text for psiutils."""
|
|
2
|
-
|
|
3
|
-
from copy import copy
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
psi_strings = {
|
|
7
|
-
'BACKUP': 'Backup',
|
|
8
|
-
'BUILD': 'Build',
|
|
9
|
-
'CANCEL': 'Cancel',
|
|
10
|
-
'CHECK': 'Check',
|
|
11
|
-
'CLEAR': 'Clear',
|
|
12
|
-
'CLOSE': 'Close',
|
|
13
|
-
'CODE': 'Code',
|
|
14
|
-
'COMPARE': 'Compare',
|
|
15
|
-
'CONFIG': 'Config',
|
|
16
|
-
'CONVERT': 'Convert',
|
|
17
|
-
'COPY': 'Copy',
|
|
18
|
-
'DECREMENT_ARROW': '▼',
|
|
19
|
-
'DELETE': 'Delete',
|
|
20
|
-
'DELETE_THESE_ITEMS': 'Are you sure you want to delete these item(s)?',
|
|
21
|
-
'DIFF': 'Diff',
|
|
22
|
-
'DONE': 'Done',
|
|
23
|
-
'DOWNLOAD': 'Download',
|
|
24
|
-
'EDIT': 'Edit',
|
|
25
|
-
'ELLIPSIS': ' ...',
|
|
26
|
-
'EVENT': 'Event',
|
|
27
|
-
'EXIT': 'Exit',
|
|
28
|
-
'HELP': 'Help',
|
|
29
|
-
'INCREMENT_ARROW': '▲',
|
|
30
|
-
'LOGS': 'Logs',
|
|
31
|
-
'NEW': 'New',
|
|
32
|
-
'NEXT': 'Next',
|
|
33
|
-
'NO': 'No',
|
|
34
|
-
'NO_SUCH_FILE': 'no such file or directory',
|
|
35
|
-
'OK': 'OK',
|
|
36
|
-
'OPEN': 'Open',
|
|
37
|
-
'PAUSE': 'Pause',
|
|
38
|
-
'PREFERENCES': 'Preferences',
|
|
39
|
-
'PREVIOUS': 'Prev',
|
|
40
|
-
'PROCESS': 'Process',
|
|
41
|
-
'QUIT': 'Quit',
|
|
42
|
-
'REDO': 'Redo',
|
|
43
|
-
'REFRESH': 'Refresh',
|
|
44
|
-
'REPORT': 'Report',
|
|
45
|
-
'RENAME': 'Rename',
|
|
46
|
-
'RESET': 'Reset',
|
|
47
|
-
'RESTORE': 'Restore',
|
|
48
|
-
'REVERT': 'Revert',
|
|
49
|
-
'RUN': 'Run',
|
|
50
|
-
'SAVE': 'Save',
|
|
51
|
-
'SCRIPT': 'Script',
|
|
52
|
-
'SAVE_PDF': 'Save as PDF',
|
|
53
|
-
'SEARCH': 'Search',
|
|
54
|
-
'SEND': 'Send',
|
|
55
|
-
'START': 'Start',
|
|
56
|
-
'UPDATE': 'Update',
|
|
57
|
-
'UPGRADE': 'Upgrade',
|
|
58
|
-
'UPLOAD': 'Upload',
|
|
59
|
-
'USE': 'Use',
|
|
60
|
-
'WINDOWS': 'Windows',
|
|
61
|
-
'YES': 'Yes',
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
strings = copy(psi_strings)
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
class Text():
|
|
68
|
-
"""Combines package level and psiutils strings."""
|
|
69
|
-
def __init__(self) -> None:
|
|
70
|
-
"""
|
|
71
|
-
Initialise the object with attributes based on the key-value pairs
|
|
72
|
-
in the `strings` dictionary.
|
|
73
|
-
|
|
74
|
-
Args:
|
|
75
|
-
self: The instance of the class.
|
|
76
|
-
|
|
77
|
-
Returns:
|
|
78
|
-
None
|
|
79
|
-
"""
|
|
80
|
-
self.strings = strings
|
|
81
|
-
for key, string in strings.items():
|
|
82
|
-
setattr(self, key, string)
|
|
83
|
-
|
|
84
|
-
# Optionally display contents of `strings`
|
|
85
|
-
def display(self, compare: dict = None) -> None:
|
|
86
|
-
"""Print out contents of `strings` and compare if
|
|
87
|
-
a dict of strings is provided."""
|
|
88
|
-
duplicates = 0
|
|
89
|
-
overrides = 0
|
|
90
|
-
app_strings = 0
|
|
91
|
-
if not compare:
|
|
92
|
-
compare = {}
|
|
93
|
-
|
|
94
|
-
for key, item in compare.items():
|
|
95
|
-
if key not in strings:
|
|
96
|
-
strings[key] = item
|
|
97
|
-
|
|
98
|
-
for item in sorted(list(strings)):
|
|
99
|
-
output = f'{item:.<20} {strings[item]}'
|
|
100
|
-
if item in compare:
|
|
101
|
-
if strings[item] != compare[item]:
|
|
102
|
-
output = (f'{output}, {compare[item]} '
|
|
103
|
-
f'<{"-"*10} //override//')
|
|
104
|
-
overrides += 1
|
|
105
|
-
elif item not in psi_strings:
|
|
106
|
-
output = f'{output} <{"="*10} //app string//'
|
|
107
|
-
app_strings += 1
|
|
108
|
-
else:
|
|
109
|
-
output = f'{output} <{"="*10} //duplicate//'
|
|
110
|
-
duplicates += 1
|
|
111
|
-
print(output)
|
|
112
|
-
|
|
113
|
-
if duplicates:
|
|
114
|
-
print()
|
|
115
|
-
print(f'{duplicates} duplicates found')
|
|
116
|
-
|
|
117
|
-
if overrides:
|
|
118
|
-
print()
|
|
119
|
-
print(f'{overrides} overrides found')
|
|
120
|
-
|
|
121
|
-
if app_strings:
|
|
122
|
-
print()
|
|
123
|
-
print(f'{app_strings} application strings found')
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|