forked from sh-edraft.de/sh_linux_installation_scripts
		
	Compare commits
	
		
			3 Commits
		
	
	
		
			e017462416
			...
			master
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 359d333add | |||
| 51c852a839 | |||
| e4c585d4c5 | 
							
								
								
									
										19
									
								
								src/multi_install/abc/application_menu_service_abc.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								src/multi_install/abc/application_menu_service_abc.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | ||||
| from abc import ABC, abstractmethod | ||||
|  | ||||
|  | ||||
| class ApplicationMenuServiceABC(ABC): | ||||
|  | ||||
|     @abstractmethod | ||||
|     def __init__(self): pass | ||||
|  | ||||
|     @abstractmethod | ||||
|     def install_application(self): pass | ||||
|  | ||||
|     @abstractmethod | ||||
|     def uninstall_application(self): pass | ||||
|  | ||||
|     @abstractmethod | ||||
|     def add_application(self): pass | ||||
|  | ||||
|     @abstractmethod | ||||
|     def remove_application(self): pass | ||||
| @@ -1,7 +0,0 @@ | ||||
| from abc import ABC, abstractmethod | ||||
|  | ||||
|  | ||||
| class ApplicationServiceABC(ABC): | ||||
|  | ||||
|     @abstractmethod | ||||
|     def __init__(self): pass | ||||
							
								
								
									
										39
									
								
								src/multi_install/config/application_list_settings.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								src/multi_install/config/application_list_settings.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,39 @@ | ||||
| import traceback | ||||
|  | ||||
| from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC | ||||
| from cpl_core.console import Console | ||||
|  | ||||
| from multi_install.config.application_settings import ApplicationSettings | ||||
|  | ||||
|  | ||||
| class ApplicationListSettings(ConfigurationModelABC): | ||||
|  | ||||
|     def __init__(self): | ||||
|         ConfigurationModelABC.__init__(self) | ||||
|  | ||||
|         self._debian_apps = [] | ||||
|         self._red_hat_apps = [] | ||||
|  | ||||
|     @property | ||||
|     def debian_apps(self) -> str: | ||||
|         return self._debian_apps | ||||
|  | ||||
|     @property | ||||
|     def redhat_apps(self) -> str: | ||||
|         return self._debian_apps | ||||
|  | ||||
|     def from_dict(self, settings: dict): | ||||
|         try: | ||||
|              | ||||
|             for app_cfg in settings['Debian']: | ||||
|                 app = ApplicationSettings() | ||||
|                 app.from_dict(app_cfg) | ||||
|                 self._debian_apps.append(app) | ||||
|                      | ||||
|             for app_cfg in settings['RedHat']: | ||||
|                 app = ApplicationSettings() | ||||
|                 app.from_dict(app_cfg) | ||||
|                 self._red_hat_apps.append(app) | ||||
|         except Exception as e: | ||||
|             Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings') | ||||
|             Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}') | ||||
							
								
								
									
										36
									
								
								src/multi_install/config/application_settings.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										36
									
								
								src/multi_install/config/application_settings.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,36 @@ | ||||
| import traceback | ||||
| from typing import Optional | ||||
|  | ||||
| from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC | ||||
| from cpl_core.console import Console | ||||
|  | ||||
|  | ||||
| class ApplicationSettings(ConfigurationModelABC): | ||||
|  | ||||
|     def __init__(self): | ||||
|         ConfigurationModelABC.__init__(self) | ||||
|  | ||||
|         self._name = '' | ||||
|         self._repository = '' | ||||
|         self._source_url = '' | ||||
|  | ||||
|     @property | ||||
|     def name(self) -> str: | ||||
|         return self._name | ||||
|      | ||||
|     @property | ||||
|     def repository(self) -> str: | ||||
|         return self._repository | ||||
|      | ||||
|     @property | ||||
|     def source_url(self) -> Optional[str]: | ||||
|         return self._source_url(self) | ||||
|  | ||||
|     def from_dict(self, settings: dict): | ||||
|         try: | ||||
|             self._name = settings['Name'] | ||||
|             self._repository = settings['Repository'] if 'Repository' in settings else None | ||||
|             self._source_url = settings['SourceUrl'] if 'SourceUrl' in settings else None | ||||
|         except Exception as e: | ||||
|             Console.error(f'[ ERROR ] [ {__name__} ]: Reading error in {self.__name__} settings') | ||||
|             Console.error(f'[ EXCEPTION ] [ {__name__} ]: {e} -> {traceback.format_exc()}') | ||||
| @@ -3,11 +3,13 @@ from enum import Enum | ||||
|  | ||||
| class MainMenuEnum(Enum): | ||||
|  | ||||
|     list_collection = 'List collection' | ||||
|     install_collection = 'Install collection' | ||||
|     uninstall_collection = 'Uninstall collection' | ||||
|     add_collection = 'Add collection' | ||||
|     remove_collection = 'Remove collection' | ||||
|      | ||||
|     list_application = 'List application' | ||||
|     install_application = 'Install application' | ||||
|     uninstall_application = 'Uninstall application' | ||||
|     add_application = 'Add application' | ||||
|   | ||||
							
								
								
									
										16
									
								
								src/multi_install/service/application_menu_service.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								src/multi_install/service/application_menu_service.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,16 @@ | ||||
