Skip to content

Commit

Permalink
0.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vinifmor authored Oct 26, 2019
2 parents d190142 + dda3082 commit d2789fb
Show file tree
Hide file tree
Showing 71 changed files with 1,012 additions and 381 deletions.
45 changes: 44 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,49 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [0.7.1] 2019-10-25
### Features
- Snap:
- if the **stable** channel is not available while an application is being installed, a popup is displayed allowing the user to choose a different one ( e.g: dbeaver-ce )

### Improvements
- 3 password attempts for root authentication
- not changing the table applied filters after a uninstall
- cleaning the progress bar substatus after each upgrade
- sorted categories
- AppImage:
- showing an error popup when **AppImageLauncher** messes up with an application installation
- Flatpak:
- Runtimes now are categorized as "runtime"
- Formatting the API categories to the same format provided by the other packaging technologies
- AUR:
- showing a "user-friendly" popup when there are integrity issues with the source-files of a building package
- not waiting for the categories file to be retrieved from the cloud during application boot ( reduces boot time )
- caching cloud categories to the disk so they can be used in scenarios when it is not possible to retrieve them ( e.g: internet is off )
- mapping known search key words to the specific package name ( e.g:"google chrome" will become "google-chrome" )
- Snap:
- not waiting for the categories file to be retrieved from the cloud during application boot ( reduces boot time )
- caching cloud categories to the disk so they can be used in scenarios when it is not possible to retrieve them ( e.g: internet is off )
- showing a warning popup when the Snap API is out
- Snaps not treated as applications with be categorized as "runtime" at least
- minor thread improvements

### UI
- Screenshots panel:
- "downloading" label replaced by a progress bar

### Fixes
- application not initializing when there is no internet connection
- not loading application icons after some filters are applied to the table results
- not reloading the available categories after asynchronous data is fetched
- not keeping the update toggle-button state after a filter is applied
- AUR:
- update-checking for some scenarios
- not respecting **ignorepkg** settings in **pacman.conf**
- not able to handle **missing dependencies with symbols** ( e.g: libpng++ )
- not able to work with **.xpm** icons
- not mapping categories to the search results

