vappman 0.5__tar.gz → 0.6__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vappman
3
- Version: 0.5
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 old "words", then those words must match the beginning of words
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 apps with words starting with `card`.
65
- * the current position is on `glabels`; thus if `i` is typed, `appman install glabels` is run.
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
 
@@ -29,9 +29,16 @@ But it does NOT cover:
29
29
  * It presents some keys available on the top line.
30
30
  * Use '?' to learn the navigation keys (e.g., you can use the mouse wheel,
31
31
  arrow keys, and many `vi`-like keys)
32
+ * '?' also elaborates the meaning of the available keys for operations.
33
+ * NOTE: `ENTER` acts differently based on context:
34
+ * In help, it returns to the main menu.
35
+ * On an uninstalled app, it installs it.
36
+ * On an installed app, it uninstalls it.
32
37
  * Then `vappman` presents a list of installed apps, followed by available/uninstalled apps.
38
+ * Installed apps have prefix '✔✔✔' (i.e., three checks).
39
+ * Uninstalled apps have prefix '◆' (i.e., a solid diamond).
33
40
  * Enter `/` to enter a "filter" for installed/uninstalled apps, if you wish.
34
- * If you enter plain old "words", then those words must match the beginning of words
41
+ * If you enter plain ole "words", then those words must match the beginning of words
35
42
  of the apps or descriptions (in order, but not contiguously).
36
43
  * Or you can enter an regular expression acceptable to python (e.g., `\b` means word
37
44
  boundary, etc.)
@@ -43,9 +50,11 @@ But it does NOT cover:
43
50
  ---
44
51
 
45
52
  NOTES: in this example:
46
- * the filter is `card` so it shows apps with words starting with `card`.
47
- * the current position is on `glabels`; thus if `i` is typed, `appman install glabels` is run.
53
+ * the filter is `card` so it shows app lines with words starting with `card`.
54
+ * the reverse video, current position is on `glabels`;
55
+ thus if `i` (or ENTER) is typed, `appman install glabels` is run.
48
56
  * if the horizontal line (second line show) has no decorations, then you are looking
49
57
  all the filtered apps; otherwise, the decoration suggests where you are in the
50
58
  partial view of the filtered apps.
59
+ * the matching installed app has the '✔✔✔' prefix.
51
60
 
@@ -55,7 +55,7 @@ build-backend = "setuptools.build_meta"
55
55
 
56
56
  [project]
57
57
  name = "vappman"
58
- version = "0.5"
58
+ version = "0.6"
59
59
  description = "A visual wrapper for appman"
60
60
  authors = [
61
61
  { name = "Joe Defen", email = "joedef@google.com" }
@@ -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 --by-name')
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.values():
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\nHit ENTER to return to menu"; read FOO')
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.5
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 old "words", then those words must match the beginning of words
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 apps with words starting with `card`.
65
- * the current position is on `glabels`; thus if `i` is typed, `appman install glabels` is run.
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
 
File without changes
File without changes
File without changes
File without changes