mirror of
				https://github.com/Neocky/pluGET.git
				synced 2024-04-29 16:12:30 +00:00 
			
		
		
		
	Added new progress bar and some formating
Changes: - added simple progress bar when checking/updating plugins - misc code cleanup - changed logo
This commit is contained in:
		| @@ -1,10 +1,7 @@ | ||||
| from utils.consoleoutput import consoleTitle, clearConsole, printMainMenu, oColors | ||||
| from utils.utilities import getHelp, check_requirements | ||||
| from utils.consoleoutput import consoleTitle, clearConsole, printMainMenu | ||||
| from utils.utilities import check_requirements | ||||
| from handlers.handle_input import createInputLists, getInput | ||||
| from handlers.handle_config import checkConfig | ||||
| from plugin.plugin_downloader import searchPackage, getSpecificPackage | ||||
| from plugin.plugin_updatechecker import updateInstalledPackage, checkInstalledPackage | ||||
| from plugin.plugin_remover import removePlugin | ||||
|  | ||||
|  | ||||
| def mainFunction(): | ||||
|   | ||||
| @@ -97,8 +97,9 @@ def checkInstalledPackage(inputSelectedObject="all"): | ||||
|     oldPackages = 0 | ||||
|     print(f"Checking: {inputSelectedObject}") | ||||
|     print("Index | Name                           | Installed V. | Latest V. |  Update available") | ||||
|     print("─────────────────────────────────────────────────────────────────────────────────────") | ||||
|     try: | ||||
|         for plugin in track(pluginList, description="Checking plugins" ,transient=True, complete_style="cyan"): | ||||
|         for plugin in track(pluginList, description="Checking for updates" ,transient=True, complete_style="cyan"): | ||||
|             try: | ||||
|                 fileName = getFileName(plugin) | ||||
|                 fileVersion = getFileVersion(plugin) | ||||
| @@ -109,7 +110,6 @@ def checkInstalledPackage(inputSelectedObject="all"): | ||||
|             pluginIdStr = str(pluginId) | ||||
|             if fileVersion == '': | ||||
|                 fileVersion = 'N/A' | ||||
|  | ||||
|             try: | ||||
|                 pluginLatestVersion = INSTALLEDPLUGINLIST[i][2] | ||||
|             except IndexError: | ||||
| @@ -146,7 +146,7 @@ def checkInstalledPackage(inputSelectedObject="all"): | ||||
|  | ||||
|             i += 1 | ||||
|     except TypeError: | ||||
|         print(oColors.brightRed + "Aborted checking for plugins." + oColors.standardWhite) | ||||
|         print(oColors.brightRed + "Aborted checking for updates." + oColors.standardWhite) | ||||
|     print(oColors.brightYellow + f"Old packages: [{oldPackages}/{i}]" + oColors.standardWhite) | ||||
|  | ||||
|  | ||||
| @@ -162,8 +162,9 @@ def updateInstalledPackage(inputSelectedObject='all'): | ||||
|     indexNumberUpdated = 0 | ||||
|     print(f"Updating: {inputSelectedObject}") | ||||
|     print("Index | Name                        |   Old V.   |   New V.") | ||||
|     print("───────────────────────────────────────────────────────────") | ||||
|     try: | ||||
|         for plugin in pluginList: | ||||
|         for plugin in track(pluginList, description="Updating" ,transient=True, complete_style="red"): | ||||
|             try: | ||||
|                 fileName = getFileName(plugin) | ||||
|                 fileVersion = getFileVersion(plugin) | ||||
| @@ -177,10 +178,9 @@ def updateInstalledPackage(inputSelectedObject='all'): | ||||
|                 continue | ||||
|             pluginIdStr = str(pluginId) | ||||
|  | ||||
|             if pluginId == None: | ||||
|             if pluginId == None or pluginId == '': | ||||
|                 print(oColors.brightRed + "Couldn't find plugin id. Sorry :(" + oColors.standardWhite) | ||||
|                 continue | ||||
|  | ||||
|             if inputSelectedObject == pluginIdStr or re.search(inputSelectedObject, fileName, re.IGNORECASE): | ||||
|                 if INSTALLEDPLUGINLIST[i][3] == True: | ||||
|                     print(f" [{indexNumberUpdated+1}]".ljust(8), end='') | ||||
| @@ -190,7 +190,7 @@ def updateInstalledPackage(inputSelectedObject='all'): | ||||
|                     print(f"{latestVersion}".ljust(8)) | ||||
|  | ||||
|                     if not checkConfig().localPluginFolder: | ||||
|                         if checkConfig().sftp_pathToSeperateDownloadPath is True: | ||||
|                         if checkConfig().sftp_seperateDownloadPath is True: | ||||
|                             pluginPath = checkConfig().sftp_pathToSeperateDownloadPath | ||||
|                         else: | ||||
|                             pluginPath = checkConfig().sftp_folderPath | ||||
| @@ -243,7 +243,6 @@ def updateInstalledPackage(inputSelectedObject='all'): | ||||
|                             pluginPath = checkConfig().sftp_pathToSeperateDownloadPath | ||||
|                         else: | ||||
|                             pluginPath = checkConfig().sftp_folderPath | ||||
|                         pluginPath = checkConfig().sftp_folderPath | ||||
|                         pluginPath = f"{pluginPath}/{plugin}" | ||||
|                         sftp = createSFTPConnection() | ||||
|                         indexNumberUpdated += 1 | ||||
|   | ||||
| @@ -18,6 +18,7 @@ class oColors: | ||||
|     brightRed = "\033[91m" | ||||
|     brightGreen = "\033[92m" | ||||
|     darkMagenta = "\033[35m" | ||||
|     brightBlack = "\033[90m" | ||||
|  | ||||
|  | ||||
| def printLogo(): | ||||
| @@ -72,9 +73,12 @@ def printLogo(): | ||||
|     oColors.standardWhite) | ||||
|     print() | ||||
|     print() | ||||
|     print(oColors.brightYellow + "                                      [" + oColors.darkMagenta + "By Neocky" + | ||||
|     oColors.brightYellow + "]                                    " + oColors.standardWhite) | ||||
|     print() | ||||
|     print(oColors.brightBlack + "                        ┌────────────────────────────────────┐" + oColors.standardWhite) | ||||
|     print(oColors.brightBlack + "                        │             [" + oColors.brightMagenta + "By Neocky" +oColors.brightBlack + | ||||
|      "]            │                                   " + oColors.standardWhite) | ||||
|     print(oColors.brightBlack + "                        │  " + oColors.brightMagenta + "https://github.com/Neocky/pluGET" + oColors.brightBlack + | ||||
|      "  │                                                  " + oColors.standardWhite) | ||||
|     print(oColors.brightBlack + "                        └────────────────────────────────────┘" + oColors.standardWhite) | ||||
|  | ||||
|  | ||||
| def printHorizontalLine(): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Neocky
					Neocky