mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-08 15:34:15 +02:00
0.9.17
This commit is contained in:
@@ -606,9 +606,8 @@ class AppImageManager(SoftwareManager):
|
||||
def set_enabled(self, enabled: bool):
|
||||
self.enabled = enabled
|
||||
|
||||
def _is_sqlite3_available(self):
|
||||
res = run_cmd('which sqlite3')
|
||||
return res and not res.strip().startswith('which ')
|
||||
def _is_sqlite3_available(self) -> bool:
|
||||
return bool(shutil.which('sqlite3'))
|
||||
|
||||
def can_work(self) -> bool:
|
||||
return self._is_sqlite3_available() and self.file_downloader.can_work()
|
||||
|
||||
@@ -2649,9 +2649,8 @@ class ArchManager(SoftwareManager):
|
||||
|
||||
return res
|
||||
|
||||
def _is_wget_available(self):
|
||||
res = run_cmd('which wget')
|
||||
return res and not res.strip().startswith('which ')
|
||||
def _is_wget_available(self) -> bool:
|
||||
return bool(shutil.which('wget'))
|
||||
|
||||
def is_enabled(self) -> bool:
|
||||
return self.enabled
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import shutil
|
||||
from datetime import datetime
|
||||
from typing import List, Tuple, Optional
|
||||
|
||||
@@ -6,8 +7,7 @@ from bauh.commons.system import new_subprocess, SimpleProcess
|
||||
|
||||
|
||||
def is_installed() -> bool:
|
||||
code, _ = system.execute(cmd='which git', output=False)
|
||||
return code == 0
|
||||
return bool(shutil.which('git'))
|
||||
|
||||
|
||||
def list_commits(proj_dir: str) -> List[dict]:
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
from threading import Thread
|
||||
from typing import List, Set, Tuple, Dict, Iterable, Optional
|
||||
|
||||
@@ -26,8 +27,7 @@ RE_DESKTOP_FILES = re.compile(r'\n?([\w\-_]+)\s+(/usr/share/.+\.desktop)')
|
||||
|
||||
|
||||
def is_available() -> bool:
|
||||
res = run_cmd('which pacman', print_error=False)
|
||||
return res and not res.strip().startswith('which ')
|
||||
return bool(shutil.which('pacman'))
|
||||
|
||||
|
||||
def get_repositories(pkgs: Iterable[str]) -> dict:
|
||||
@@ -463,8 +463,7 @@ def get_databases() -> Set[str]:
|
||||
|
||||
|
||||
def can_refresh_mirrors() -> bool:
|
||||
output = run_cmd('which pacman-mirrors', print_error=False)
|
||||
return True if output else False
|
||||
return is_mirrors_available()
|
||||
|
||||
|
||||
def refresh_mirrors(root_password: str) -> SimpleProcess:
|
||||
@@ -497,8 +496,7 @@ def get_current_mirror_countries() -> List[str]:
|
||||
|
||||
|
||||
def is_mirrors_available() -> bool:
|
||||
code, _ = system.execute(cmd='which pacman-mirrors', output=False)
|
||||
return code == 0
|
||||
return bool(shutil.which('pacman-mirrors'))
|
||||
|
||||
|
||||
def map_update_sizes(pkgs: List[str]) -> Dict[str, int]: # bytes:
|
||||
@@ -674,7 +672,7 @@ def map_updates_data(pkgs: Iterable[str], files: bool = False) -> dict:
|
||||
if val == 'None':
|
||||
data['d'] = None
|
||||
else:
|
||||
data['d'] = {w.strip().split(':')[0].strip() for w in val.split(' ') if w}
|
||||
data['d'] = {w.strip() for w in val.split(' ') if w}
|
||||
latest_field = 'd'
|
||||
elif field == 'Conflicts With':
|
||||
if val == 'None':
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from typing import Set
|
||||
|
||||
@@ -7,7 +8,7 @@ from bauh.gems.arch import IGNORED_REBUILD_CHECK_FILE
|
||||
|
||||
|
||||
def is_installed() -> bool:
|
||||
return system.execute(cmd='which checkrebuild', output=False)[0] == 0
|
||||
return bool(shutil.which('checkrebuild'))
|
||||
|
||||
|
||||
def list_required_rebuild() -> Set[str]:
|
||||
|
||||
@@ -2,6 +2,7 @@ import glob
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import time
|
||||
import traceback
|
||||
from datetime import datetime, timedelta
|
||||
@@ -13,7 +14,6 @@ import requests
|
||||
|
||||
from bauh.api.abstract.context import ApplicationContext
|
||||
from bauh.api.abstract.handler import TaskManager
|
||||
from bauh.commons import system
|
||||
from bauh.commons.boot import CreateConfigFile
|
||||
from bauh.commons.html import bold
|
||||
from bauh.commons.system import new_root_subprocess, ProcessHandler
|
||||
@@ -259,8 +259,7 @@ class ArchCompilationOptimizer(Thread):
|
||||
self.taskman.register_task(self.task_id, self.i18n['arch.task.optimizing'].format(bold('makepkg.conf')), get_icon_path())
|
||||
|
||||
def _is_ccache_installed(self) -> bool:
|
||||
code, _ = system.execute(cmd='which ccache', output=False)
|
||||
return code == 0
|
||||
return bool(shutil.which('ccache'))
|
||||
|
||||
def optimize(self):
|
||||
ti = time.time()
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
from io import StringIO
|
||||
from typing import Tuple, Optional
|
||||
|
||||
from bauh.commons.system import run_cmd, SimpleProcess
|
||||
from bauh.commons.system import SimpleProcess
|
||||
|
||||
BASE_CMD = 'snap'
|
||||
|
||||
|
||||
def is_installed() -> bool:
|
||||
return bool(run_cmd('which {}'.format(BASE_CMD), print_error=False))
|
||||
return bool(shutil.which(BASE_CMD))
|
||||
|
||||
|
||||
def uninstall_and_stream(app_name: str, root_password: str) -> SimpleProcess:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import shutil
|
||||
from typing import List, Optional
|
||||
|
||||
from bauh.commons.system import SimpleProcess, run_cmd
|
||||
@@ -18,8 +19,7 @@ def install(url: str, name: str, output_dir: str, electron_version: Optional[str
|
||||
|
||||
|
||||
def is_available() -> bool:
|
||||
res = run_cmd('which nativefier', print_error=False)
|
||||
return res and not res.strip().startswith('which ')
|
||||
return bool(shutil.which('nativefier'))
|
||||
|
||||
|
||||
def get_version() -> str:
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from bauh.commons.system import run_cmd
|
||||
import shutil
|
||||
|
||||
|
||||
def is_available() -> bool:
|
||||
res = run_cmd('which npm', print_error=False)
|
||||
return res and not res.strip().startswith('which ')
|
||||
return bool(shutil.which('npm'))
|
||||
|
||||
Reference in New Issue
Block a user