mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 16:24:16 +02:00
not adding flathub remote when it is not set
This commit is contained in:
@@ -99,7 +99,6 @@ class GenericApplicationManager(ApplicationManager):
|
||||
self.map = {m.get_app_type(): m for m in self.managers}
|
||||
self.disk_loader_factory = disk_loader_factory
|
||||
self._enabled_map = {} if app_args.check_packaging_once else None
|
||||
self.prepare()
|
||||
|
||||
def _sort(self, apps: List[Application], word: str) -> List[Application]:
|
||||
exact_name_matches, contains_name_matches, others = [], [], []
|
||||
|
||||
@@ -147,7 +147,7 @@ class FlatpakManager(ApplicationManager):
|
||||
raise Exception("'refresh' is not supported for {}".format(app.__class__.__name__))
|
||||
|
||||
def prepare(self):
|
||||
flatpak.set_default_remotes()
|
||||
pass
|
||||
|
||||
def list_updates(self) -> List[ApplicationUpdate]:
|
||||
updates = []
|
||||
@@ -179,4 +179,5 @@ class FlatpakManager(ApplicationManager):
|
||||
return updates
|
||||
|
||||
def list_warnings(self) -> List[str]:
|
||||
return None
|
||||
if not flatpak.has_remotes_set():
|
||||
return [self.locale_keys['flatpak.notification.no_remotes']]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import re
|
||||
import subprocess
|
||||
from typing import List, Set
|
||||
from typing import List
|
||||
|
||||
from fpakman.core import system
|
||||
from fpakman.core.exception import NoInternetException
|
||||
@@ -219,3 +219,7 @@ def install_and_stream(app_id: str, origin: str):
|
||||
|
||||
def set_default_remotes():
|
||||
system.run_cmd('flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo')
|
||||
|
||||
|
||||
def has_remotes_set() -> bool:
|
||||
return bool(system.run_cmd('{} remotes'.format(BASE_CMD)).strip())
|
||||
|
||||
Reference in New Issue
Block a user