## [0.7.0] 2019-10-18
### Features
- AppImage support ( see below )
Expand Down Expand Up @@ -34,7 +77,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### AppImage support
- Search, install, uninstall, downgrade, launch and retrieve the applications history
- Supported sources: [AppImageHub](https://appimage.github.io) ( **applications with no releases published to GitHub are currently not available** )
- Adds desktop entries ( menu shortcuts ) for the installed applications ( **~/.local/share/applications **)
- Adds desktop entries ( menu shortcuts ) for the installed applications ( **~/.local/share/applications**)

## [0.6.4] 2019-10-13
### Fixes
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ include LICENSE CHANGELOG.md README.md
include requirements.txt
recursive-include bauh/view/resources *
recursive-include bauh/gems/*/resources *
recursive-include tests *
2 changes: 2 additions & 0 deletions aur/bauh-tray
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
/usr/bin/bauh --tray=1
9 changes: 9 additions & 0 deletions aur/bauh.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Type=Application
Name=bauh
Categories=System;
Comment=Manage your Flatpak / Snap / AppImage / AUR applications
Comment[pt]=Gerencie seus aplicativos Flatpak / Snap / AppImage / AUR
Comment[es]=Administre sus aplicaciones Flatpak / Snap / AppImage / AUR
Exec=/usr/bin/bauh
Icon=bauh
11 changes: 11 additions & 0 deletions aur/bauh_tray.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
Name=bauh ( tray )
Name[pt]=bauh ( bandeja )
Name[es]=bauh ( bandeja )
Categories=System;
Comment=Manage your Flatpak / Snap / AppImage / AUR applications
Comment[pt]=Gerencie seus aplicativos Flatpak / Snap / AppImage / AUR
Comment[es]=Administre sus aplicaciones Flatpak / Snap / AppImage / AUR
Exec=/usr/bin/bauh --tray=1
Icon=bauh
14 changes: 14 additions & 0 deletions aur/copy_icons.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import glob
import shutil
import sys
from pathlib import Path

output_base = sys.argv[2]

for f in glob.glob(sys.argv[1] + '/*.png'):
res = f.split('/')[-1].split('.')[0]
dest_dir = output_base + '/' + res + '/apps'

Path(dest_dir).mkdir(parents=True, exist_ok=True)

shutil.copy(f, dest_dir + '/bauh.png')
Binary file added aur/icons/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added aur/icons/12x12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added aur/icons/16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added aur/icons/24x24.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added aur/icons/256x256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added aur/icons/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added aur/icons/48x48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added aur/icons/512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added aur/icons/64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added aur/icons/8x8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added aur/icons/96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 0 additions & 24 deletions aur/panel_entry.py

This file was deleted.

31 changes: 0 additions & 31 deletions aur/tray_entry.py

This file was deleted.

2 changes: 1 addition & 1 deletion bauh/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '0.7.0'
__version__ = '0.7.1'
__app_name__ = 'bauh'

import os
Expand Down
3 changes: 2 additions & 1 deletion bauh/api/abstract/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,9 @@ def list_updates(self, internet_available: bool) -> List[PackageUpdate]:
pass

@abstractmethod
def list_warnings(self) -> List[str]:
def list_warnings(self, internet_available: bool) -> List[str]:
"""
:param internet_available
:return: a list of warnings to be shown to the user
"""
pass
Expand Down
3 changes: 0 additions & 3 deletions bauh/api/abstract/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ class SingleSelectComponent(InputViewComponent):

def __init__(self, type_: SelectViewType, label: str, options: List[InputOption], default_option: InputOption = None, max_per_line: int = 1, id_: str = None):
super(SingleSelectComponent, self).__init__(id_=id_)
if options is None or len(options) < 2:
raise Exception("'options' must be a list with at least 2 elements")

self.type = type_
self.label = label
self.options = options
Expand Down
108 changes: 108 additions & 0 deletions bauh/commons/category.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
import logging
import os
import traceback
from pathlib import Path
from threading import Thread
from typing import Dict, List

import requests

from bauh.api.abstract.controller import SoftwareManager
from bauh.api.http import HttpClient


class CategoriesDownloader(Thread):

def __init__(self, id_: str, http_client: HttpClient, logger: logging.Logger, manager: SoftwareManager,
disk_cache: bool, url_categories_file: str, disk_cache_dir: str, categories_path: str):
super(CategoriesDownloader, self).__init__(daemon=True)
self.id_ = id_
self.http_client = http_client
self.logger = logger
self.manager = manager
self.disk_cache = disk_cache
self.url_categories_file = url_categories_file
self.disk_cache_dir = disk_cache_dir
self.categories_path = categories_path

def _msg(self, msg: str):
return '{}({}): {}'.format(self.__class__.__name__, self.id_, msg)

def _read_categories_from_disk(self) -> Dict[str, List[str]]:
if self.disk_cache and os.path.exists(self.categories_path):
self.logger.info(self._msg("Reading cached categories from the disk"))

with open(self.categories_path) as f:
categories = f.read()

return self._map_categories(categories)

return {}

def _map_categories(self, categories: str) -> Dict[str, List[str]]:
categories_map = {}
for l in categories.split('\n'):
if l:
data = l.split('=')
categories_map[data[0]] = [c.strip() for c in data[1].split(',') if c]

return categories_map

def _cache_categories_to_disk(self, categories: str):
self.logger.info(self._msg('Caching categories to the disk'))

try:
Path(self.disk_cache_dir).mkdir(parents=True, exist_ok=True)

with open(self.categories_path, 'w+') as f:
f.write(categories)

self.logger.info(self._msg("Categories cached to the disk as '{}'".format(self.categories_path)))
except:
self.logger.error(self._msg("Could not cache categories to the disk as '{}'".format(self.categories_path)))
traceback.print_exc()

def download_categories(self) -> Dict[str, List[str]]:
self.logger.info(self._msg('Downloading category definitions from {}'.format(self.url_categories_file)))

try:
res = self.http_client.get(self.url_categories_file)

if res:
try:
categories = self._map_categories(res.text)
self.logger.info(self._msg('Loaded categories for {} applications'.format(len(categories))))

if self.disk_cache and categories:
Thread(target=self._cache_categories_to_disk, args=(res.text,), daemon=True).start()

return categories
except:
self.logger.error(self._msg("Could not parse categories definitions"))
traceback.print_exc()
else:
self.logger.info(self._msg('Could not download {}'.format(self.url_categories_file)))

except requests.exceptions.ConnectionError:
self.logger.warning(self._msg('The internet connection seems to be off.'))

return {}

def _set_categories(self, categories: dict):
if categories:
self.logger.info(self._msg("Settings {} categories to {}".format(len(categories), self.manager.__class__.__name__)))
self.manager.categories = categories

def _download_and_set(self):
self._set_categories(self.download_categories())

def run(self):
cached = self._read_categories_from_disk()

if cached:
self._set_categories(cached)
Thread(target=self._download_and_set, daemon=True).start()
else:
self._download_and_set()

self.logger.info(self._msg('Finished'))
5 changes: 4 additions & 1 deletion bauh/commons/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def _notify_watcher(self, msg: str):
if self.watcher:
self.watcher.print(msg)

def handle(self, process: SystemProcess) -> bool:
def handle(self, process: SystemProcess, error_output: StringIO = None) -> bool:
self._notify_watcher(' '.join(process.subproc.args) + '\n')

already_succeeded = False
Expand All @@ -126,6 +126,9 @@ def handle(self, process: SystemProcess) -> bool:
if line:
self._notify_watcher(line)

if error_output is not None:
error_output.write(line)

if process.check_error_output:
if process.wrong_error_phrase and process.wrong_error_phrase in line:
continue
Expand Down
14 changes: 11 additions & 3 deletions bauh/gems/appimage/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from bauh.api.abstract.view import MessageType
from bauh.api.constants import HOME_PATH
from bauh.commons.html import bold
from bauh.commons.system import SystemProcess, new_subprocess, ProcessHandler, run_cmd
from bauh.commons.system import SystemProcess, new_subprocess, ProcessHandler, run_cmd, SimpleProcess
from bauh.gems.appimage import query, INSTALLATION_PATH, suggestions, db
from bauh.gems.appimage.model import AppImage
from bauh.gems.appimage.worker import DatabaseUpdater
Expand Down Expand Up @@ -298,12 +298,20 @@ def install(self, pkg: AppImage, root_password: str, watcher: ProcessWatcher) ->
watcher.change_substatus(self.i18n['appimage.install.extract'].format(bold(file_name)))

try:
handler.handle(SystemProcess(new_subprocess([file_path, '--appimage-extract'], cwd=out_dir)))
res, output = handler.handle_simple(SimpleProcess([file_path, '--appimage-extract'], cwd=out_dir))

if 'Error: Failed to register AppImage in AppImageLauncherFS' in output:
watcher.show_message(title=self.i18n['error'],
body=self.i18n['appimage.install.appimagelauncher.error'].format(appimgl=bold('AppImageLauncher'), app=bold(pkg.name)),
type_=MessageType.ERROR)
handler.handle(SystemProcess(new_subprocess(['rm', '-rf', out_dir])))
return False
except:
watcher.show_message(title=self.i18n['error'],
body=traceback.format_exc(),
type_=MessageType.ERROR)
traceback.print_exc()
handler.handle(SystemProcess(new_subprocess(['rm', '-rf', out_dir])))
return False

watcher.change_substatus(self.i18n['appimage.install.desktop_entry'])
Expand Down Expand Up @@ -388,7 +396,7 @@ def list_updates(self, internet_available: bool) -> List[PackageUpdate]:

return updates

def list_warnings(self) -> List[str]:
def list_warnings(self, internet_available: bool) -> List[str]:
pass

def list_suggestions(self, limit: int) -> List[PackageSuggestion]:
Expand Down
3 changes: 2 additions & 1 deletion bauh/gems/appimage/resources/locale/en
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ appimage.downgrade.unknown_version.body=It was not possible to identify {} curre
appimage.downgrade.first_version={} is in its first published version
appimage.error.uninstall_current_version=It was not possible to uninstall the current version of {}
appimage.downgrade.install_version=It was not possible to install the version {} ({})
appimage.install.download.error=It was not possible to download the file {}. The file server can be down.
appimage.install.download.error=It was not possible to download the file {}. The file server can be down.
appimage.install.appimagelauncher.error={appimgl} is not allowing {app} to be installed. Uninstall {appimgl}, reboot your system and try to install {app} again.
3 changes: 2 additions & 1 deletion bauh/gems/appimage/resources/locale/es
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ appimage.downgrade.unknown_version.body=No fue posible identificar la versión a
appimage.downgrade.first_version={} está en su primera versión publicada
appimage.downgrade.uninstall_current_version=No fue posible desinstalar la versión actual de {}
appimage.downgrade.install_version=No fue posible instalar la versión {} ({})
appimage.install.download.error=No fue posible descargar el archivo {}. El servidor del archivo puede estar inactivo.
appimage.install.download.error=No fue posible descargar el archivo {}. El servidor del archivo puede estar inactivo.
appimage.install.appimagelauncher.error = {appimgl} no permite la instalación de {app}. Desinstale {appimgl}, reinicie su sistema e intente instalar {app} nuevamente.
3 changes: 2 additions & 1 deletion bauh/gems/appimage/resources/locale/pt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ appimage.downgrade.unknown_version.body=Não foi possível identificar a versão
appimage.downgrade.first_version={} se encontra em sua primeira versão publicada
appimage.downgrade.uninstall_current_version=Não foi possível desinstalar a versão atual de {}
appimage.downgrade.install_version=Não foi possivel instalar a versão {} ({})
appimage.install.download.error=Não foi possível baixar o arquivo {}. O servidor do arquivo pode estar fora do ar.
appimage.install.download.error=Não foi possível baixar o arquivo {}. O servidor do arquivo pode estar fora do ar.
appimage.install.appimagelauncher.error={appimgl} não está permitindo que o {app} seja instalado. Desinstale o {appimgl}, reinicie o sistema e tente instalar o {app} novamente.
Loading

0 comments on commit d2789fb

Please sign in to comment.