vappman 2.0.6__py3-none-any.whl → 2.1.1__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/AppmanVars.py CHANGED
@@ -28,7 +28,7 @@ class AppmanVars:
28
28
  """Returns True if appman-mode file exists."""
29
29
  return not self.is_user_mode()
30
30
 
31
- def set_system_mode(self, enable: bool):
31
+ def set_system_mode_cheat(self, enable: bool):
32
32
  """Sets the mode by creating or removing the appman-mode file."""
33
33
  try:
34
34
  if enable:
vappman/main.py CHANGED
@@ -140,9 +140,10 @@ class HomeScreen(VappmanScreen):
140
140
 
141
141
  title = "APPMAN"
142
142
  if not app.has_appman:
143
- title = 'm:AM-SYSTEM' if app.opts.in_system_mode else 'm:AM-USER'
144
- if app.appman.is_system_mode() != app.opts.in_system_mode:
145
- app.appman.set_system_mode(app.opts.in_system_mode)
143
+ was_in_system_mode = app.in_system_mode
144
+ app.in_system_mode = app.appman.is_system_mode()
145
+ title = 'm:AM-SYSTEM' if app.in_system_mode else 'm:AM-USER'
146
+ if was_in_system_mode != app.in_system_mode:
146
147
  app.installs, app.installs_by_appname = app.get_installed(repull=False)
147
148
  # Save persistent state if any options changed
148
149
  app.disk_state.save_if_changed(app.opts)
@@ -173,7 +174,7 @@ class HomeScreen(VappmanScreen):
173
174
  else:
174
175
  line += ns.synopsis
175
176
 
176
- status = "installed" if app.opts.in_system_mode or 'U' in where else "uninstalled"
177
+ status = "installed" if app.in_system_mode or 'U' in where else "uninstalled"
177
178
  win.add_body(line, context=Context(status, info=ns))
178
179
 
179
180
  if idx == win.pick_pos:
@@ -349,6 +350,13 @@ class HomeScreen(VappmanScreen):
349
350
  app.win.passthrough_mode = True
350
351
  return None
351
352
 
353
+ def toggle_system_mode_ACTION(self):
354
+ """ Switch between user and system mode """
355
+ app = self.app
356
+ if app.in_system_mode:
357
+ return app.run_appman('--user')
358
+ return app.run_appman('--system')
359
+
352
360
 
353
361
  class VappmanHelpScreen(BasicHelpScreen):
354
362
  """Help screen with vappman-specific additions"""
@@ -402,6 +410,7 @@ class Vappman(Prerequisites):
402
410
  self.apps_by_name_db = self.cache_mgr.apps_by_key
403
411
  self.saved_outputs = {}
404
412
  self.installs, self.installs_by_appname = self.get_installed() # dict keyed by app
413
+ self.in_system_mode = self.appman.is_system_mode()
405
414
 
406
415
  win_opts = ConsoleWindowOpts()
407
416
  win_opts.head_line=True
@@ -432,8 +441,7 @@ class Vappman(Prerequisites):
432
441
  spin.add_key('fancy_header', '_ - fancy header mode', vals=['Underline', 'Reverse', 'Off'])
433
442
  spin.add_key('demo_mode', '* - demo_mode', vals=[False, True])
434
443
  if not self.has_appman:
435
- spin.add_key('in_system_mode', 'm - AM system mode', vals=[False, True])
436
- self.opts.in_system_mode = self.appman.is_system_mode()
444
+ spin.add_key('toggle_system_mode', 'm - toggle system mode', genre='action')
437
445
  spin.add_key('max_backups', '# - max backups per app', vals=[-1, 2, 1])
438
446
  self.opts.max_backups = self.disk_state.max_backups
439
447
  self.opts.install_opts = self.disk_state.install_opts
@@ -546,7 +554,7 @@ class Vappman(Prerequisites):
546
554
  if 'files' in cmd.split():
547
555
  if current_in_user_mode is True:
548
556
  # temp: promote to system mode to get all apps
549
- self.appman.set_system_mode(True)
557
+ self.appman.set_system_mode_cheat(True)
550
558
 
551
559
  # Run the command and capture the output
552
560
  try:
@@ -556,11 +564,11 @@ class Vappman(Prerequisites):
556
564
  except Exception as exc:
557
565
  ConsoleWindow.stop_curses()
558
566
  if current_in_user_mode is True:
559
- self.appman.set_system_mode(False)
567
+ self.appman.set_system_mode_cheat(False)
560
568
  print(f'FAILED: {command}: {exc}')
561
569
  sys.exit(1)
562
570
  if current_in_user_mode is True:
563
- self.appman.set_system_mode(False)
571
+ self.appman.set_system_mode_cheat(False)
564
572
 
565
573
  if result.returncode != 0:
566
574
  print(f'WARNING: {command}: {result.returncode=}')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vappman
