diff --git a/CHANGELOG.md b/CHANGELOG.md index bac55c39..e5897222 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,127 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - suggestions are now retrieved asynchronously taking 45% less time. - search response takes an average of 20% less time ( reaching 35% for several results ) - app boot takes 98% less time when snapd is installed, but disabled -- FPAKMAN_TRAY (--tray) is not enabled by default (0). +- BAUH_TRAY (--tray) is not enabled by default (0). ### Fixes - not showing correctly the latest flatpak app versions when bringing the search results -- [flatpak dependency](https://github.com/vinifmor/fpakman/issues/36) - -## [0.5.0] - 2019-08-06 -### Improvements -- search results sorting takes an average of 35% less time, reaching 60% in some scenarios -- app boot takes an average of 80% less time -- installed / uninstalled icons replaced by install / uninstall button -- check update button design changed -- app information is now available through an "Info" button -- app extra actions are now available through a "Settings" button instead of a right-click -- a confirmation popup is shown when the "install" / "upgrade all" button is clicked -- "About" icon added to the manage panel -- "Updates" icon left-aligned -- show application suggestions when no app is installed. Can be enabled / disabled through the environment variable / parameter FPAKMAN_SUGGESTIONS (--sugs) -- showing a warning popup after initialization when no Flatpak remotes are set -- new environment variable / argument to enable / disable the tray icon and update-check daemon: FPAKMAN_TRAY (--tray) -- minor GUI improvements -### Fixes: -- apps table not showing empty descriptions -- replacing default app icons by null icons -- maximized window resize fix when filtering apps -- changing table state after retrieving app history / information or an error happens -- i18n - -### Comments: -- not adding Flatpak default remote (flathub) when initializing. It requires root actions, and will be addressed in a different way in future releases. - -## [0.4.2] - 2019-07-28 -### Improvements -- showing a warning dialog when the application starts and **snapd** is unavailable -### Fixes: -- [Snaps read index error](https://github.com/vinifmor/fpakman/issues/30) - -## [0.4.1] - 2019-07-25 -### Improvements -- retrieving some Snaps data (icon, description and confinement) through Ubuntu API instead of Snap Store -### Fixes: -- not showing app disk cached description when listing installed apps -- not updating disk cached data of installed apps - -## [0.4.0] - 2019-07-25 -### Features -- supporting snaps -- search filters by application type and updates -- "Refresh" option when right-clicking an installed snap application (see **Comments**) -- snap / flatpak usage can be enabled / disabled via this new environment variables and arguments: FPAKMAN_FLATPAK (--flatpak), FPAKMAN_SNAP (--snap) -### Improvements -- automatically shows all updates after refreshing -- more accurate search results. -- system notifications when an application is installed, removed or downgraded. Also when an error occurs. -- showing management panel when right-clicking the tray icon. -- "Updates" label replaced by an exclamation icon and moved to the right. -- new environments variables / arguments associated with performance: FPAKMAN_DOWNLOAD_ICONS (--download-icons), FPAKMAN_CHECK_PACKAGING_ONCE (--check-packaging-once) -- minor GUI improvements -### Comments -- currently snap daemon (2.40) automatically upgrades your installed applications in background. Although it's possible to check for new updates -programmatically, it requires root access and would mess up with the user experience if every 5 minutes the application asked for the password. But not to let the -user with empty hands, it was added a "Refresh" option when right-clicking an installed snap application. It will update the application if its not already updated by the daemon. - -## [0.3.1] - 2019-07-13 -### Improvements -- Console output now is optional and not shown by default -- Search bar is cleaned when 'Refresh' is clicked -- Full Flatpak database is not loaded during initialization: speeds up the process and reduces memory usage -- Applications data not available offline are now retrieved from Flathub API on demand and cached in memory and disk (only installed) -- In-memory cached data have an expiration time and are cleaned overtime to reduce memory usage -- Code was refactored to support other types of packaging in the future (e.g: snap) -- flatpak is not a requirement anymore -- the amount of columns of the applications table was reduced to improve the user experience -- new environment variables and arguments: FPAKMAN_ICON_EXPIRATION (--icon-exp), FPAKMAN_DISK_CACHE (--disk-cache) -- minor GUI improvements - -### Fixes: -- flatpak 1.0.X: search is now retrieving the application name -- app crashes when there is no internet connection while initializing, downgrading or retrieving app history - -## [0.3.0] - 2019-07-02 -### Features -- Applications search -- Now when you right-click a selected application you can: - - retrieve its information - - retrieve its commit history - - downgrade - - install and uninstall it -- "About" window available when right-clicking the tray icon. - -### Improvements -- Performance and memory usage -- Adding tooltips to toolbar buttons -- "Update ?" column renamed to "Upgrade ?" -- Management panel title renamed -- Showing runtime apps when no app is available -- Allowing to specify a custom app translation with the environment variable **FPAKMAN_LOCALE** -- Adding expiration time for cached app data. Default to 1 hour. The environment variable **FPAKMAN_CACHE_EXPIRATION** can change this value. -- Now the application accepts arguments related to environment variables as well. Check 'README.md'. -- Minor GUI improvements -- Notifying only new updates -- New icon -- Progress bar - -## [0.2.1] - 2019-06-24 -### Features -- Showing the number of apps and runtime updates available -### Fixes -- Retrieving information for the same AppId from different branches. - -## [0.2.0] - 2019-06-18 -### Features -- Management panel shows update commands streams -- Management panel status label is "orange" now - -### Fixes -- Application name is not properly showing for Flatpak 1.2.X - -## [0.1.0] - 2019-06-14 -### Features -- System tray icon. -- Applications management window. -- Support for the following locales: PT, EN, ES. -- System notification for new updates. -- Update applications. +- flatpak client dependency diff --git a/MANIFEST.in b/MANIFEST.in index 16034813..8ca67c06 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ include requirements.txt -recursive-include fpakman/resources * \ No newline at end of file +recursive-include bauh/resources * \ No newline at end of file diff --git a/README.md b/README.md index a3b8aa64..ed3ee61f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## fpakman +## bauh Non-official graphical user interface for Flatpak / Snap application management. It is a tray icon that let the user known when new updates are available and an application management panel where you can search, update, install and uninstall applications. @@ -20,12 +20,12 @@ an application management panel where you can search, update, install and uninst ### Distribution **PyPi** ``` -sudo pip3 install fpakman +sudo pip3 install bauh ``` **AUR** -As **fpakman** package. There is also a staging version (**fpakman-staging**) but is intended for testing and may not work properly. +As **bauh** package. There is also a staging version (**bauh-staging**) but is intended for testing and may not work properly. ### Manual installation: @@ -33,35 +33,35 @@ If you prefer a manual and isolated installation, type the following commands wi ``` python3 -m venv env env/bin/pip install . -env/bin/fpakman +env/bin/bauh ``` ### Autostart -In order to autostart the application, use your Desktop Environment settings to register it as a startup application / script ("fpakman"). +In order to autostart the application, use your Desktop Environment settings to register it as a startup application / script (**bauh**). ### Settings -You can change some application settings via environment variables or arguments (type ```fpakman --help``` to get more information). -- **FPAKMAN_UPDATE_NOTIFICATION**: enable or disable system updates notifications. Use **0** (disable) or **1** (enable, default). -- **FPAKMAN_CHECK_INTERVAL**: define the updates check interval in seconds. Default: 60. -- **FPAKMAN_LOCALE**: define a custom app translation for a given locale key (e.g: 'pt', 'en', 'es', ...). Default: system locale. -- **FPAKMAN_CACHE_EXPIRATION**: define a custom expiration time in SECONDS for cached API data. Default: 3600 (1 hour). -- **FPAKMAN_ICON_EXPIRATION**: define a custom expiration time in SECONDS for cached icons. Default: 300 (5 minutes). -- **FPAKMAN_DISK_CACHE**: enables / disables disk cache. When disk cache is enabled, the installed applications data are loaded faster. Use **0** (disable) or **1** (enable, default). -- **FPAKMAN_DOWNLOAD_ICONS**: Enables / disables app icons download. It may improve the application speed depending on how applications data are being retrieved. Use **0** (disable) or **1** (enable, default). -- **FPAKMAN_FLATPAK**: enables / disables flatpak usage. Use **0** (disable) or **1** (enabled, default) -- **FPAKMAN_SNAP**: enables / disables snap usage. Use **0** (disable) or **1** (enabled, default) -- **FPAKMAN_CHECK_PACKAGING_ONCE**: If the available supported packaging types should be checked ONLY once. It improves the application speed if enabled, but can generate errors if you uninstall any packaging technology while using it, and every time a supported packaging type is installed it will only be available after a restart. Use **0** (disable, default) or **1** (enable). -- **FPAKMAN_TRAY**: If the tray icon and update-check daemon should be created. Use **0** (disable, default) or **1** (enable). -- **FPAKMAN_SUGGESTIONS**: If application suggestions should be displayed if no app is installed (runtimes do not count as apps). Use **0** (disable) or **1** (enable, default). +You can change some application settings via environment variables or arguments (type ```bauh --help``` to get more information). +- **BAUH_UPDATE_NOTIFICATION**: enable or disable system updates notifications. Use **0** (disable) or **1** (enable, default). +- **BAUH_CHECK_INTERVAL**: define the updates check interval in seconds. Default: 60. +- **BAUH_LOCALE**: define a custom app translation for a given locale key (e.g: 'pt', 'en', 'es', ...). Default: system locale. +- **BAUH_CACHE_EXPIRATION**: define a custom expiration time in SECONDS for cached API data. Default: 3600 (1 hour). +- **BAUH_ICON_EXPIRATION**: define a custom expiration time in SECONDS for cached icons. Default: 300 (5 minutes). +- **BAUH_DISK_CACHE**: enables / disables disk cache. When disk cache is enabled, the installed applications data are loaded faster. Use **0** (disable) or **1** (enable, default). +- **BAUH_DOWNLOAD_ICONS**: Enables / disables app icons download. It may improve the application speed depending on how applications data are being retrieved. Use **0** (disable) or **1** (enable, default). +- **BAUH_FLATPAK**: enables / disables flatpak usage. Use **0** (disable) or **1** (enabled, default) +- **BAUH_SNAP**: enables / disables snap usage. Use **0** (disable) or **1** (enabled, default) +- **BAUH_CHECK_PACKAGING_ONCE**: If the available supported packaging types should be checked ONLY once. It improves the application speed if enabled, but can generate errors if you uninstall any packaging technology while using it, and every time a supported packaging type is installed it will only be available after a restart. Use **0** (disable, default) or **1** (enable). +- **BAUH_TRAY**: If the tray icon and update-check daemon should be created. Use **0** (disable, default) or **1** (enable). +- **BAUH_SUGGESTIONS**: If application suggestions should be displayed if no app is installed (runtimes do not count as apps). Use **0** (disable) or **1** (enable, default). ### How to improve the application performance -- If you don't care about a specific packaging technology and don't want **fpakman** to deal with it, just disable it via the specific argument or environment variable. For instance, if I don't care -about **snaps**, I can initialize the application setting "snap=0" (**fpakman --snap=0**). This will improve the application response time, since it won't need to do any verifications associated +- If you don't care about a specific packaging technology and don't want the app to deal with it, just disable it via the specific argument or environment variable. For instance, if I don't care +about **snaps**, I can initialize the application setting "snap=0" (**bauh --snap=0**). This will improve the application response time, since it won't need to do any verifications associated with the technology that I don't care every time an action is executed. -- If you don't care about restarting **fpakman** every time a new supported packaging technology is installed, set "check-packaging-once=1" (**fpakman --check-packaging-once=1**). This can reduce the application response time up to 80% in some scenarios, since it won't need to recheck if the packaging type is available for every action you request. -- If you don't mind to see the applications icons, you can set "download-icons=0" (**fpakman --download-icons=0**). The application may have a slight response improvement, since it will reduce the parallelism within it. -- If you don't mind app suggestions, disable it (**fpakman --sugs=0**) +- If you don't care about restarting the app every time a new supported packaging technology is installed, set "check-packaging-once=1" (**bauh --check-packaging-once=1**). This can reduce the application response time up to 80% in some scenarios, since it won't need to recheck if the packaging type is available for every action you request. +- If you don't mind to see the applications icons, you can set "download-icons=0" (**bauh --download-icons=0**). The application may have a slight response improvement, since it will reduce the parallelism within it. +- If you don't mind app suggestions, disable it (**bauh --sugs=0**) ### Roadmap - Support for other packaging technologies diff --git a/aur/panel_entry.py b/aur/panel_entry.py index 20576729..7e9fb2c8 100644 --- a/aur/panel_entry.py +++ b/aur/panel_entry.py @@ -5,18 +5,18 @@ import sys desktop_file = """ [Desktop Entry] Type = Application -Name = fpakman +Name = bauh Categories = System; Comment = Manage your Flatpak / Snap applications Exec = {path} -Icon = {lib_path}/python{version}/site-packages/fpakman/resources/img/logo.svg +Icon = {lib_path}/python{version}/site-packages/bauh/resources/img/logo.svg """ py_version = "{}.{}".format(sys.version_info.major, sys.version_info.minor) -fpakman_cmd = os.getenv('FPAKMAN_PATH', '/usr/bin/fpakman') +app_cmd = os.getenv('BAUH_PATH', '/usr/bin/bauh') -with open('fpakman.desktop', 'w+') as f: - f.write(desktop_file.format(lib_path=os.getenv('FPAKMAN_LIB_PATH', '/usr/lib'), +with open('bauh.desktop', 'w+') as f: + f.write(desktop_file.format(lib_path=os.getenv('BAUH_LIB_PATH', '/usr/lib'), version=py_version, - path=fpakman_cmd)) + path=app_cmd)) diff --git a/aur/tray_entry.py b/aur/tray_entry.py index 9b1b3d77..8d6e045b 100644 --- a/aur/tray_entry.py +++ b/aur/tray_entry.py @@ -5,22 +5,22 @@ import sys desktop_file = """ [Desktop Entry] Type = Application -Name = fpakman (tray) +Name = bauh (tray) Categories = System; Comment = Manage your Flatpak / Snap applications Exec = {path} -Icon = {lib_path}/python{version}/site-packages/fpakman/resources/img/logo.svg +Icon = {lib_path}/python{version}/site-packages/bauh/resources/img/logo.svg """ py_version = "{}.{}".format(sys.version_info.major, sys.version_info.minor) -fpakman_cmd = os.getenv('FPAKMAN_PATH', '/usr/bin/fpakman') + ' --tray=1' +app_cmd = os.getenv('BAUH_PATH', '/usr/bin/bauh') + ' --tray=1' -with open('fpakman_tray.desktop', 'w+') as f: - f.write(desktop_file.format(lib_path=os.getenv('FPAKMAN_LIB_PATH', '/usr/lib'), +with open('bauh_tray.desktop', 'w+') as f: + f.write(desktop_file.format(lib_path=os.getenv('BAUH_LIB_PATH', '/usr/lib'), version=py_version, - path=fpakman_cmd)) + path=app_cmd)) -with open('fpakman-tray', 'w') as f: - f.write(fpakman_cmd) +with open('bauh-tray', 'w') as f: + f.write(app_cmd) diff --git a/fpakman/__init__.py b/bauh/__init__.py similarity index 77% rename from fpakman/__init__.py rename to bauh/__init__.py index 522235a1..cc332ec7 100644 --- a/fpakman/__init__.py +++ b/bauh/__init__.py @@ -1,5 +1,5 @@ __version__ = '0.5.1' -__app_name__ = 'fpakman' +__app_name__ = 'bauh' import os ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/fpakman/app.py b/bauh/app.py similarity index 63% rename from fpakman/app.py rename to bauh/app.py index 1eb7b586..9a1ed9ac 100755 --- a/fpakman/app.py +++ b/bauh/app.py @@ -8,21 +8,21 @@ from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QApplication from colorama import Fore -from fpakman import __version__, __app_name__ -from fpakman.core import resource -from fpakman.core.controller import GenericApplicationManager -from fpakman.core.disk import DiskCacheLoaderFactory -from fpakman.core.flatpak.constants import FLATPAK_CACHE_PATH -from fpakman.core.flatpak.controller import FlatpakManager -from fpakman.core.flatpak.model import FlatpakApplication -from fpakman.core.snap.constants import SNAP_CACHE_PATH -from fpakman.core.snap.controller import SnapManager -from fpakman.core.snap.model import SnapApplication -from fpakman.util import util -from fpakman.util.cache import Cache -from fpakman.util.memory import CacheCleaner -from fpakman.view.qt.systray import TrayIcon -from fpakman.view.qt.window import ManageWindow +from bauh import __version__, __app_name__ +from bauh.core import resource +from bauh.core.controller import GenericApplicationManager +from bauh.core.disk import DiskCacheLoaderFactory +from bauh.core.flatpak.constants import FLATPAK_CACHE_PATH +from bauh.core.flatpak.controller import FlatpakManager +from bauh.core.flatpak.model import FlatpakApplication +from bauh.core.snap.constants import SNAP_CACHE_PATH +from bauh.core.snap.controller import SnapManager +from bauh.core.snap.model import SnapApplication +from bauh.util import util +from bauh.util.cache import Cache +from bauh.util.memory import CacheCleaner +from bauh.view.qt.systray import TrayIcon +from bauh.view.qt.window import ManageWindow def log_msg(msg: str, color: int = None): @@ -35,18 +35,18 @@ def log_msg(msg: str, color: int = None): parser = argparse.ArgumentParser(prog=__app_name__, description="GUI for Flatpak applications management") parser.add_argument('-v', '--version', action='version', version='%(prog)s {}'.format(__version__)) -parser.add_argument('-e', '--cache-exp', action="store", default=int(os.getenv('FPAKMAN_CACHE_EXPIRATION', 60 * 60)), type=int, help='cached API data expiration time in SECONDS. Default: %(default)s') -parser.add_argument('-ie', '--icon-exp', action="store", default=int(os.getenv('FPAKMAN_ICON_EXPIRATION', 60 * 5)), type=int, help='cached icons expiration time in SECONDS. Default: %(default)s') -parser.add_argument('-l', '--locale', action="store", default=os.getenv('FPAKMAN_LOCALE', 'en'), help='Translation key. Default: %(default)s') -parser.add_argument('-i', '--check-interval', action="store", default=int(os.getenv('FPAKMAN_CHECK_INTERVAL', 60)), type=int, help='Updates check interval in SECONDS. Default: %(default)s') -parser.add_argument('-n', '--update-notification', action="store", choices=[0, 1], default=os.getenv('FPAKMAN_UPDATE_NOTIFICATION', 1), type=int, help='Enables / disables system notifications for new updates. Default: %(default)s') -parser.add_argument('-dc', '--disk-cache', action="store", choices=[0, 1], default=os.getenv('FPAKMAN_DISK_CACHE', 1), type=int, help='Enables / disables disk cache. When disk cache is enabled, the installed applications data are loaded faster. Default: %(default)s') -parser.add_argument('-di', '--download-icons', action="store", choices=[0, 1], default=os.getenv('FPAKMAN_DOWNLOAD_ICONS', 1), type=int, help='Enables / disables app icons download. It may improve the application speed, depending of how applications data are retrieved by their extensions.') -parser.add_argument('--flatpak', action="store", default=os.getenv('FPAKMAN_FLATPAK', 1), choices=[0, 1], type=int, help='Enables / disables flatpak usage. Default: %(default)s') -parser.add_argument('--snap', action="store", default=os.getenv('FPAKMAN_SNAP', 1), choices=[0, 1], type=int, help='Enables / disables snap usage. Default: %(default)s') -parser.add_argument('-co', '--check-packaging-once', action="store", default=os.getenv('FPAKMAN_CHECK_PACKAGING_ONCE', 0), choices=[0, 1], type=int, help='If the available supported packaging types should be checked ONLY once. It improves the application speed if enabled, but can generate errors if you uninstall any packaging technology while using it, and every time a supported packaging type is installed it will only be available after a restart. Default: %(default)s') -parser.add_argument('--tray', action="store", default=os.getenv('FPAKMAN_TRAY', 0), choices=[0, 1], type=int, help='If the tray icon and update-check daemon should be created. Default: %(default)s') -parser.add_argument('--sugs', action="store", default=os.getenv('FPAKMAN_SUGGESTIONS', 1), choices=[0, 1], type=int, help='If app suggestions should be displayed if no app is installed (runtimes do not count as apps). Default: %(default)s') +parser.add_argument('-e', '--cache-exp', action="store", default=int(os.getenv('BAUH_CACHE_EXPIRATION', 60 * 60)), type=int, help='cached API data expiration time in SECONDS. Default: %(default)s') +parser.add_argument('-ie', '--icon-exp', action="store", default=int(os.getenv('BAUH_ICON_EXPIRATION', 60 * 5)), type=int, help='cached icons expiration time in SECONDS. Default: %(default)s') +parser.add_argument('-l', '--locale', action="store", default=os.getenv('BAUH_LOCALE', 'en'), help='Translation key. Default: %(default)s') +parser.add_argument('-i', '--check-interval', action="store", default=int(os.getenv('BAUH_CHECK_INTERVAL', 60)), type=int, help='Updates check interval in SECONDS. Default: %(default)s') +parser.add_argument('-n', '--update-notification', action="store", choices=[0, 1], default=os.getenv('BAUH_UPDATE_NOTIFICATION', 1), type=int, help='Enables / disables system notifications for new updates. Default: %(default)s') +parser.add_argument('-dc', '--disk-cache', action="store", choices=[0, 1], default=os.getenv('BAUH_DISK_CACHE', 1), type=int, help='Enables / disables disk cache. When disk cache is enabled, the installed applications data are loaded faster. Default: %(default)s') +parser.add_argument('-di', '--download-icons', action="store", choices=[0, 1], default=os.getenv('BAUH_DOWNLOAD_ICONS', 1), type=int, help='Enables / disables app icons download. It may improve the application speed, depending of how applications data are retrieved by their extensions.') +parser.add_argument('--flatpak', action="store", default=os.getenv('BAUH_FLATPAK', 1), choices=[0, 1], type=int, help='Enables / disables flatpak usage. Default: %(default)s') +parser.add_argument('--snap', action="store", default=os.getenv('BAUH_SNAP', 1), choices=[0, 1], type=int, help='Enables / disables snap usage. Default: %(default)s') +parser.add_argument('-co', '--check-packaging-once', action="store", default=os.getenv('BAUH_CHECK_PACKAGING_ONCE', 0), choices=[0, 1], type=int, help='If the available supported packaging types should be checked ONLY once. It improves the application speed if enabled, but can generate errors if you uninstall any packaging technology while using it, and every time a supported packaging type is installed it will only be available after a restart. Default: %(default)s') +parser.add_argument('--tray', action="store", default=os.getenv('BAUH_TRAY', 0), choices=[0, 1], type=int, help='If the tray icon and update-check daemon should be created. Default: %(default)s') +parser.add_argument('--sugs', action="store", default=os.getenv('BAUH_SUGGESTIONS', 1), choices=[0, 1], type=int, help='If app suggestions should be displayed if no app is installed (runtimes do not count as apps). Default: %(default)s') args = parser.parse_args() if args.cache_exp < 0: diff --git a/fpakman/core/__init__.py b/bauh/core/__init__.py similarity index 100% rename from fpakman/core/__init__.py rename to bauh/core/__init__.py diff --git a/fpakman/core/constants.py b/bauh/core/constants.py similarity index 77% rename from fpakman/core/constants.py rename to bauh/core/constants.py index 1ac4c1b8..8ef692f5 100644 --- a/fpakman/core/constants.py +++ b/bauh/core/constants.py @@ -1,6 +1,6 @@ from pathlib import Path -from fpakman import __app_name__ +from bauh import __app_name__ HOME_PATH = Path.home() CACHE_PATH = '{}/.cache/{}'.format(HOME_PATH, __app_name__) diff --git a/fpakman/core/controller.py b/bauh/core/controller.py similarity index 93% rename from fpakman/core/controller.py rename to bauh/core/controller.py index 22ce4b66..a5af7d99 100755 --- a/fpakman/core/controller.py +++ b/bauh/core/controller.py @@ -3,9 +3,9 @@ from argparse import Namespace from threading import Thread from typing import List, Dict -from fpakman.core.disk import DiskCacheLoader, DiskCacheLoaderFactory -from fpakman.core.model import Application, ApplicationUpdate -from fpakman.core.system import FpakmanProcess +from bauh.core.disk import DiskCacheLoader, DiskCacheLoaderFactory +from bauh.core.model import Application, ApplicationUpdate +from bauh.core.system import BauhProcess class ApplicationManager(ABC): @@ -23,7 +23,7 @@ class ApplicationManager(ABC): pass @abstractmethod - def downgrade_app(self, app: Application, root_password: str) -> FpakmanProcess: + def downgrade_app(self, app: Application, root_password: str) -> BauhProcess: pass @abstractmethod @@ -35,11 +35,11 @@ class ApplicationManager(ABC): pass @abstractmethod - def update_and_stream(self, app: Application) -> FpakmanProcess: + def update_and_stream(self, app: Application) -> BauhProcess: pass @abstractmethod - def uninstall_and_stream(self, app: Application, root_password: str) -> FpakmanProcess: + def uninstall_and_stream(self, app: Application, root_password: str) -> BauhProcess: pass @abstractmethod @@ -55,7 +55,7 @@ class ApplicationManager(ABC): pass @abstractmethod - def install_and_stream(self, app: Application, root_password: str) -> FpakmanProcess: + def install_and_stream(self, app: Application, root_password: str) -> BauhProcess: pass @abstractmethod @@ -71,7 +71,7 @@ class ApplicationManager(ABC): pass @abstractmethod - def refresh(self, app: Application, root_password: str) -> FpakmanProcess: + def refresh(self, app: Application, root_password: str) -> BauhProcess: pass @abstractmethod @@ -202,7 +202,7 @@ class GenericApplicationManager(ApplicationManager): def can_downgrade(self): return True - def downgrade_app(self, app: Application, root_password: str) -> FpakmanProcess: + def downgrade_app(self, app: Application, root_password: str) -> BauhProcess: man = self._get_manager_for(app) if man and man.can_downgrade(): @@ -216,19 +216,19 @@ class GenericApplicationManager(ApplicationManager): if man: return man.clean_cache_for(app) - def update_and_stream(self, app: Application) -> FpakmanProcess: + def update_and_stream(self, app: Application) -> BauhProcess: man = self._get_manager_for(app) if man: return man.update_and_stream(app) - def uninstall_and_stream(self, app: Application, root_password: str) -> FpakmanProcess: + def uninstall_and_stream(self, app: Application, root_password: str) -> BauhProcess: man = self._get_manager_for(app) if man: return man.uninstall_and_stream(app, root_password) - def install_and_stream(self, app: Application, root_password: str) -> FpakmanProcess: + def install_and_stream(self, app: Application, root_password: str) -> BauhProcess: man = self._get_manager_for(app) if man: @@ -269,7 +269,7 @@ class GenericApplicationManager(ApplicationManager): if man: return man.requires_root(action, app) - def refresh(self, app: Application, root_password: str) -> FpakmanProcess: + def refresh(self, app: Application, root_password: str) -> BauhProcess: self._wait_to_be_ready() man = self._get_manager_for(app) diff --git a/fpakman/core/disk.py b/bauh/core/disk.py similarity index 96% rename from fpakman/core/disk.py rename to bauh/core/disk.py index f81b55e6..ac5f05f5 100644 --- a/fpakman/core/disk.py +++ b/bauh/core/disk.py @@ -4,8 +4,8 @@ from pathlib import Path from threading import Thread, Lock from typing import List, Dict -from fpakman.core.model import Application -from fpakman.util.cache import Cache +from bauh.core.model import Application +from bauh.util.cache import Cache class DiskCacheLoader(Thread): diff --git a/fpakman/core/exception.py b/bauh/core/exception.py similarity index 100% rename from fpakman/core/exception.py rename to bauh/core/exception.py diff --git a/fpakman/core/flatpak/__init__.py b/bauh/core/flatpak/__init__.py similarity index 100% rename from fpakman/core/flatpak/__init__.py rename to bauh/core/flatpak/__init__.py diff --git a/fpakman/core/flatpak/constants.py b/bauh/core/flatpak/constants.py similarity index 75% rename from fpakman/core/flatpak/constants.py rename to bauh/core/flatpak/constants.py index 6f43f83b..c5894e82 100644 --- a/fpakman/core/flatpak/constants.py +++ b/bauh/core/flatpak/constants.py @@ -1,4 +1,4 @@ -from fpakman.core.constants import CACHE_PATH +from bauh.core.constants import CACHE_PATH FLATHUB_URL = 'https://flathub.org' FLATHUB_API_URL = FLATHUB_URL + '/api/v1' diff --git a/fpakman/core/flatpak/controller.py b/bauh/core/flatpak/controller.py similarity index 86% rename from fpakman/core/flatpak/controller.py rename to bauh/core/flatpak/controller.py index f1d64b55..5da1883f 100644 --- a/fpakman/core/flatpak/controller.py +++ b/bauh/core/flatpak/controller.py @@ -4,15 +4,15 @@ from argparse import Namespace from datetime import datetime from typing import List, Dict -from fpakman.core import disk -from fpakman.core.controller import ApplicationManager -from fpakman.core.disk import DiskCacheLoader -from fpakman.core.flatpak import flatpak -from fpakman.core.flatpak.model import FlatpakApplication -from fpakman.core.flatpak.worker import FlatpakAsyncDataLoader, FlatpakUpdateLoader -from fpakman.core.model import ApplicationData, ApplicationUpdate -from fpakman.core.system import FpakmanProcess -from fpakman.util.cache import Cache +from bauh.core import disk +from bauh.core.controller import ApplicationManager +from bauh.core.disk import DiskCacheLoader +from bauh.core.flatpak import flatpak +from bauh.core.flatpak.model import FlatpakApplication +from bauh.core.flatpak.worker import FlatpakAsyncDataLoader, FlatpakUpdateLoader +from bauh.core.model import ApplicationData, ApplicationUpdate +from bauh.core.system import BauhProcess +from bauh.util.cache import Cache class FlatpakManager(ApplicationManager): @@ -97,7 +97,7 @@ class FlatpakManager(ApplicationManager): def can_downgrade(self): return True - def downgrade_app(self, app: FlatpakApplication, root_password: str) -> FpakmanProcess: + def downgrade_app(self, app: FlatpakApplication, root_password: str) -> BauhProcess: commits = flatpak.get_app_commits(app.ref, app.origin) @@ -107,8 +107,8 @@ class FlatpakManager(ApplicationManager): if commit_idx == len(commits) - 1: return None - return FpakmanProcess(subproc=flatpak.downgrade_and_stream(app.ref, commits[commit_idx + 1], root_password), - success_phrase='Updates complete.') + return BauhProcess(subproc=flatpak.downgrade_and_stream(app.ref, commits[commit_idx + 1], root_password), + success_phrase='Updates complete.') def clean_cache_for(self, app: FlatpakApplication): self.api_cache.delete(app.base_data.id) @@ -116,11 +116,11 @@ class FlatpakManager(ApplicationManager): if app.supports_disk_cache() and os.path.exists(app.get_disk_cache_path()): shutil.rmtree(app.get_disk_cache_path()) - def update_and_stream(self, app: FlatpakApplication) -> FpakmanProcess: - return FpakmanProcess(subproc=flatpak.update_and_stream(app.ref)) + def update_and_stream(self, app: FlatpakApplication) -> BauhProcess: + return BauhProcess(subproc=flatpak.update_and_stream(app.ref)) - def uninstall_and_stream(self, app: FlatpakApplication, root_password: str = None) -> FpakmanProcess: - return FpakmanProcess(subproc=flatpak.uninstall_and_stream(app.ref)) + def uninstall_and_stream(self, app: FlatpakApplication, root_password: str = None) -> BauhProcess: + return BauhProcess(subproc=flatpak.uninstall_and_stream(app.ref)) def get_info(self, app: FlatpakApplication) -> dict: app_info = flatpak.get_app_info_fields(app.base_data.id, app.branch) @@ -132,8 +132,8 @@ class FlatpakManager(ApplicationManager): def get_history(self, app: FlatpakApplication) -> List[dict]: return flatpak.get_app_commits_data(app.ref, app.origin) - def install_and_stream(self, app: FlatpakApplication, root_password: str) -> FpakmanProcess: - return FpakmanProcess(subproc=flatpak.install_and_stream(app.base_data.id, app.origin)) + def install_and_stream(self, app: FlatpakApplication, root_password: str) -> BauhProcess: + return BauhProcess(subproc=flatpak.install_and_stream(app.base_data.id, app.origin)) def is_enabled(self): return flatpak.is_installed() @@ -145,7 +145,7 @@ class FlatpakManager(ApplicationManager): def requires_root(self, action: str, app: FlatpakApplication): return action == 'downgrade' - def refresh(self, app: FlatpakApplication, root_password: str) -> FpakmanProcess: + def refresh(self, app: FlatpakApplication, root_password: str) -> BauhProcess: raise Exception("'refresh' is not supported for {}".format(app.__class__.__name__)) def prepare(self): diff --git a/fpakman/core/flatpak/flatpak.py b/bauh/core/flatpak/flatpak.py similarity index 98% rename from fpakman/core/flatpak/flatpak.py rename to bauh/core/flatpak/flatpak.py index 410064d5..e2339709 100755 --- a/fpakman/core/flatpak/flatpak.py +++ b/bauh/core/flatpak/flatpak.py @@ -2,8 +2,8 @@ import re import subprocess from typing import List -from fpakman.core import system -from fpakman.core.exception import NoInternetException +from bauh.core import system +from bauh.core.exception import NoInternetException BASE_CMD = 'flatpak' diff --git a/fpakman/core/flatpak/model.py b/bauh/core/flatpak/model.py similarity index 91% rename from fpakman/core/flatpak/model.py rename to bauh/core/flatpak/model.py index 19966ef7..5fe2a65e 100644 --- a/fpakman/core/flatpak/model.py +++ b/bauh/core/flatpak/model.py @@ -1,6 +1,6 @@ -from fpakman.core import resource -from fpakman.core.flatpak.constants import FLATPAK_CACHE_PATH -from fpakman.core.model import Application, ApplicationData +from bauh.core import resource +from bauh.core.flatpak.constants import FLATPAK_CACHE_PATH +from bauh.core.model import Application, ApplicationData class FlatpakApplication(Application): diff --git a/fpakman/core/flatpak/worker.py b/bauh/core/flatpak/worker.py similarity index 93% rename from fpakman/core/flatpak/worker.py rename to bauh/core/flatpak/worker.py index c6d5e422..4f228fb7 100644 --- a/fpakman/core/flatpak/worker.py +++ b/bauh/core/flatpak/worker.py @@ -4,13 +4,13 @@ from threading import Thread from colorama import Fore -from fpakman.core.controller import ApplicationManager -from fpakman.core.flatpak import flatpak -from fpakman.core.flatpak.constants import FLATHUB_API_URL, FLATHUB_URL -from fpakman.core.flatpak.model import FlatpakApplication -from fpakman.core.model import ApplicationStatus -from fpakman.core.worker import AsyncDataLoader -from fpakman.util.cache import Cache +from bauh.core.controller import ApplicationManager +from bauh.core.flatpak import flatpak +from bauh.core.flatpak.constants import FLATHUB_API_URL, FLATHUB_URL +from bauh.core.flatpak.model import FlatpakApplication +from bauh.core.model import ApplicationStatus +from bauh.core.worker import AsyncDataLoader +from bauh.util.cache import Cache class FlatpakAsyncDataLoader(AsyncDataLoader): diff --git a/fpakman/core/model.py b/bauh/core/model.py similarity index 98% rename from fpakman/core/model.py rename to bauh/core/model.py index 2c867bda..2fddb6f7 100644 --- a/fpakman/core/model.py +++ b/bauh/core/model.py @@ -1,7 +1,7 @@ from abc import ABC, abstractmethod from enum import Enum -from fpakman.core import resource +from bauh.core import resource class ApplicationStatus(Enum): diff --git a/fpakman/core/resource.py b/bauh/core/resource.py similarity index 74% rename from fpakman/core/resource.py rename to bauh/core/resource.py index 9cde9f8c..64258b38 100755 --- a/fpakman/core/resource.py +++ b/bauh/core/resource.py @@ -1,5 +1,5 @@ -from fpakman import ROOT_DIR +from bauh import ROOT_DIR def get_path(resource_path): diff --git a/fpakman/core/snap/__init__.py b/bauh/core/snap/__init__.py similarity index 100% rename from fpakman/core/snap/__init__.py rename to bauh/core/snap/__init__.py diff --git a/fpakman/core/snap/constants.py b/bauh/core/snap/constants.py similarity index 71% rename from fpakman/core/snap/constants.py rename to bauh/core/snap/constants.py index 50b11b69..ed8021ca 100644 --- a/fpakman/core/snap/constants.py +++ b/bauh/core/snap/constants.py @@ -1,4 +1,4 @@ -from fpakman.core.constants import CACHE_PATH +from bauh.core.constants import CACHE_PATH SNAP_API_URL = 'https://search.apps.ubuntu.com/api/v1' SNAP_CACHE_PATH = '{}/snap/installed'.format(CACHE_PATH) diff --git a/fpakman/core/snap/controller.py b/bauh/core/snap/controller.py similarity index 83% rename from fpakman/core/snap/controller.py rename to bauh/core/snap/controller.py index 99a5eb70..7cf0f50f 100644 --- a/fpakman/core/snap/controller.py +++ b/bauh/core/snap/controller.py @@ -4,15 +4,15 @@ from argparse import Namespace from datetime import datetime from typing import Dict, List -from fpakman.core import disk -from fpakman.core.controller import ApplicationManager -from fpakman.core.disk import DiskCacheLoader -from fpakman.core.model import ApplicationData, Application, ApplicationUpdate -from fpakman.core.snap import snap -from fpakman.core.snap.model import SnapApplication -from fpakman.core.snap.worker import SnapAsyncDataLoader -from fpakman.core.system import FpakmanProcess -from fpakman.util.cache import Cache +from bauh.core import disk +from bauh.core.controller import ApplicationManager +from bauh.core.disk import DiskCacheLoader +from bauh.core.model import ApplicationData, Application, ApplicationUpdate +from bauh.core.snap import snap +from bauh.core.snap.model import SnapApplication +from bauh.core.snap.worker import SnapAsyncDataLoader +from bauh.core.system import BauhProcess +from bauh.util.cache import Cache class SnapManager(ApplicationManager): @@ -76,8 +76,8 @@ class SnapManager(ApplicationManager): def read_installed(self, disk_loader: DiskCacheLoader) -> List[SnapApplication]: return [self.map_json(app_json, installed=True, disk_loader=disk_loader) for app_json in snap.read_installed()] - def downgrade_app(self, app: Application, root_password: str) -> FpakmanProcess: - return FpakmanProcess(subproc=snap.downgrade_and_stream(app.base_data.name, root_password), wrong_error_phrase=None) + def downgrade_app(self, app: Application, root_password: str) -> BauhProcess: + return BauhProcess(subproc=snap.downgrade_and_stream(app.base_data.name, root_password), wrong_error_phrase=None) def clean_cache_for(self, app: SnapApplication): self.api_cache.delete(app.base_data.name) @@ -88,11 +88,11 @@ class SnapManager(ApplicationManager): def can_downgrade(self): return True - def update_and_stream(self, app: SnapApplication) -> FpakmanProcess: + def update_and_stream(self, app: SnapApplication) -> BauhProcess: pass - def uninstall_and_stream(self, app: SnapApplication, root_password: str) -> FpakmanProcess: - return FpakmanProcess(subproc=snap.uninstall_and_stream(app.base_data.name, root_password)) + def uninstall_and_stream(self, app: SnapApplication, root_password: str) -> BauhProcess: + return BauhProcess(subproc=snap.uninstall_and_stream(app.base_data.name, root_password)) def get_app_type(self): return SnapApplication @@ -112,8 +112,8 @@ class SnapManager(ApplicationManager): def get_history(self, app: Application) -> List[dict]: return [] - def install_and_stream(self, app: SnapApplication, root_password: str) -> FpakmanProcess: - return FpakmanProcess(subproc=snap.install_and_stream(app.base_data.name, app.confinement, root_password)) + def install_and_stream(self, app: SnapApplication, root_password: str) -> BauhProcess: + return BauhProcess(subproc=snap.install_and_stream(app.base_data.name, app.confinement, root_password)) def is_enabled(self) -> bool: return snap.is_installed() @@ -125,8 +125,8 @@ class SnapManager(ApplicationManager): def requires_root(self, action: str, app: SnapApplication): return action != 'search' - def refresh(self, app: SnapApplication, root_password: str) -> FpakmanProcess: - return FpakmanProcess(subproc=snap.refresh_and_stream(app.base_data.name, root_password)) + def refresh(self, app: SnapApplication, root_password: str) -> BauhProcess: + return BauhProcess(subproc=snap.refresh_and_stream(app.base_data.name, root_password)) def prepare(self): pass diff --git a/fpakman/core/snap/model.py b/bauh/core/snap/model.py similarity index 91% rename from fpakman/core/snap/model.py rename to bauh/core/snap/model.py index 0daa9f27..863c02ee 100644 --- a/fpakman/core/snap/model.py +++ b/bauh/core/snap/model.py @@ -1,6 +1,6 @@ -from fpakman.core import resource -from fpakman.core.model import Application, ApplicationData -from fpakman.core.snap.constants import SNAP_CACHE_PATH +from bauh.core import resource +from bauh.core.model import Application, ApplicationData +from bauh.core.snap.constants import SNAP_CACHE_PATH class SnapApplication(Application): diff --git a/fpakman/core/snap/snap.py b/bauh/core/snap/snap.py similarity index 99% rename from fpakman/core/snap/snap.py rename to bauh/core/snap/snap.py index 5421d9f0..912d2255 100644 --- a/fpakman/core/snap/snap.py +++ b/bauh/core/snap/snap.py @@ -2,7 +2,7 @@ import re import subprocess from typing import List -from fpakman.core import system +from bauh.core import system BASE_CMD = 'snap' diff --git a/fpakman/core/snap/worker.py b/bauh/core/snap/worker.py similarity index 91% rename from fpakman/core/snap/worker.py rename to bauh/core/snap/worker.py index 44e9b2ac..1b3f6678 100644 --- a/fpakman/core/snap/worker.py +++ b/bauh/core/snap/worker.py @@ -3,13 +3,13 @@ import traceback from colorama import Fore -from fpakman.core.controller import ApplicationManager -from fpakman.core.model import ApplicationStatus -from fpakman.core.snap import snap -from fpakman.core.snap.constants import SNAP_API_URL -from fpakman.core.snap.model import SnapApplication -from fpakman.core.worker import AsyncDataLoader -from fpakman.util.cache import Cache +from bauh.core.controller import ApplicationManager +from bauh.core.model import ApplicationStatus +from bauh.core.snap import snap +from bauh.core.snap.constants import SNAP_API_URL +from bauh.core.snap.model import SnapApplication +from bauh.core.worker import AsyncDataLoader +from bauh.util.cache import Cache class SnapAsyncDataLoader(AsyncDataLoader): diff --git a/fpakman/core/system.py b/bauh/core/system.py similarity index 94% rename from fpakman/core/system.py rename to bauh/core/system.py index 24564e83..a6bd770c 100644 --- a/fpakman/core/system.py +++ b/bauh/core/system.py @@ -2,11 +2,11 @@ import os import subprocess from typing import List -from fpakman import __app_name__ -from fpakman.core import resource +from bauh import __app_name__ +from bauh.core import resource -class FpakmanProcess: +class BauhProcess: def __init__(self, subproc: subprocess.Popen, success_phrase: str = None, wrong_error_phrase: str = '[sudo] password for'): self.subproc = subproc diff --git a/fpakman/core/worker.py b/bauh/core/worker.py similarity index 93% rename from fpakman/core/worker.py rename to bauh/core/worker.py index ad0a64f3..b32e186d 100644 --- a/fpakman/core/worker.py +++ b/bauh/core/worker.py @@ -3,7 +3,7 @@ from threading import Thread from colorama import Fore -from fpakman.core.model import Application +from bauh.core.model import Application class AsyncDataLoader(Thread): diff --git a/fpakman/resources/img/about.svg b/bauh/resources/img/about.svg similarity index 100% rename from fpakman/resources/img/about.svg rename to bauh/resources/img/about.svg diff --git a/fpakman/resources/img/app_info.svg b/bauh/resources/img/app_info.svg similarity index 100% rename from fpakman/resources/img/app_info.svg rename to bauh/resources/img/app_info.svg diff --git a/fpakman/resources/img/app_settings.svg b/bauh/resources/img/app_settings.svg similarity index 100% rename from fpakman/resources/img/app_settings.svg rename to bauh/resources/img/app_settings.svg diff --git a/fpakman/resources/img/app_update.svg b/bauh/resources/img/app_update.svg similarity index 100% rename from fpakman/resources/img/app_update.svg rename to bauh/resources/img/app_update.svg diff --git a/fpakman/resources/img/checked.svg b/bauh/resources/img/checked.svg similarity index 100% rename from fpakman/resources/img/checked.svg rename to bauh/resources/img/checked.svg diff --git a/fpakman/resources/img/downgrade.svg b/bauh/resources/img/downgrade.svg similarity index 100% rename from fpakman/resources/img/downgrade.svg rename to bauh/resources/img/downgrade.svg diff --git a/fpakman/resources/img/exclamation.svg b/bauh/resources/img/exclamation.svg similarity index 100% rename from fpakman/resources/img/exclamation.svg rename to bauh/resources/img/exclamation.svg diff --git a/fpakman/resources/img/flathub.svg b/bauh/resources/img/flathub.svg similarity index 100% rename from fpakman/resources/img/flathub.svg rename to bauh/resources/img/flathub.svg diff --git a/fpakman/resources/img/history.svg b/bauh/resources/img/history.svg similarity index 100% rename from fpakman/resources/img/history.svg rename to bauh/resources/img/history.svg diff --git a/fpakman/resources/img/install.svg b/bauh/resources/img/install.svg similarity index 100% rename from fpakman/resources/img/install.svg rename to bauh/resources/img/install.svg diff --git a/fpakman/resources/img/logo.png b/bauh/resources/img/logo.png similarity index 100% rename from fpakman/resources/img/logo.png rename to bauh/resources/img/logo.png diff --git a/fpakman/resources/img/logo.svg b/bauh/resources/img/logo.svg similarity index 100% rename from fpakman/resources/img/logo.svg rename to bauh/resources/img/logo.svg diff --git a/fpakman/resources/img/logo_update.png b/bauh/resources/img/logo_update.png similarity index 100% rename from fpakman/resources/img/logo_update.png rename to bauh/resources/img/logo_update.png diff --git a/fpakman/resources/img/logo_update.svg b/bauh/resources/img/logo_update.svg similarity index 100% rename from fpakman/resources/img/logo_update.svg rename to bauh/resources/img/logo_update.svg diff --git a/fpakman/resources/img/red_cross.svg b/bauh/resources/img/red_cross.svg similarity index 100% rename from fpakman/resources/img/red_cross.svg rename to bauh/resources/img/red_cross.svg diff --git a/fpakman/resources/img/refresh.svg b/bauh/resources/img/refresh.svg similarity index 100% rename from fpakman/resources/img/refresh.svg rename to bauh/resources/img/refresh.svg diff --git a/fpakman/resources/img/search.svg b/bauh/resources/img/search.svg similarity index 100% rename from fpakman/resources/img/search.svg rename to bauh/resources/img/search.svg diff --git a/fpakman/resources/img/snapcraft.png b/bauh/resources/img/snapcraft.png similarity index 100% rename from fpakman/resources/img/snapcraft.png rename to bauh/resources/img/snapcraft.png diff --git a/fpakman/resources/img/uninstall.svg b/bauh/resources/img/uninstall.svg similarity index 100% rename from fpakman/resources/img/uninstall.svg rename to bauh/resources/img/uninstall.svg diff --git a/fpakman/resources/img/update_green.svg b/bauh/resources/img/update_green.svg similarity index 100% rename from fpakman/resources/img/update_green.svg rename to bauh/resources/img/update_green.svg diff --git a/fpakman/resources/img/update_logo.svg b/bauh/resources/img/update_logo.svg similarity index 100% rename from fpakman/resources/img/update_logo.svg rename to bauh/resources/img/update_logo.svg diff --git a/fpakman/resources/locale/en b/bauh/resources/locale/en similarity index 100% rename from fpakman/resources/locale/en rename to bauh/resources/locale/en diff --git a/fpakman/resources/locale/es b/bauh/resources/locale/es similarity index 100% rename from fpakman/resources/locale/es rename to bauh/resources/locale/es diff --git a/fpakman/resources/locale/pt b/bauh/resources/locale/pt similarity index 100% rename from fpakman/resources/locale/pt rename to bauh/resources/locale/pt diff --git a/fpakman/util/__init__.py b/bauh/util/__init__.py similarity index 100% rename from fpakman/util/__init__.py rename to bauh/util/__init__.py diff --git a/fpakman/util/cache.py b/bauh/util/cache.py similarity index 100% rename from fpakman/util/cache.py rename to bauh/util/cache.py diff --git a/fpakman/util/memory.py b/bauh/util/memory.py similarity index 93% rename from fpakman/util/memory.py rename to bauh/util/memory.py index 12f65911..1f7a0f42 100644 --- a/fpakman/util/memory.py +++ b/bauh/util/memory.py @@ -2,7 +2,7 @@ import time from threading import Thread from typing import List -from fpakman.util.cache import Cache +from bauh.util.cache import Cache class CacheCleaner(Thread): diff --git a/fpakman/util/util.py b/bauh/util/util.py similarity index 96% rename from fpakman/util/util.py rename to bauh/util/util.py index 678c577d..3215a4c6 100644 --- a/fpakman/util/util.py +++ b/bauh/util/util.py @@ -1,6 +1,6 @@ import locale -from fpakman.core import resource +from bauh.core import resource import glob import re diff --git a/fpakman/view/__init__.py b/bauh/view/__init__.py similarity index 100% rename from fpakman/view/__init__.py rename to bauh/view/__init__.py diff --git a/fpakman/view/qt/__init__.py b/bauh/view/qt/__init__.py similarity index 100% rename from fpakman/view/qt/__init__.py rename to bauh/view/qt/__init__.py diff --git a/fpakman/view/qt/about.py b/bauh/view/qt/about.py similarity index 91% rename from fpakman/view/qt/about.py rename to bauh/view/qt/about.py index 87810957..37f76552 100644 --- a/fpakman/view/qt/about.py +++ b/bauh/view/qt/about.py @@ -2,11 +2,11 @@ from PyQt5.QtCore import Qt from PyQt5.QtGui import QPixmap from PyQt5.QtWidgets import QVBoxLayout, QDialog, QLabel -from fpakman import __version__, __app_name__ -from fpakman.core import resource +from bauh import __version__, __app_name__ +from bauh.core import resource -PROJECT_URL = 'https://github.com/vinifmor/fpakman' -LICENSE_URL = 'https://raw.githubusercontent.com/vinifmor/fpakman/master/LICENSE' +PROJECT_URL = 'https://github.com/vinifmor/' + __app_name__ +LICENSE_URL = 'https://raw.githubusercontent.com/vinifmor/{}/master/LICENSE'.format(__app_name__) class AboutDialog(QDialog): diff --git a/fpakman/view/qt/apps_table.py b/bauh/view/qt/apps_table.py similarity index 98% rename from fpakman/view/qt/apps_table.py rename to bauh/view/qt/apps_table.py index b953626e..a871792c 100644 --- a/fpakman/view/qt/apps_table.py +++ b/bauh/view/qt/apps_table.py @@ -8,12 +8,12 @@ from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest from PyQt5.QtWidgets import QTableWidget, QTableView, QMenu, QAction, QTableWidgetItem, QWidget, \ QHeaderView, QLabel, QHBoxLayout, QPushButton, QToolButton, QToolBar -from fpakman.core import resource -from fpakman.core.model import ApplicationStatus -from fpakman.util import util -from fpakman.util.cache import Cache -from fpakman.view.qt import dialog -from fpakman.view.qt.view_model import ApplicationView, ApplicationViewStatus +from bauh.core import resource +from bauh.core.model import ApplicationStatus +from bauh.util import util +from bauh.util.cache import Cache +from bauh.view.qt import dialog +from bauh.view.qt.view_model import ApplicationView, ApplicationViewStatus INSTALL_BT_STYLE = 'background: {back}; color: white; font-size: 10px; font-weight: bold' diff --git a/fpakman/view/qt/dialog.py b/bauh/view/qt/dialog.py similarity index 97% rename from fpakman/view/qt/dialog.py rename to bauh/view/qt/dialog.py index f5cfbb09..9681d072 100644 --- a/fpakman/view/qt/dialog.py +++ b/bauh/view/qt/dialog.py @@ -1,7 +1,7 @@ from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QMessageBox -from fpakman.core import resource +from bauh.core import resource def show_error(title: str, body: str, icon: QIcon = QIcon(resource.get_path('img/logo.svg'))): diff --git a/fpakman/view/qt/history.py b/bauh/view/qt/history.py similarity index 98% rename from fpakman/view/qt/history.py rename to bauh/view/qt/history.py index 80503b47..5260f517 100644 --- a/fpakman/view/qt/history.py +++ b/bauh/view/qt/history.py @@ -5,7 +5,7 @@ from PyQt5.QtCore import Qt from PyQt5.QtGui import QColor from PyQt5.QtWidgets import QDialog, QVBoxLayout, QTableWidget, QTableWidgetItem, QHeaderView -from fpakman.util.cache import Cache +from bauh.util.cache import Cache class HistoryDialog(QDialog): diff --git a/fpakman/view/qt/info.py b/bauh/view/qt/info.py similarity index 96% rename from fpakman/view/qt/info.py rename to bauh/view/qt/info.py index 3d0847f3..f290a9e7 100644 --- a/fpakman/view/qt/info.py +++ b/bauh/view/qt/info.py @@ -2,8 +2,8 @@ from PyQt5.QtCore import QSize from PyQt5.QtWidgets import QDialog, QVBoxLayout, QFormLayout, QGroupBox, \ QLineEdit, QLabel -from fpakman.util import util -from fpakman.util.cache import Cache +from bauh.util import util +from bauh.util.cache import Cache IGNORED_ATTRS = {'name', '__app__'} diff --git a/fpakman/view/qt/root.py b/bauh/view/qt/root.py similarity index 96% rename from fpakman/view/qt/root.py rename to bauh/view/qt/root.py index 55bef81d..5334253b 100644 --- a/fpakman/view/qt/root.py +++ b/bauh/view/qt/root.py @@ -4,7 +4,7 @@ import subprocess from PyQt5.QtWidgets import QInputDialog, QLineEdit -from fpakman.view.qt.dialog import show_error +from bauh.view.qt.dialog import show_error def is_root(): diff --git a/fpakman/view/qt/systray.py b/bauh/view/qt/systray.py similarity index 93% rename from fpakman/view/qt/systray.py rename to bauh/view/qt/systray.py index df4f0450..20ed27f8 100755 --- a/fpakman/view/qt/systray.py +++ b/bauh/view/qt/systray.py @@ -6,12 +6,12 @@ from PyQt5.QtCore import QThread, pyqtSignal, QCoreApplication, Qt from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QSystemTrayIcon, QMenu -from fpakman import __app_name__ -from fpakman.core import resource, system -from fpakman.core.controller import ApplicationManager -from fpakman.core.model import ApplicationUpdate -from fpakman.view.qt.about import AboutDialog -from fpakman.view.qt.window import ManageWindow +from bauh import __app_name__ +from bauh.core import resource, system +from bauh.core.controller import ApplicationManager +from bauh.core.model import ApplicationUpdate +from bauh.view.qt.about import AboutDialog +from bauh.view.qt.window import ManageWindow class UpdateCheck(QThread): diff --git a/fpakman/view/qt/thread.py b/bauh/view/qt/thread.py similarity index 96% rename from fpakman/view/qt/thread.py rename to bauh/view/qt/thread.py index 401c005e..4460a2ed 100644 --- a/fpakman/view/qt/thread.py +++ b/bauh/view/qt/thread.py @@ -6,18 +6,18 @@ from typing import List import requests from PyQt5.QtCore import QThread, pyqtSignal -from fpakman.core.controller import ApplicationManager -from fpakman.core.exception import NoInternetException -from fpakman.core.model import ApplicationStatus -from fpakman.core.system import FpakmanProcess -from fpakman.util.cache import Cache -from fpakman.view.qt import dialog -from fpakman.view.qt.view_model import ApplicationView +from bauh.core.controller import ApplicationManager +from bauh.core.exception import NoInternetException +from bauh.core.model import ApplicationStatus +from bauh.core.system import BauhProcess +from bauh.util.cache import Cache +from bauh.view.qt import dialog +from bauh.view.qt.view_model import ApplicationView class AsyncAction(QThread): - def notify_subproc_outputs(self, proc: FpakmanProcess, signal) -> bool: + def notify_subproc_outputs(self, proc: BauhProcess, signal) -> bool: """ :param subproc: :param signal: diff --git a/fpakman/view/qt/view_model.py b/bauh/view/qt/view_model.py similarity index 91% rename from fpakman/view/qt/view_model.py rename to bauh/view/qt/view_model.py index 0e764318..7f96a85c 100644 --- a/fpakman/view/qt/view_model.py +++ b/bauh/view/qt/view_model.py @@ -1,6 +1,6 @@ from enum import Enum -from fpakman.core.model import Application +from bauh.core.model import Application class ApplicationViewStatus(Enum): diff --git a/fpakman/view/qt/window.py b/bauh/view/qt/window.py similarity index 97% rename from fpakman/view/qt/window.py rename to bauh/view/qt/window.py index 946b9cb8..1ce4d484 100755 --- a/fpakman/view/qt/window.py +++ b/bauh/view/qt/window.py @@ -7,19 +7,19 @@ from PyQt5.QtGui import QIcon, QWindowStateChangeEvent, QPixmap from PyQt5.QtWidgets import QWidget, QVBoxLayout, QApplication, QCheckBox, QHeaderView, QToolButton, QToolBar, \ QSizePolicy, QLabel, QPlainTextEdit, QLineEdit, QProgressBar, QHBoxLayout -from fpakman.core import resource, system -from fpakman.core.controller import ApplicationManager -from fpakman.core.model import Application -from fpakman.util.cache import Cache -from fpakman.view.qt import dialog -from fpakman.view.qt.about import AboutDialog -from fpakman.view.qt.apps_table import AppsTable -from fpakman.view.qt.history import HistoryDialog -from fpakman.view.qt.info import InfoDialog -from fpakman.view.qt.root import is_root, ask_root_password -from fpakman.view.qt.thread import UpdateSelectedApps, RefreshApps, UninstallApp, DowngradeApp, GetAppInfo, \ +from bauh.core import resource, system +from bauh.core.controller import ApplicationManager +from bauh.core.model import Application +from bauh.util.cache import Cache +from bauh.view.qt import dialog +from bauh.view.qt.about import AboutDialog +from bauh.view.qt.apps_table import AppsTable +from bauh.view.qt.history import HistoryDialog +from bauh.view.qt.info import InfoDialog +from bauh.view.qt.root import is_root, ask_root_password +from bauh.view.qt.thread import UpdateSelectedApps, RefreshApps, UninstallApp, DowngradeApp, GetAppInfo, \ GetAppHistory, SearchApps, InstallApp, AnimateProgress, VerifyModels, RefreshApp, FindSuggestions, ListWarnings -from fpakman.view.qt.view_model import ApplicationView +from bauh.view.qt.view_model import ApplicationView DARK_ORANGE = '#FF4500' diff --git a/setup.py b/setup.py index dfb8ce45..fd72ce5e 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,8 @@ DESCRIPTION = ( AUTHOR = "Vinicius Moreira" AUTHOR_EMAIL = "vinicius_fmoreira@hotmail.com" -URL = "https://github.com/vinifmor/fpakman" +NAME = 'bauh' +URL = "https://github.com/vinifmor/" + NAME file_dir = os.path.dirname(os.path.abspath(__file__)) @@ -15,12 +16,12 @@ with open(file_dir + '/requirements.txt', 'r') as f: requirements = [line.strip() for line in f.readlines() if line] -with open(file_dir + '/fpakman/__init__.py', 'r') as f: +with open(file_dir + '/{}/__init__.py'.format(NAME), 'r') as f: exec(f.readlines()[0]) setup( - name="fpakman", + name=NAME, version=eval('__version__'), description=DESCRIPTION, long_description=DESCRIPTION, @@ -29,11 +30,11 @@ setup( python_requires=">=3.5", url=URL, packages=find_packages(), - package_data={"fpakman": ["resources/locale/*", "resources/img/*"]}, + package_data={NAME: ["resources/locale/*", "resources/img/*"]}, install_requires=requirements, entry_points={ "console_scripts": [ - "fpakman=fpakman.app" + "{name}={name}.app".format(name=NAME) ] }, include_package_data=True,