| from multi_install.abc.application_menu_service_abc import ApplicationMenuServiceABC | ||||
| from multi_install.config.application_list_settings import ApplicationListSettings | ||||
|  | ||||
|  | ||||
| class ApplicationMenuService(ApplicationMenuServiceABC): | ||||
|  | ||||
|     def __init__(self, application_settings: ApplicationListSettings): | ||||
|         pass | ||||
|  | ||||
|     def install_application(self): pass | ||||
|  | ||||
|     def uninstall_application(self): pass | ||||
|  | ||||
|     def add_application(self): pass | ||||
|  | ||||
|     def remove_application(self): pass | ||||
| @@ -1,4 +0,0 @@ | ||||
| class ApplicationService: | ||||
|  | ||||
|     def __init__(self): | ||||
|         pass | ||||
| @@ -1,4 +1,7 @@ | ||||
| class CollectionService: | ||||
| from multi_install.abc.collection_service_abc import CollectionServiceABC | ||||
|  | ||||
|  | ||||
| class CollectionService(CollectionServiceABC): | ||||
|  | ||||
|     def __init__(self): | ||||
|         pass | ||||
|   | ||||
| @@ -69,12 +69,14 @@ class MenuService(MenuServiceABC): | ||||
|             return True | ||||
|          | ||||
|         # collection menu | ||||
|         if selected == options.index(MainMenuEnum.install_collection.value): pass | ||||
|         if selected == options.index(MainMenuEnum.list_collection.value): pass | ||||
|         elif selected == options.index(MainMenuEnum.install_collection.value): pass | ||||
|         elif selected == options.index(MainMenuEnum.uninstall_collection.value): pass | ||||
|         elif selected == options.index(MainMenuEnum.add_collection.value): pass | ||||
|         elif selected == options.index(MainMenuEnum.remove_collection.value): pass | ||||
|          | ||||
|         # application menu | ||||
|         elif selected == options.index(MainMenuEnum.list_application.value): pass | ||||
|         elif selected == options.index(MainMenuEnum.install_application.value): pass | ||||
|         elif selected == options.index(MainMenuEnum.uninstall_application.value): pass | ||||
|         elif selected == options.index(MainMenuEnum.add_application.value): pass | ||||
|   | ||||
							
								
								
									
										98
									
								
								src/multi_install_cli/apps.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										98
									
								
								src/multi_install_cli/apps.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,98 @@ | ||||
| { | ||||
|   "Application": { | ||||
|     "RedHat": [], | ||||
|     "Debian": [ | ||||
|       { | ||||
|         "Name": "brave-browser", | ||||
|         "Deps": [ | ||||
|           { | ||||
|             "Name": "apt-transport-https" | ||||
|           }, | ||||
|           { | ||||
|             "Name": "curl" | ||||
|           } | ||||
|         ] | ||||
|       }, | ||||
|       { | ||||
|         "Name": "barrier" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "gnome-boxes" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "google-chrome", | ||||
|         "SourceUrl": "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "chrome-gnome-shell" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "discord", | ||||
|         "SourceUrl": "https://discordapp.com/api/download?platform=linux&format=deb" | ||||
|       }, | ||||
|       { | ||||
|         "Name:": "balena-etcher-electron" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "flameshot" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "geary" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "git" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "gnome-tweaks" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "gpick" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "kcolorchooser" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "keepassxc" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "lsd", | ||||
|         "SourceUrl": "https://github.com/Peltoche/lsd/releases/download/0.19.0/lsd_0.19.0_amd64.deb" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "ncdu" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "neofetch" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "nextcloud-client", | ||||
|         "Repository": "ppa:nextcloud-devs/client" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "signal-desktop" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "stacer" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "sublime-text", | ||||
|         "Repository": "deb https://download.sublimetext.com/ apt/stable/" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "timeshift", | ||||
|         "Repository": "ppa:teejee2008/ppa" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "trash-cli" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "ulauncher", | ||||
|         "Repository": "ppa:agornostal/ulauncher" | ||||
|       }, | ||||
|       { | ||||
|         "Name": "code", | ||||
|         "Repository": "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" | ||||
|       } | ||||
|     ] | ||||
|   } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user