psiutils 0.2.12__py3-none-any.whl → 0.2.13__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.
psiutils/_version.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.2.11'
1
+ __version__ = '0.2.13'
psiutils/buttons.py CHANGED
@@ -4,10 +4,12 @@ from tkinter import ttk
4
4
  from pathlib import Path
5
5
  from PIL import Image, ImageTk
6
6
 
7
- import psiutils.text as txt
7
+ from psiutils.text import Text
8
8
 
9
- from .constants import PAD, Pad
10
- from .widgets import enter_widget, clickable_widget, HAND
9
+ from psiutils.constants import PAD, Pad
10
+ from psiutils.widgets import enter_widget, clickable_widget, HAND
11
+
12
+ txt = Text()
11
13
 
12
14
 
13
15
  class IconButton(ttk.Frame):
psiutils/constants.py CHANGED
@@ -74,6 +74,7 @@ class Mode(Enum):
74
74
  EDIT = auto()
75
75
  DELETE = auto()
76
76
 
77
+
77
78
  class Status(Enum):
78
79
  YES = True
79
80
  NO = False
@@ -83,3 +84,4 @@ class Status(Enum):
83
84
  OK = 2
84
85
  UPDATED = 3
85
86
  ERROR = 4
87
+ WARNING = 5
psiutils/text.py CHANGED
@@ -1,52 +1,9 @@
1
- BUILD = 'Build'
2
- CANCEL = 'Cancel'
3
- CHECK = 'Check'
4
- CLEAR = 'Clear'
5
- CLOSE = 'Close'
6
- CODE = 'Code'
7
- COMPARE = 'Compare'
8
- CONFIG = 'Config'
9
- COPY = 'Copy'
10
- DELETE = 'Delete'
11
- DELETE_THESE_ITEMS = 'Are you sure you want to delete these item(s)?'
12
- DIFF = 'Diff'
13
- DONE = 'Done'
14
- EDIT = 'Edit'
15
- EVENT = 'Event'
16
- EXIT = 'Exit'
17
- HELP = 'Help'
18
- NEW = 'New'
19
- NEXT = 'Next'
20
- NO = 'No'
21
- NO_SUCH_FILE = 'no such file or directory'
22
- OK = 'OK'
23
- OPEN = 'Open'
24
- PAUSE = 'Pause'
25
- PREFERENCES = 'Preferences'
26
- PREVIOUS = 'Prev'
27
- PROCESS = 'Process'
28
- QUIT = 'Quit'
29
- REDO = 'Redo'
30
- REFRESH = 'Refresh'
31
- REPORT = 'Report'
32
- RENAME = 'Rename'
33
- RESET = 'Reset'
34
- REVERT = 'Revert'
35
- RUN = 'Run'
36
- SAVE = 'Save'
37
- SCRIPT = 'Script'
38
- SAVE_PDF = 'Save as PDF'
39
- SEARCH = 'Search'
40
- SEND = 'Send'
41
- START = 'Start'
42
- UPDATE = 'Update'
43
- UPGRADE = 'Upgrade'
44
- USE = 'Use'
45
- WINDOWS = 'Windows'
46
- YES = 'Yes'
1
+ """ Handle standard text for psiutils."""
47
2
 
3
+ from copy import copy
48
4
 
