listpick 0.1.13.57__py3-none-any.whl → 0.1.13.58__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/listpick_app.py +86 -41
- listpick/listpick_app_problem_branch.py +3248 -0
- listpick/utils/utils.py +5 -5
- {listpick-0.1.13.57.dist-info → listpick-0.1.13.58.dist-info}/METADATA +1 -1
- {listpick-0.1.13.57.dist-info → listpick-0.1.13.58.dist-info}/RECORD +9 -8
- {listpick-0.1.13.57.dist-info → listpick-0.1.13.58.dist-info}/WHEEL +0 -0
- {listpick-0.1.13.57.dist-info → listpick-0.1.13.58.dist-info}/entry_points.txt +0 -0
- {listpick-0.1.13.57.dist-info → listpick-0.1.13.58.dist-info}/licenses/LICENSE.txt +0 -0
- {listpick-0.1.13.57.dist-info → listpick-0.1.13.58.dist-info}/top_level.txt +0 -0
listpick/utils/utils.py
CHANGED
|
@@ -36,7 +36,7 @@ def clip_left(text, n):
|
|
|
36
36
|
width += char_width
|
|
37
37
|
return text # If the total width is less than n, return the full string
|
|
38
38
|
|
|
39
|
-
def truncate_to_display_width(text: str, max_column_width: int, centre=False) -> str:
|
|
39
|
+
def truncate_to_display_width(text: str, max_column_width: int, centre=False, unicode_char_width: bool = True) -> str:
|
|
40
40
|
"""
|
|
41
41
|
Truncate and/or pad text to max_column_width using wcwidth to ensure visual width is correct
|
|
42
42
|
with foreign character sets.
|
|
@@ -74,16 +74,16 @@ def evaluate_cell(cell:str) -> str:
|
|
|
74
74
|
return str(eval(cell[1:]))
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
def format_row_full(row: list[str], hidden_columns:list = []) -> str:
|
|
77
|
+
def format_row_full(row: list[str], hidden_columns:list = [], unicode_char_width: bool = True) -> str:
|
|
78
78
|
""" Format list of strings as a tab-separated single string. No hidden columns. """
|
|
79
79
|
return '\t'.join(str(row[i]) for i in range(len(row)) if i not in hidden_columns)
|
|
80
80
|
|
|
81
|
-
def format_full_row(row:str) -> str:
|
|
81
|
+
def format_full_row(row:str, unicode_char_width: bool = True) -> str:
|
|
82
82
|
""" Format list of strings as a tab-separated single string. Includes hidden columns. """
|
|
83
83
|
return '\t'.join(row)
|
|
84
84
|
|
|
85
85
|
|
|
86
|
-
def format_row(row: list[str], hidden_columns: list, column_widths: list[int], separator: str, centre:bool=False) -> str:
|
|
86
|
+
def format_row(row: list[str], hidden_columns: list, column_widths: list[int], separator: str, centre:bool=False, unicode_char_width: bool = True) -> str:
|
|
87
87
|
""" Format list of strings as a single string. Requires separator string and the maximum width of the columns. """
|
|
88
88
|
row_str = ""
|
|
89
89
|
for i, cell in enumerate(row):
|
|
@@ -96,7 +96,7 @@ def format_row(row: list[str], hidden_columns: list, column_widths: list[int], s
|
|
|
96
96
|
return row_str
|
|
97
97
|
# return row_str.strip()
|
|
98
98
|
|
|
99
|
-
def get_column_widths(items: list[list[str]], header: list[str]=[], max_column_width:int=70, number_columns:bool=True, max_total_width=-1, separator = " ") -> list[int]:
|
|
99
|
+
def get_column_widths(items: list[list[str]], header: list[str]=[], max_column_width:int=70, number_columns:bool=True, max_total_width=-1, separator = " ", unicode_char_width: bool = True) -> list[int]:
|
|
100
100
|
""" Calculate maximum width of each column with clipping. """
|
|
101
101
|
if len(items) == 0: return [0]
|
|
102
102
|
assert len(items) > 0
|
|
@@ -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=
|
|
3
|
+
listpick/listpick_app.py,sha256=4XuOdhtslhNvVnwsAwuAY3v93CriOBQMFqkpfCvPuz4,165105
|
|
4
|
+
listpick/listpick_app_problem_branch.py,sha256=gystrBg75SqmUa3aUcL-AM7bv_oYJ3kimQKDCVic9Co,166625
|
|
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=s1L68MNmhWwbWRy0mn0ChmnE_dMQBAzNlTv917pyHE0,10673
|
|
@@ -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=
|
|
26
|
-
listpick-0.1.13.
|
|
27
|
-
listpick-0.1.13.
|
|
28
|
-
listpick-0.1.13.
|
|
29
|
-
listpick-0.1.13.
|
|
30
|
-
listpick-0.1.13.
|
|
31
|
-
listpick-0.1.13.
|
|
26
|
+
listpick/utils/utils.py,sha256=_4HW0p1gnundsTJcKsSsIKCZxy3DtolbxjBpuYQyFBw,12948
|
|
27
|
+
listpick-0.1.13.58.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
|
|
28
|
+
listpick-0.1.13.58.dist-info/METADATA,sha256=hH59V4Klb1XAOnkPY_-4mUz6hxePi4QvzlZPvrzvx0c,7988
|
|
29
|
+
listpick-0.1.13.58.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
30
|
+
listpick-0.1.13.58.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
|
|
31
|
+
listpick-0.1.13.58.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
|
|
32
|
+
listpick-0.1.13.58.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|