listpick 0.1.14.6__py3-none-any.whl → 0.1.14.7__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 +16 -7
- {listpick-0.1.14.6.dist-info → listpick-0.1.14.7.dist-info}/METADATA +1 -1
- {listpick-0.1.14.6.dist-info → listpick-0.1.14.7.dist-info}/RECORD +7 -7
- {listpick-0.1.14.6.dist-info → listpick-0.1.14.7.dist-info}/WHEEL +0 -0
- {listpick-0.1.14.6.dist-info → listpick-0.1.14.7.dist-info}/entry_points.txt +0 -0
- {listpick-0.1.14.6.dist-info → listpick-0.1.14.7.dist-info}/licenses/LICENSE.txt +0 -0
- {listpick-0.1.14.6.dist-info → listpick-0.1.14.7.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
|
"""
|
|
@@ -3684,7 +3693,7 @@ def main() -> None:
|
|
|
3684
3693
|
app.load_input_history("~/.config/listpick/cmdhist.json")
|
|
3685
3694
|
app.run()
|
|
3686
3695
|
|
|
3687
|
-
app.save_input_history("~/.config/listpick/cmdhist.json")
|
|
3696
|
+
# app.save_input_history("~/.config/listpick/cmdhist.json")
|
|
3688
3697
|
except Exception as e:
|
|
3689
3698
|
print(e)
|
|
3690
3699
|
|
|
@@ -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=ZSfPfFbztHdjRiZVTiUi0XEKgCLWsupLrGmCPi2T9-I,188702
|
|
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.7.dist-info/licenses/LICENSE.txt,sha256=2mP-MRHJptADDNE9VInMNg1tE-C6Qv93Z4CCQKrpg9w,1061
|
|
28
|
+
listpick-0.1.14.7.dist-info/METADATA,sha256=L6KW4_BETNSyFC4HvwMLyzoU-K1uZy2KSF5RhV4z-II,8090
|
|
29
|
+
listpick-0.1.14.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
30
|
+
listpick-0.1.14.7.dist-info/entry_points.txt,sha256=-QCf_BKIkUz35Y9nkYpjZWs2Qg0KfRna2PAs5DnF6BE,43
|
|
31
|
+
listpick-0.1.14.7.dist-info/top_level.txt,sha256=5mtsGEz86rz3qQDe0D463gGjAfSp6A3EWg4J4AGYr-Q,9
|
|
32
|
+
listpick-0.1.14.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|