49
- strings = {
5
+
6
+ psi_strings = {
50
7
  'BUILD': 'Build',
51
8
  'CANCEL': 'Cancel',
52
9
  'CHECK': 'Check',
@@ -96,6 +53,8 @@ strings = {
96
53
  'YES': 'Yes',
97
54
  }
98
55
 
56
+ strings = copy(psi_strings)
57
+
99
58
 
100
59
  class Text():
101
60
  """Combines package level and psiutils strings."""
@@ -119,9 +78,15 @@ class Text():
119
78
  """Print out contents of `strings` and compare if
120
79
  a dict of strings is provided."""
121
80
  duplicates = 0
122
- overrides =0
81
+ overrides = 0
82
+ app_strings = 0
123
83
  if not compare:
124
84
  compare = {}
85
+
86
+ for key, item in compare.items():
87
+ if key not in strings:
88
+ strings[key] = item
89
+
125
90
  for item in sorted(list(strings)):
126
91
  output = f'{item:.<20} {strings[item]}'
127
92
  if item in compare:
@@ -129,6 +94,9 @@ class Text():
129
94
  output = (f'{output}, {compare[item]} '
130
95
  f'<{"-"*10} //override//')
131
96
  overrides += 1
97
+ elif item not in psi_strings:
98
+ output = f'{output} <{"="*10} //app string//'
99
+ app_strings += 1
132
100
  else:
133
101
  output = f'{output} <{"="*10} //duplicate//'
134
102
  duplicates += 1
@@ -141,3 +109,7 @@ class Text():
141
109
  if overrides:
142
110
  print()
143
111
  print(f'{overrides} overrides found')
112
+
113
+ if app_strings:
114
+ print()
115
+ print(f'{app_strings} application strings found')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: psiutils
3
- Version: 0.2.12
3
+ Version: 0.2.13
4
4
  Summary: Various TKinter utilities.
5
5
  Author: Jeff
6
6
  Author-email: Jeff <<jeffwatkins2000@gmail.com>>
@@ -2,9 +2,9 @@ psiutils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  psiutils/_about_frame.py,sha256=xZQivwvZc-k8C-SkwQne-dBr4gavDAL_32fv8E-7Wt0,7644
3
3
  psiutils/_logger.py,sha256=9nXxKWUyu4xqIILjTSUKRAMOG4cFy_EGJTTo0FtUAGU,2859
4
4
  psiutils/_notify.py,sha256=rQfYxPxsSwAEJBNXaAZSNlRmZLWB1sah1E1Oja9y-mw,437
5
- psiutils/_version.py,sha256=MDWVRBs0IWHig-yP3jl_AM0VvBpaMmDN0nBK4Hl8Idk,22
6
- psiutils/buttons.py,sha256=gnrEn8qk42SGf7dpdFqWlnxQFivBULlCAdeUIBeQZgE,8585
7
- psiutils/constants.py,sha256=HUXNOy-V9zGkvWRfOFNttQlq9exFLPoRvPSAfSCeuIg,1366
5
+ psiutils/_version.py,sha256=BzaUqLuMDa5m8WXD6rxGwHtx-G5rl0QutUD88ULNrkQ,22
6
+ psiutils/buttons.py,sha256=oqTNg1IckV1sr5d4-jD3QZW4B_Tz5TWTQUoPnvpDTwU,8618
7
+ psiutils/constants.py,sha256=Me3oFf7R3VNsq3rZL9pyjRySLzyPYHOow6mNWivVnwo,1383
8
8
  psiutils/drag_manager.py,sha256=L04GzKIinWXzGCawvTnn18F1AEt8PUPS1U-HqCVrh48,3470
9
9
  psiutils/errors.py,sha256=tAypFkpzpbeOppO9zKQimlnRVyr3sMPoiwh0yK3Yc88,562
10
10
  psiutils/icecream_init.py,sha256=ArKnRHGCyMfEwSykiHGdhBmX4JPhrgcpShii_GAPWLI,739
@@ -48,10 +48,10 @@ psiutils/images/icon-query.png,sha256=e18hqkew4eOxABvECKn7BGO2VTHTE-XLMWPSQfSW9d
48
48
  psiutils/known_paths.py,sha256=Ydhk-Ie_q827ti35Hru8YwUx5awdO2FEG845k1N0hPo,9543
49
49
  psiutils/menus.py,sha256=4pUHb3fEYzLnsftxdKB_NjlPryj_pu7WN5Iy5Quy9-M,1746
50
50
  psiutils/messagebox.py,sha256=14W4KzEg8Fi1OCiOX9zZvomoSqibAYNipQpa95Tco5M,4969
51
- psiutils/text.py,sha256=HVJME2oUqeLZXCp2KaHg21vlp3CuhoP2T4T7ArqIxLs,3378
51
+ psiutils/text.py,sha256=2q4whK-DjZZNOlTLt811bbaNGhg0T3MafSSPU2c5PMg,3048
52
52
  psiutils/treeview.py,sha256=jtSzLWrnFIBDWV5YhWNRoZwgW-Kj8_7XVqZyusr-riQ,2826
53
53
  psiutils/utilities.py,sha256=bAoaYMumo0U8kz4pcPThYOY5Z3tPFe-a76Nhbwsd4lk,3005
54
54
  psiutils/widgets.py,sha256=ooGAy0IU3ct9aeqnBqMUr2AVyqg_zKHG8Fm9Gm-Wn5Y,11114
55
- psiutils-0.2.12.dist-info/WHEEL,sha256=pFCy50wRV2h7SjJ35YOsQUupaV45rMdgpNIvnXbG5bE,79
56
- psiutils-0.2.12.dist-info/METADATA,sha256=yOG5ZW3MhjSDhwwXtga_znea2tNVXE0jyPPjhrS_-6s,1982
57
- psiutils-0.2.12.dist-info/RECORD,,
55
+ psiutils-0.2.13.dist-info/WHEEL,sha256=5w2T7AS2mz1-rW9CNagNYWRCaB0iQqBMYLwKdlgiR4Q,78
56
+ psiutils-0.2.13.dist-info/METADATA,sha256=Cm932l43m8MzC-KboOHPzqpxupHS7ZJDrXeU156BN2U,1982
57
+ psiutils-0.2.13.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: uv 0.8.19
2
+ Generator: uv 0.9.7
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any