vappman 0.5__py3-none-any.whl → 0.6__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.
- vappman/main.py +19 -27
- {vappman-0.5.dist-info → vappman-0.6.dist-info}/METADATA +13 -4
- vappman-0.6.dist-info/RECORD +9 -0
- vappman-0.5.dist-info/RECORD +0 -9
- {vappman-0.5.dist-info → vappman-0.6.dist-info}/LICENSE +0 -0
- {vappman-0.5.dist-info → vappman-0.6.dist-info}/WHEEL +0 -0
- {vappman-0.5.dist-info → vappman-0.6.dist-info}/entry_points.txt +0 -0
- {vappman-0.5.dist-info → vappman-0.6.dist-info}/top_level.txt +0 -0
vappman/main.py
CHANGED
|
@@ -33,21 +33,19 @@ class Vappman:
|
|
|
33
33
|
assert not Vappman.singleton
|
|
34
34
|
Vappman.singleton = self
|
|
35
35
|
|
|
36
|
-
self.summary_lines = []
|
|
37
|
-
self.new_summary_lines = True
|
|
38
|
-
|
|
39
36
|
spin = self.spin = OptionSpinner()
|
|
40
37
|
spin.add_key('help_mode', '? - toggle help screen', vals=[False, True])
|
|
41
38
|
|
|
42
39
|
# EXPAND
|
|
43
40
|
other = 'airbou/qscU'
|
|
44
41
|
other_keys = set(ord(x) for x in other)
|
|
42
|
+
other_keys.add(cs.KEY_ENTER)
|
|
43
|
+
other_keys.add(10) # another form of ENTER
|
|
45
44
|
self.opts = spin.default_obj
|
|
46
45
|
|
|
47
46
|
self.actions = {} # currently available actions
|
|
48
47
|
self.pick_app = '' # current picked app
|
|
49
48
|
self.pick_is_installed = False
|
|
50
|
-
# self.verbs = {'i': 'install', 'r': 'remove', 'v': 'view',}
|
|
51
49
|
self.prev_filter = '' # string
|
|
52
50
|
self.filter = None # compiled pattern
|
|
53
51
|
self.check_preqreqs()
|
|
@@ -95,7 +93,7 @@ class Vappman:
|
|
|
95
93
|
|
|
96
94
|
def get_installed(self):
|
|
97
95
|
""" Get the list of lines of installed apps """
|
|
98
|
-
rv = self.cmd_dict('appman files --
|
|
96
|
+
rv = self.cmd_dict('appman files --byname')
|
|
99
97
|
return rv
|
|
100
98
|
|
|
101
99
|
def main_loop(self):
|
|
@@ -116,6 +114,7 @@ class Vappman:
|
|
|
116
114
|
' c - clean (remove unneeded files/folters)',
|
|
117
115
|
' U - update ALL installed apps',
|
|
118
116
|
' / - filter apps',
|
|
117
|
+
' ENTER = install, remove, or return from help',
|
|
119
118
|
'CONTEXT SENSITIVE:',
|
|
120
119
|
' i - install uninstalled app',
|
|
121
120
|
' r - remove installed app',
|
|
@@ -133,15 +132,15 @@ class Vappman:
|
|
|
133
132
|
# self.win.set_pick_mode(self.opts.pick_mode, self.opts.pick_size)
|
|
134
133
|
self.win.set_pick_mode(True)
|
|
135
134
|
self.win.add_header(self.get_keys_line(), attr=cs.A_BOLD)
|
|
136
|
-
for line in self.installs.
|
|
135
|
+
for app, line in self.installs.items():
|
|
136
|
+
if app in self.apps:
|
|
137
|
+
line = self.apps[app]
|
|
137
138
|
if wanted(line):
|
|
139
|
+
line = '✔✔✔' + line[1:]
|
|
138
140
|
self.win.add_body(line)
|
|
139
141
|
for app, line in self.apps.items():
|
|
140
142
|
if app not in self.installs and wanted(line):
|
|
141
143
|
self.win.add_body(line)
|
|
142
|
-
# if self.new_summary_lines:
|
|
143
|
-
# self.win.pick_pos = self.win.scroll_pos = 0
|
|
144
|
-
# self.new_summary_lines = False
|
|
145
144
|
self.win.render()
|
|
146
145
|
|
|
147
146
|
_ = self.do_key(self.win.prompt(seconds=300))
|
|
@@ -206,34 +205,27 @@ class Vappman:
|
|
|
206
205
|
def run_appman(self, cmd):
|
|
207
206
|
Window.stop_curses()
|
|
208
207
|
os.system(f'clear; stty sane; {cmd};'
|
|
209
|
-
+ ' echo -e "\n\
|
|
208
|
+
+ ' /bin/echo -e "\n\n===== Press ENTER for menu ====> \c"; read FOO')
|
|
210
209
|
self.installs = self.get_installed()
|
|
211
210
|
Window._start_curses()
|
|
212
211
|
|
|
213
212
|
def do_key(self, key):
|
|
214
213
|
""" TBD """
|
|
215
|
-
def dashes(ns, ok=True):
|
|
216
|
-
try:
|
|
217
|
-
# use checkmark or circle-backslash
|
|
218
|
-
filler = ('\u2713' if ok else '\u2342') * (ns.end - ns.start)
|
|
219
|
-
line = self.summary_lines[self.win.pick_pos]
|
|
220
|
-
line = line[0:ns.start] + filler + line[ns.end:]
|
|
221
|
-
self.summary_lines[self.win.pick_pos] = line
|
|
222
|
-
self.win.draw(self.win.pick_pos, 0, line, width=self.win.get_pad_width(), header=False)
|
|
223
|
-
self.win.fix_positions(delta=1)
|
|
224
|
-
self.win.render()
|
|
225
|
-
except Exception:
|
|
226
|
-
pass
|
|
227
|
-
|
|
228
214
|
if not key:
|
|
229
215
|
return True
|
|
216
|
+
if key == cs.KEY_ENTER or key == 10: # Handle ENTER
|
|
217
|
+
if self.opts.help_mode:
|
|
218
|
+
self.opts.help_mode = False
|
|
219
|
+
return True
|
|
220
|
+
elif self.pick_is_installed:
|
|
221
|
+
key = ord('r') # removed installed app
|
|
222
|
+
else:
|
|
223
|
+
key = ord('i') # install uninstalled app
|
|
224
|
+
|
|
230
225
|
if key in self.spin.keys:
|
|
231
226
|
value = self.spin.do_key(key, self.win)
|
|
232
|
-
if key in (ord('p'), ord('s')):
|
|
233
|
-
self.win.set_pick_mode(on=self.opts.pick_mode, pick_size=self.opts.pick_size)
|
|
234
|
-
elif key == ord('n'):
|
|
235
|
-
self.win.alert(title='Info', message=f'got: {value}')
|
|
236
227
|
return value
|
|
228
|
+
|
|
237
229
|
if key == ord('q'):
|
|
238
230
|
self.win.stop_curses()
|
|
239
231
|
os.system('clear; stty sane')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vappman
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6
|
|
4
4
|
Summary: A visual wrapper for appman
|
|
5
5
|
Author-email: Joe Defen <joedef@google.com>
|
|
6
6
|
License: MIT
|
|
@@ -47,9 +47,16 @@ But it does NOT cover:
|
|
|
47
47
|
* It presents some keys available on the top line.
|
|
48
48
|
* Use '?' to learn the navigation keys (e.g., you can use the mouse wheel,
|
|
49
49
|
arrow keys, and many `vi`-like keys)
|
|
50
|
+
* '?' also elaborates the meaning of the available keys for operations.
|
|
51
|
+
* NOTE: `ENTER` acts differently based on context:
|
|
52
|
+
* In help, it returns to the main menu.
|
|
53
|
+
* On an uninstalled app, it installs it.
|
|
54
|
+
* On an installed app, it uninstalls it.
|
|
50
55
|
* Then `vappman` presents a list of installed apps, followed by available/uninstalled apps.
|
|
56
|
+
* Installed apps have prefix '✔✔✔' (i.e., three checks).
|
|
57
|
+
* Uninstalled apps have prefix '◆' (i.e., a solid diamond).
|
|
51
58
|
* Enter `/` to enter a "filter" for installed/uninstalled apps, if you wish.
|
|
52
|
-
* If you enter plain
|
|
59
|
+
* If you enter plain ole "words", then those words must match the beginning of words
|
|
53
60
|
of the apps or descriptions (in order, but not contiguously).
|
|
54
61
|
* Or you can enter an regular expression acceptable to python (e.g., `\b` means word
|
|
55
62
|
boundary, etc.)
|
|
@@ -61,9 +68,11 @@ But it does NOT cover:
|
|
|
61
68
|
---
|
|
62
69
|
|
|
63
70
|
NOTES: in this example:
|
|
64
|
-
* the filter is `card` so it shows
|
|
65
|
-
* the current position is on `glabels`;
|
|
71
|
+
* the filter is `card` so it shows app lines with words starting with `card`.
|
|
72
|
+
* the reverse video, current position is on `glabels`;
|
|
73
|
+
thus if `i` (or ENTER) is typed, `appman install glabels` is run.
|
|
66
74
|
* if the horizontal line (second line show) has no decorations, then you are looking
|
|
67
75
|
all the filtered apps; otherwise, the decoration suggests where you are in the
|
|
68
76
|
partial view of the filtered apps.
|
|
77
|
+
* the matching installed app has the '✔✔✔' prefix.
|
|
69
78
|
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
vappman/PowerWindow.py,sha256=OLCX-RkbJZ2wwaY7M-4Eo9PQuR95TWrGNIY8DdVRpsE,28567
|
|
2
|
+
vappman/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
vappman/main.py,sha256=rSWpH_l_IgH3jR4HSG-H8lvmuuAZWStPo-AMtSIsZYY,10483
|
|
4
|
+
vappman-0.6.dist-info/LICENSE,sha256=qB9OdnyyF6WYHiEIXVm0rOSdcf8e2ctorrtWs6CC5lU,1062
|
|
5
|
+
vappman-0.6.dist-info/METADATA,sha256=pWiQZo-R_ePgEX3Yz9oAcNty2XBmYCArV--3ErQd_HI,3850
|
|
6
|
+
vappman-0.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
7
|
+
vappman-0.6.dist-info/entry_points.txt,sha256=7_1MiUvkCJoElLePOCJYqhkQN4xmadBRQCKupOwzt90,46
|
|
8
|
+
vappman-0.6.dist-info/top_level.txt,sha256=5_Gb5oZh7s2-i62gLXZ6INVALAV9D0-yqh0TvNqpPC4,8
|
|
9
|
+
vappman-0.6.dist-info/RECORD,,
|
vappman-0.5.dist-info/RECORD
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
vappman/PowerWindow.py,sha256=OLCX-RkbJZ2wwaY7M-4Eo9PQuR95TWrGNIY8DdVRpsE,28567
|
|
2
|
-
vappman/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
vappman/main.py,sha256=1sbpuJQZpTMBjbFeb9hOCxCvAw1aXOq4SMaobEt0BH8,10951
|
|
4
|
-
vappman-0.5.dist-info/LICENSE,sha256=qB9OdnyyF6WYHiEIXVm0rOSdcf8e2ctorrtWs6CC5lU,1062
|
|
5
|
-
vappman-0.5.dist-info/METADATA,sha256=8Fvf5IBmf-6zWious1_hrz7QXE3I4k-8Zb_HQ6c1Iw0,3356
|
|
6
|
-
vappman-0.5.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
7
|
-
vappman-0.5.dist-info/entry_points.txt,sha256=7_1MiUvkCJoElLePOCJYqhkQN4xmadBRQCKupOwzt90,46
|
|
8
|
-
vappman-0.5.dist-info/top_level.txt,sha256=5_Gb5oZh7s2-i62gLXZ6INVALAV9D0-yqh0TvNqpPC4,8
|
|
9
|
-
vappman-0.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|