3
- Version: 2.0.6
3
+ Version: 2.1.1
4
4
  Summary: A visual wrapper for appman
5
5
  Keywords: app,installer,manager,appimages
6
6
  Author-email: Joe Defen <joedef@google.com>
@@ -10,7 +10,7 @@ Classifier: Programming Language :: Python :: 3
10
10
  Classifier: License :: OSI Approved :: MIT License
11
11
  Classifier: Operating System :: POSIX :: Linux
12
12
  License-File: LICENSE
13
- Requires-Dist: console-window >= 1.2.1
13
+ Requires-Dist: console-window == 1.3.2
14
14
  Project-URL: Bug Tracker, https://github.com/joedefen/vappman/issues
15
15
  Project-URL: Homepage, https://github.com/joedefen/vappman
16
16
 
@@ -32,7 +32,7 @@ Project-URL: Homepage, https://github.com/joedefen/vappman
32
32
 
33
33
  #### Key Features (Added in V2)
34
34
 
35
- * **Dual Mode Support**: Works with both `am` (system-wide) and `appman` (user-local). One key (`m`) switches instantly between user (local install) and system (non-local install) modes when using `am`.
35
+ * **Dual Mode Support**: Works with both `am` (system-wide) and `appman` (user-local). The (`m`) m-key toggles user (local install) and system (non-local install) modes when using `am`.
36
36
  * **Multi-Database Support**: Access all of `am`'s app databases including:
37
37
  * `am` - Main AppImage database with 2000+ portable Linux applications
38
38
  * `busybox` - Minimal Unix utilities as binaries
@@ -1,14 +1,14 @@
1
1
  vappman/AppimageDoctor.py,sha256=ohXy5xgTRDXIp2TrbacOqUp_VVODYTdsPrFFk5EeOds,13497
2
2
  vappman/AppmanLauncher.py,sha256=T3RXi3CpsdoSmVMMlkkuLHnQpUT2IcjRU0V3Lw6hA6Y,8774
3
- vappman/AppmanVars.py,sha256=TyLtHxJfhnWnbWBVzgU-a6ncX-eoCtyKHkZRwyO84SI,3725
3
+ vappman/AppmanVars.py,sha256=reA_3TPvkhD3BUDuVEBAFGMS6uOmzjsQhOIJ7pdmttk,3731
4
4
  vappman/CommandRunner.py,sha256=-fF2dH58SODBRXannU8EhKDa8LLP-9_25Tyo8IDSXAQ,1264
5
5
  vappman/PersistentState.py,sha256=65aOCaW5pbHdFFQtBYZB0TwQAvHgMFzwDLkPXRQxoGw,3275
6
6
  vappman/Prerequisites.py,sha256=iBUkBQqPCNV-BXKDzZmKh7xaKGZE1QFzYTjbd3cuATE,10177
7
7
  vappman/VappmanListCache.py,sha256=lsA82WyGssYherJ3lK1DGABghbAupDNfLOgyu3C9-Oc,9852
8
8
  vappman/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
- vappman/main.py,sha256=5sxkskEETKsc2jcgaV3402z7zp5gJF6JpFTYiiS1ubw,31880
10
- vappman-2.0.6.dist-info/entry_points.txt,sha256=c9NHAQ8xJLkwtSWlw_nGNlAPCMODp_qGj4wlaHvbVUM,45
11
- vappman-2.0.6.dist-info/licenses/LICENSE,sha256=qB9OdnyyF6WYHiEIXVm0rOSdcf8e2ctorrtWs6CC5lU,1062
12
- vappman-2.0.6.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
13
- vappman-2.0.6.dist-info/METADATA,sha256=xKaWUOJYAltkYhV9wFzmknt5GVIw3QQHahNJ-p3iKWo,12395
14
- vappman-2.0.6.dist-info/RECORD,,
9
+ vappman/main.py,sha256=b0KpZvtTioDnUPGR7lYX2pEbJ3ddbaMFanFI2jVXE2A,32149
10
+ vappman-2.1.1.dist-info/entry_points.txt,sha256=c9NHAQ8xJLkwtSWlw_nGNlAPCMODp_qGj4wlaHvbVUM,45
11
+ vappman-2.1.1.dist-info/licenses/LICENSE,sha256=qB9OdnyyF6WYHiEIXVm0rOSdcf8e2ctorrtWs6CC5lU,1062
12
+ vappman-2.1.1.dist-info/WHEEL,sha256=G2gURzTEtmeR8nrdXUJfNiB3VYVxigPQ-bEQujpNiNs,82
13
+ vappman-2.1.1.dist-info/METADATA,sha256=AZU6Qf6YZJQzhJcrfvpBCZx5IyZbEiyZm2-KWvVHLvU,12378
14
+ vappman-2.1.1.dist-info/RECORD,,