arch:using axel to pre-download source file | info window handling list attributes better

This commit is contained in:
Vinicius Moreira
2019-09-22 01:01:11 -03:00
parent 0085f40cdf
commit 917c6ec5d7
18 changed files with 189 additions and 22 deletions

View File

@@ -1,8 +1,10 @@
import logging
import platform
import sys
from bauh.api.abstract.cache import MemoryCacheFactory
from bauh.api.abstract.disk import DiskCacheLoaderFactory
from bauh.api.abstract.download import FileDownloader
from bauh.api.http import HttpClient
@@ -10,7 +12,7 @@ class ApplicationContext:
def __init__(self, disk_cache: bool, download_icons: bool, http_client: HttpClient, app_root_dir: str, i18n: dict,
cache_factory: MemoryCacheFactory, disk_loader_factory: DiskCacheLoaderFactory,
logger: logging.Logger):
logger: logging.Logger, file_downloader: FileDownloader):
"""
:param disk_cache: if package data should be cached to disk
:param download_icons: if packages icons should be downloaded
@@ -20,6 +22,7 @@ class ApplicationContext:
:param cache_factory:
:param disk_loader_factory:
:param logger: a logger instance
:param file_downloader:
"""
self.disk_cache = disk_cache
self.download_icons = download_icons
@@ -30,3 +33,8 @@ class ApplicationContext:
self.disk_loader_factory = disk_loader_factory
self.logger = logger
self.linux_distro = platform.linux_distribution()
self.file_downloader = file_downloader
self.arch_x86_64 = sys.maxsize > 2**32
def is_system_x86_64(self):
return self.arch_x86_64