listpick 0.1.13.49__py3-none-any.whl → 0.1.13.51__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.
listpick/utils/utils.py CHANGED
@@ -51,26 +51,27 @@ def truncate_to_display_width(text: str, max_column_width: int, centre=False, un
51
51
  width = 0
52
52
 
53
53
 
54
- # for char in text:
55
- # w = wcwidth(char)
56
- # if w < 0:
57
- # continue
58
- # if width + w > max_column_width:
59
- # break
60
- # result += char
61
- # width += w
62
-
63
- test_str = text[:max_column_width]
64
- while True:
65
- width = wcswidth(test_str)
66
- if width < max_column_width or width == 0:
54
+ for char in text:
55
+ w = wcwidth(char)
56
+ if w < 0:
57
+ continue
58
+ if width + w > max_column_width:
67
59
  break
68
- test_str = test_str[:-1]
69
- result = test_str
60
+ result += char
61
+ width += w
62
+
63
+ # test_str = text[:max_column_width]
64
+ # while True:
65
+ # width = wcswidth(test_str)
66
+ # if width < max_column_width or width == 0:
67
+ # break
68
+ # test_str = test_str[:-1]
69
+ # result = test_str
70
70
 
71
71
 
72
72
  # Pad if it's shorter
73
73
  # padding = max_column_width - wcswidth(result)
74
+ # return result + ' ' * padding
74
75
  else:
75
76
  result = text[:max_column_width]
76
77
  width = len(result)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: listpick
3
- Version: 0.1.13.49
3
+ Version: 0.1.13.51
4
4
  Summary: Listpick is a powerful TUI data tool for creating TUI apps or viewing/comparing tabulated data.
5
5
  Home-page: https://github.com/grimandgreedy/listpick
6
6
  Author: Grim
@@ -1,6 +1,7 @@
1
1
  listpick/__init__.py,sha256=ExXc97-bibodH--wlwpQivl0zCNR5D1hvpvrf7OBofU,154
2
2
  listpick/__main__.py,sha256=wkCjDdqw093W27yWwnlC3nG_sMRKaIad7hHHWy0RBgY,193
3
- listpick/listpick_app.py,sha256=6dDEYHzXiQ5ZjWym7RpGqYMbUbrp1Mc546GQYOUXz3I,164074
3
+ listpick/listpick_app.py,sha256=sjt2HIRRfbai9S1GTjBZd-4oKldEbt9yPsqW0fA5KA4,166372
4
+ listpick/lpapp2.py,sha256=kBfQ-GUmPpfLAGs0y2yukJ7RWRkYQ6dGJNC52yqSrz8,162336
4
5
  listpick/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
6
  listpick/ui/build_help.py,sha256=_rVKKrX3HfFJtw-pyeNb2lQWbml4-AAw8sZIUYGn97Y,8731
6
7
  listpick/ui/footer.py,sha256=4PO7gS-NSk6zfc2DAwSFPU6Ch_HYfu0L_57u93zfyjk,10711
@@ -22,10 +23,10 @@ listpick/utils/search_and_filter_utils.py,sha256=XxGfkyDVXO9OAKcftPat8IReMTFIuTH
22
23
  listpick/utils/searching.py,sha256=Xk5UIqamNHL2L90z3ACB_Giqdpi9iRKoAJ6pKaqaD7Q,3093
23
24
  listpick/utils/sorting.py,sha256=WZZiVlVA3Zkcpwji3U5SNFlQ14zVEk3cZJtQirBkecQ,5329
24
25
  listpick/utils/table_to_list_of_lists.py,sha256=T-i-nV1p6g8UagdgUPKrhIGpKY_YXZDxf4xZzcPepNA,7635
25
- listpick/utils/utils.py,sha256=Jk0XY4V75qnGQI6MEQp0VEuXsNBVqnVHgRswMHgCks8,13788
26
- listpick-0.1.13.49.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
27
- listpick-0.1.13.49.dist-info/METADATA,sha256=Lf37ftgm1NyZxnQA7w-p8ERUhhQ9xKqb8Bprc0TrgZE,7988
28
- listpick-0.1.13.49.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
- listpick-0.1.13.49.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
30
- listpick-0.1.13.49.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
31
- listpick-0.1.13.49.dist-info/RECORD,,
26
+ listpick/utils/utils.py,sha256=bEE7-g3cyZd4QFHOxo4P6lXmuo0NwHTS_ovFC92po5w,13826
27
+ listpick-0.1.13.51.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
28
+ listpick-0.1.13.51.dist-info/METADATA,sha256=BlGQghy02c9SvJxrxkDGF7UabsK82dE9J-2fr-wVN6g,7988
29
+ listpick-0.1.13.51.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
30
+ listpick-0.1.13.51.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
31
+ listpick-0.1.13.51.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
32
+ listpick-0.1.13.51.dist-info/RECORD,,