listpick 0.1.14.6__py3-none-any.whl → 0.1.14.8__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 +22 -8
- {listpick-0.1.14.6.dist-info → listpick-0.1.14.8.dist-info}/METADATA +1 -1
- {listpick-0.1.14.6.dist-info → listpick-0.1.14.8.dist-info}/RECORD +7 -7
- {listpick-0.1.14.6.dist-info → listpick-0.1.14.8.dist-info}/WHEEL +0 -0
- {listpick-0.1.14.6.dist-info → listpick-0.1.14.8.dist-info}/entry_points.txt +0 -0
- {listpick-0.1.14.6.dist-info → listpick-0.1.14.8.dist-info}/licenses/LICENSE.txt +0 -0
- {listpick-0.1.14.6.dist-info → listpick-0.1.14.8.dist-info}/top_level.txt +0 -0
listpick/listpick_app.py
CHANGED
|
@@ -352,9 +352,17 @@ class Picker:
|
|
|
352
352
|
size += sys.getsizeof(getattr(self, attr_name))
|
|
353
353
|
return size
|
|
354
354
|
|
|
355
|
-
def set_config(self, path: str ="~/.config/listpick/config.toml"):
|
|
355
|
+
def set_config(self, path: str ="~/.config/listpick/config.toml") -> bool:
|
|
356
356
|
""" Set config from toml file. """
|
|
357
|
-
|
|
357
|
+
path = os.path.expanduser(os.path.expandvars(path))
|
|
358
|
+
if not os.path.exists(path):
|
|
359
|
+
return False
|
|
360
|
+
try:
|
|
361
|
+
config = self.get_config(path)
|
|
362
|
+
except Exception as e:
|
|
363
|
+
self.logger.error(f"get_config({path}) load error. {e}")
|
|
364
|
+
return False
|
|
365
|
+
|
|
358
366
|
self.logger.info(f"function: set_config()")
|
|
359
367
|
if "general" in config:
|
|
360
368
|
for key, val in config["general"].items():
|
|
@@ -363,16 +371,17 @@ class Picker:
|
|
|
363
371
|
setattr(self, key, val)
|
|
364
372
|
except Exception as e:
|
|
365
373
|
self.logger.error(f"set_config: key={key}, val={val}. {e}")
|
|
374
|
+
return True
|
|
375
|
+
|
|
366
376
|
|
|
367
377
|
|
|
368
378
|
def get_config(self, path: str ="~/.config/listpick/config.toml") -> dict:
|
|
369
379
|
""" Get config from file. """
|
|
370
380
|
self.logger.info(f"function: get_config()")
|
|
371
381
|
import toml
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
return config
|
|
382
|
+
with open(os.path.expanduser(path), "r") as f:
|
|
383
|
+
config = toml.load(f)
|
|
384
|
+
return config
|
|
376
385
|
|
|
377
386
|
def calculate_section_sizes(self):
|
|
378
387
|
"""
|
|
@@ -867,10 +876,10 @@ class Picker:
|
|
|
867
876
|
else:
|
|
868
877
|
cell_value = self.indexed_items[row][1][col] + self.separator
|
|
869
878
|
# cell_value = cell_value[:min(cell_width, cell_max_width)-len(self.separator)]
|
|
870
|
-
cell_value = truncate_to_display_width(cell_value, min(cell_width, cell_max_width)-len(self.separator), self.unicode_char_width)
|
|
879
|
+
cell_value = truncate_to_display_width(cell_value, min(cell_width, cell_max_width)-len(self.separator), self.centre_in_cols, self.unicode_char_width)
|
|
871
880
|
cell_value = cell_value + self.separator
|
|
872
881
|
# cell_value = cell_value
|
|
873
|
-
cell_value = truncate_to_display_width(cell_value, min(cell_width, cell_max_width), self.unicode_char_width)
|
|
882
|
+
cell_value = truncate_to_display_width(cell_value, min(cell_width, cell_max_width), self.centre_in_cols, self.unicode_char_width)
|
|
874
883
|
# row_str = truncate_to_display_width(row_str_left_adj, min(w-self.startx, visible_columns_total_width))
|
|
875
884
|
self.stdscr.addstr(y, cell_pos, cell_value, curses.color_pair(self.colours_start+colour_pair_number) | curses.A_BOLD)
|
|
876
885
|
# Part of the cell is on screen
|
|
@@ -1112,6 +1121,7 @@ class Picker:
|
|
|
1112
1121
|
"hidden_columns": [],
|
|
1113
1122
|
"title": title,
|
|
1114
1123
|
"reset_colours": False,
|
|
1124
|
+
"cell_cursor": False,
|
|
1115
1125
|
}
|
|
1116
1126
|
|
|
1117
1127
|
OptionPicker = Picker(submenu_win, **infobox_data)
|
|
@@ -1352,6 +1362,7 @@ class Picker:
|
|
|
1352
1362
|
"cancel_is_back": True,
|
|
1353
1363
|
"number_columns": False,
|
|
1354
1364
|
"reset_colours": False,
|
|
1365
|
+
"cell_cursor": False,
|
|
1355
1366
|
}
|
|
1356
1367
|
while True:
|
|
1357
1368
|
h, w = stdscr.getmaxyx()
|
|
@@ -1418,6 +1429,7 @@ class Picker:
|
|
|
1418
1429
|
"loaded_file_states": [],
|
|
1419
1430
|
"loaded_file": "",
|
|
1420
1431
|
"loaded_file_index": 0,
|
|
1432
|
+
"cell_cursor": False,
|
|
1421
1433
|
}
|
|
1422
1434
|
OptionPicker = Picker(submenu_win, **notification_data)
|
|
1423
1435
|
s, o, f = OptionPicker.run()
|
|
@@ -2297,6 +2309,7 @@ class Picker:
|
|
|
2297
2309
|
"centre_in_terminal_vertical": True,
|
|
2298
2310
|
"hidden_columns": [],
|
|
2299
2311
|
"reset_colours": False,
|
|
2312
|
+
"cell_cursor": False,
|
|
2300
2313
|
|
|
2301
2314
|
}
|
|
2302
2315
|
OptionPicker = Picker(self.stdscr, **help_data)
|
|
@@ -2407,6 +2420,7 @@ class Picker:
|
|
|
2407
2420
|
"centre_in_terminal_vertical": True,
|
|
2408
2421
|
"hidden_columns": [],
|
|
2409
2422
|
"reset_colours": False,
|
|
2423
|
+
"cell_cursor": False,
|
|
2410
2424
|
|
|
2411
2425
|
}
|
|
2412
2426
|
OptionPicker = Picker(self.stdscr, **info_data)
|
|
@@ -1,6 +1,6 @@
|
|
|
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=NVIY6VGD-yvZ_Lgwheqg53t2N1cgfmmqfbQslF8AgZo,188936
|
|
4
4
|
listpick/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
listpick/ui/build_help.py,sha256=8QtsRosIE2IMagRc_remzmwSWpCurFgLenLL7w1ly94,8949
|
|
6
6
|
listpick/ui/footer.py,sha256=ZM5OWCxOZqy5RG6tFTe1ipvu9PRu6Gh3JCA8KXBR_Wc,15004
|
|
@@ -24,9 +24,9 @@ listpick/utils/searching.py,sha256=Xk5UIqamNHL2L90z3ACB_Giqdpi9iRKoAJ6pKaqaD7Q,3
|
|
|
24
24
|
listpick/utils/sorting.py,sha256=WZZiVlVA3Zkcpwji3U5SNFlQ14zVEk3cZJtQirBkecQ,5329
|
|
25
25
|
listpick/utils/table_to_list_of_lists.py,sha256=XBj7eGBDF15BRME-swnoXyOfZWxXCxrXp0pzsBfcJ5g,12224
|
|
26
26
|
listpick/utils/utils.py,sha256=McOl9uT3jh7l4TIWeSd8ZGjK_e7r0YZF0Gl20yI6fl0,13873
|
|
27
|
-
listpick-0.1.14.
|
|
28
|
-
listpick-0.1.14.
|
|
29
|
-
listpick-0.1.14.
|
|
30
|
-
listpick-0.1.14.
|
|
31
|
-
listpick-0.1.14.
|
|
32
|
-
listpick-0.1.14.
|
|
27
|
+
listpick-0.1.14.8.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
|
|
28
|
+
listpick-0.1.14.8.dist-info/METADATA,sha256=knTrmh3fmbsj_HcTRytEtKHYUQGgejK5YJjlq0BSd74,8090
|
|
29
|
+
listpick-0.1.14.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
30
|
+
listpick-0.1.14.8.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
|
|
31
|
+
listpick-0.1.14.8.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
|
|
32
|
+
listpick-0.1.14.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|