mirror of
https://github.com/Neocky/pluGET.git
synced 2024-04-29 16:12:30 +00:00
Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9b628498f1 | ||
![]() |
d40ee52da1 | ||
![]() |
e66985054c | ||
![]() |
e1efcc4fc7 | ||
![]() |
1147d4f29c | ||
![]() |
ebb04085d3 | ||
![]() |
e161d2c2f9 | ||
![]() |
01465eb769 | ||
![]() |
d478432396 | ||
![]() |
d7fc68195b |
71
README.md
71
README.md
@@ -12,14 +12,17 @@
|
|||||||
<a href="https://github.com/Neocky/pluGET/blob/main/LICENSE"> <img src="https://img.shields.io/github/license/Neocky/pluGET" alt="Apache-2.0" border="0"></a>
|
<a href="https://github.com/Neocky/pluGET/blob/main/LICENSE"> <img src="https://img.shields.io/github/license/Neocky/pluGET" alt="Apache-2.0" border="0"></a>
|
||||||
<a href="https://github.com/Neocky/pluGET/releases"> <img src="https://img.shields.io/github/v/release/Neocky/pluGET?include_prereleases" alt"latestrelease"></a>
|
<a href="https://github.com/Neocky/pluGET/releases"> <img src="https://img.shields.io/github/v/release/Neocky/pluGET?include_prereleases" alt"latestrelease"></a>
|
||||||
<a href="https://github.com/Neocky/pluGET/releases"> <img src="https://img.shields.io/github/downloads/Neocky/pluGET/total" alt="downloads" border="0"></a>
|
<a href="https://github.com/Neocky/pluGET/releases"> <img src="https://img.shields.io/github/downloads/Neocky/pluGET/total" alt="downloads" border="0"></a>
|
||||||
<img src="https://hitcounter.pythonanywhere.com/count/tag.svg?url=https%3A%2F%2Fgithub.com%2FNeocky%2FpluGET" alt="Hits">
|
<a href="https://hits.seeyoufarm.com"><img src="https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FNeocky%2FpluGET&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false"/></a>
|
||||||
|
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
||||||
# pluGET
|
# pluGET
|
||||||
A powerfull package manager which handles [Plugins](https://www.spigotmc.org/resources/) and Server Software for minecraft servers.
|
#### A powerfull package manager which handles [Plugins](https://www.spigotmc.org/resources/) and Server Software for minecraft servers.
|
||||||
|
|
||||||
|
<img src="https://i.ibb.co/82dnyrK/image.png" alt="meme" border="0" height="350" width="350"></a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Issues? Found a bug?
|
## Issues? Found a bug?
|
||||||
@@ -97,7 +100,21 @@ Edit the config to your needs and relaunch pluGET.
|
|||||||
Execute the `launcher.bat` in the `\pluGET` folder. This will launch pluGET correctly.
|
Execute the `launcher.bat` in the `\pluGET` folder. This will launch pluGET correctly.
|
||||||
Another way is to launch the `src\__main__.py` file.
|
Another way is to launch the `src\__main__.py` file.
|
||||||
The following are examples of input for the general usage:
|
The following are examples of input for the general usage:
|
||||||
(Hint: [thingsInBrackets] are optional & 'all' can always be exchanged through the plugin name or the plugin id and reverse)
|
(Hint: [thingsInBrackets] are optional & 'all' can always be exchanged through the plugin name or the plugin id and reverse)
|
||||||
|
|
||||||
|
### General
|
||||||
|
#### Command help:
|
||||||
|
`help command [all/command]`
|
||||||
|
```
|
||||||
|
help command
|
||||||
|
```
|
||||||
|
<details>
|
||||||
|
<summary>Output</summary>
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
### Manage Plugins
|
### Manage Plugins
|
||||||
#### Download the latest update of a specific package:
|
#### Download the latest update of a specific package:
|
||||||
`get [pluginID/pluginName]`
|
`get [pluginID/pluginName]`
|
||||||
@@ -117,6 +134,15 @@ or:
|
|||||||
```
|
```
|
||||||
check 'pluginName'
|
check 'pluginName'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Output</summary>
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
|
||||||
#### Update all plugins/one specific plugin:
|
#### Update all plugins/one specific plugin:
|
||||||
`update [all/pluginName]`
|
`update [all/pluginName]`
|
||||||
```
|
```
|
||||||
@@ -172,35 +198,12 @@ get-paper 321
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Known problems
|
## Known problems
|
||||||
### Can't get installed version
|
|
||||||
For example:
|
### Can't get latest version/Update available
|
||||||
```
|
For example:
|
||||||
pluGET >> check all
|

|
||||||
Checking: all
|
As you can see the installed version was found but not the latest version for this plugin.
|
||||||
Index | Name | Installed V. | Latest V. | Update available
|
This is because this is a plugin which is not available on [Spigot](https://www.spigotmc.org/resources/).
|
||||||
[1] Vault N/A 1.7.3 False
|
pluGET supports currently only plugins from [Spigot](https://www.spigotmc.org/resources/).
|
||||||
```
|
In this example this is a bukkit plugin.
|
||||||
This is a known issue because the filename in the `\plugin` folder doesn't include a version.
|
|
||||||
This is the plugin file in the `\plugin` folder right now: `Vault.jar`
|
|
||||||
How it should be: `Vault-1.7.3.jar`
|
|
||||||
Many plugins which get download from Spigot won't have a file version in the name.
|
|
||||||
#### How to solve:
|
|
||||||
Delete the `Vault.jar` file and download the newest version with the `get` command:
|
|
||||||
```
|
|
||||||
pluGET >> get vault
|
|
||||||
Index | Name | Description | Downloads
|
|
||||||
[1] Vault Vault is a Permissions, Chat, & Economy API to give plugins easy hooks into these systems. 989046
|
|
||||||
Select your wanted Ressource (Index)(0 to exit): 1
|
|
||||||
Downloadsize: 267.31 KB
|
|
||||||
File downloaded here: C:\Users\USER\Desktop\plugins\Vault-1.7.3.jar
|
|
||||||
```
|
|
||||||
Now you got the plugin with the correct name inside your `\plugin` folder: `Vault-1.7.3.jar`
|
|
||||||
|
|
||||||
And pluGET will tell you the installed version and check if an update is available when checking again:
|
|
||||||
```
|
|
||||||
pluGET >> check all
|
|
||||||
Checking: all
|
|
||||||
Index | Name | Installed V. | Latest V. | Update available
|
|
||||||
[1] Vault 1.7.3 1.7.3 False
|
|
||||||
```
|
|
||||||
|
|
||||||
|
@@ -7,4 +7,8 @@ pynacl >= 1.4.0
|
|||||||
cffi >= 1.14.5
|
cffi >= 1.14.5
|
||||||
six >= 1.15.0
|
six >= 1.15.0
|
||||||
pycparser >= 2.20
|
pycparser >= 2.20
|
||||||
pysftp >= 0.2.9
|
pysftp >= 0.2.9
|
||||||
|
rich >= 9.13.0
|
||||||
|
commonmark >= 0.9.1
|
||||||
|
Pygments >= 2.8.1
|
||||||
|
typing_extensions >= 3.7.4.3
|
@@ -1,10 +1,7 @@
|
|||||||
from utils.consoleoutput import consoleTitle, clearConsole, printMainMenu, oColors
|
from utils.consoleoutput import consoleTitle, clearConsole, printMainMenu
|
||||||
from utils.utilities import getHelp, check_requirements
|
from utils.utilities import check_requirements
|
||||||
from handlers.handle_input import createInputLists, getInput
|
from handlers.handle_input import createInputLists, getInput
|
||||||
from handlers.handle_config import checkConfig
|
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():
|
def mainFunction():
|
||||||
|
@@ -58,10 +58,10 @@ def createConfig():
|
|||||||
config['General'] = {}
|
config['General'] = {}
|
||||||
config['General'][';'] = 'If a local plugin folder exists (True/False): (If False SFTP will be used)'
|
config['General'][';'] = 'If a local plugin folder exists (True/False): (If False SFTP will be used)'
|
||||||
config['General']['LocalPluginFolder'] = 'True'
|
config['General']['LocalPluginFolder'] = 'True'
|
||||||
config['General']['PathToPluginFolder'] = 'C:\\Users\\USER\\Desktop\\plugins'
|
config['General']['PathToPluginFolder'] = 'C:/Users/USER/Desktop/plugins'
|
||||||
config['General'][';_'] = 'If you want a different folder to store the updated plugins change to (True/False) and the path below'
|
config['General'][';_'] = 'If you want a different folder to store the updated plugins change to (True/False) and the path below'
|
||||||
config['General']['SeperateDownloadPath'] = 'False'
|
config['General']['SeperateDownloadPath'] = 'False'
|
||||||
config['General']['PathToSeperateDownloadPath'] = 'C:\\Users\\USER\\Desktop\\plugins'
|
config['General']['PathToSeperateDownloadPath'] = 'C:/Users/USER/Desktop/plugins'
|
||||||
|
|
||||||
config['SFTP - Remote Server'] = {}
|
config['SFTP - Remote Server'] = {}
|
||||||
config['SFTP - Remote Server']['Server'] = '0.0.0.0'
|
config['SFTP - Remote Server']['Server'] = '0.0.0.0'
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import sys
|
import sys
|
||||||
|
|
||||||
from utils.consoleoutput import oColors
|
from utils.consoleoutput import oColors
|
||||||
from utils.utilities import getHelp
|
from utils.utilities import getHelp, getCommandHelp
|
||||||
from handlers.handle_config import checkConfig
|
from handlers.handle_config import checkConfig
|
||||||
from plugin.plugin_downloader import searchPackage, getSpecificPackage
|
from plugin.plugin_downloader import searchPackage, getSpecificPackage
|
||||||
from plugin.plugin_updatechecker import updateInstalledPackage, checkInstalledPackage
|
from plugin.plugin_updatechecker import updateInstalledPackage, checkInstalledPackage
|
||||||
@@ -68,7 +68,10 @@ def handleInput(inputCommand, inputSelectedObject, inputParams):
|
|||||||
if inputCommand == 'exit':
|
if inputCommand == 'exit':
|
||||||
sys.exit()
|
sys.exit()
|
||||||
if inputCommand == 'help':
|
if inputCommand == 'help':
|
||||||
getHelp()
|
if inputSelectedObject == 'command' or inputSelectedObject == 'commands':
|
||||||
|
getCommandHelp(inputParams)
|
||||||
|
else:
|
||||||
|
getHelp()
|
||||||
break
|
break
|
||||||
if inputCommand == 'remove':
|
if inputCommand == 'remove':
|
||||||
removePlugin(inputSelectedObject)
|
removePlugin(inputSelectedObject)
|
||||||
@@ -77,7 +80,7 @@ def handleInput(inputCommand, inputSelectedObject, inputParams):
|
|||||||
papermc_downloader(inputSelectedObject, inputParams)
|
papermc_downloader(inputSelectedObject, inputParams)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
print(oColors.brightRed + "Command not found. Please try again." + oColors.standardWhite)
|
print(oColors.brightRed + "Error: Command not found. Please try again. :(" + oColors.standardWhite)
|
||||||
getInput()
|
getInput()
|
||||||
getInput()
|
getInput()
|
||||||
|
|
||||||
@@ -88,7 +91,8 @@ def getInput():
|
|||||||
inputCommand, inputSelectedObject, *inputParams = input("pluGET >> ").split()
|
inputCommand, inputSelectedObject, *inputParams = input("pluGET >> ").split()
|
||||||
break
|
break
|
||||||
except ValueError:
|
except ValueError:
|
||||||
print(oColors.brightRed + "Wrong input! Use: > *command* *selectedObject* *optionalParams*" + oColors.standardWhite)
|
print(oColors.brightRed + "Wrong input! Use: > 'command' 'selectedObject' [optionalParams]" + oColors.standardWhite)
|
||||||
|
print(oColors.brightRed + "Use: '" + oColors.standardWhite +"help command" + oColors.brightRed +"' to get all available commands" + oColors.standardWhite)
|
||||||
|
|
||||||
inputParams = inputParams[0] if inputParams else None
|
inputParams = inputParams[0] if inputParams else None
|
||||||
handleInput(inputCommand, inputSelectedObject, inputParams)
|
handleInput(inputCommand, inputSelectedObject, inputParams)
|
||||||
|
@@ -61,7 +61,7 @@ def searchPackage(ressourceName):
|
|||||||
url = f"https://api.spiget.org/v2/search/resources/{ressourceName}?field=name&sort=-downloads"
|
url = f"https://api.spiget.org/v2/search/resources/{ressourceName}?field=name&sort=-downloads"
|
||||||
packageName = doAPIRequest(url)
|
packageName = doAPIRequest(url)
|
||||||
i = 1
|
i = 1
|
||||||
print(f"Searching: {ressourceName}")
|
print(oColors.brightBlack + f"Searching: {ressourceName}" + oColors.standardWhite)
|
||||||
print("Index | Name | Description | Downloads")
|
print("Index | Name | Description | Downloads")
|
||||||
for ressource in packageName:
|
for ressource in packageName:
|
||||||
pName = ressource["name"]
|
pName = ressource["name"]
|
||||||
|
@@ -1,7 +1,10 @@
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
import io
|
||||||
|
from zipfile import ZipFile
|
||||||
from urllib.error import HTTPError
|
from urllib.error import HTTPError
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from rich.progress import track
|
||||||
|
|
||||||
from utils.consoleoutput import oColors
|
from utils.consoleoutput import oColors
|
||||||
from utils.web_request import doAPIRequest
|
from utils.web_request import doAPIRequest
|
||||||
@@ -38,6 +41,10 @@ def getFileVersion(pluginName):
|
|||||||
pluginVersion = re.search(r'([\d.]+[.jar]+)', pluginNameFull)
|
pluginVersion = re.search(r'([\d.]+[.jar]+)', pluginNameFull)
|
||||||
pluginVersionFull = pluginVersion.group()
|
pluginVersionFull = pluginVersion.group()
|
||||||
pluginVersionString = pluginVersionFull.replace('.jar', '')
|
pluginVersionString = pluginVersionFull.replace('.jar', '')
|
||||||
|
if pluginVersionString.endswith('.'):
|
||||||
|
pluginVersionString = ''
|
||||||
|
if pluginVersionString == '':
|
||||||
|
pluginVersionString = eggCrackingJar(pluginNameFull)
|
||||||
return pluginVersionString
|
return pluginVersionString
|
||||||
|
|
||||||
|
|
||||||
@@ -56,6 +63,28 @@ def compareVersions(plugin_latest_version, pluginVersion):
|
|||||||
return plugin_is_outdated
|
return plugin_is_outdated
|
||||||
|
|
||||||
|
|
||||||
|
def eggCrackingJar(localJarFileName):
|
||||||
|
if not checkConfig().localPluginFolder:
|
||||||
|
pluginPath = checkConfig().sftp_folderPath
|
||||||
|
else:
|
||||||
|
pluginPath = checkConfig().pathToPluginFolder
|
||||||
|
pathToPluginJar = Path(f"{pluginPath}/{localJarFileName}")
|
||||||
|
pluginVersion = ''
|
||||||
|
with ZipFile(pathToPluginJar, 'r') as pluginJar:
|
||||||
|
try:
|
||||||
|
with io.TextIOWrapper(pluginJar.open('plugin.yml', 'r'), encoding="utf-8") as pluginYml:
|
||||||
|
pluginYmlContentLine = pluginYml.readlines()
|
||||||
|
for line in pluginYmlContentLine:
|
||||||
|
if "version: " in line:
|
||||||
|
pluginVersion = line.replace('version: ', '')
|
||||||
|
pluginVersion = pluginVersion.replace('\n', '')
|
||||||
|
break
|
||||||
|
|
||||||
|
except FileNotFoundError:
|
||||||
|
pluginVersion = ''
|
||||||
|
return pluginVersion
|
||||||
|
|
||||||
|
|
||||||
def checkInstalledPackage(inputSelectedObject="all"):
|
def checkInstalledPackage(inputSelectedObject="all"):
|
||||||
createPluginList()
|
createPluginList()
|
||||||
if not checkConfig().localPluginFolder:
|
if not checkConfig().localPluginFolder:
|
||||||
@@ -65,10 +94,12 @@ def checkInstalledPackage(inputSelectedObject="all"):
|
|||||||
pluginList = os.listdir(checkConfig().pathToPluginFolder)
|
pluginList = os.listdir(checkConfig().pathToPluginFolder)
|
||||||
i = 0
|
i = 0
|
||||||
oldPackages = 0
|
oldPackages = 0
|
||||||
print(f"Checking: {inputSelectedObject}")
|
print(oColors.brightBlack + f"Checking: {inputSelectedObject}" + oColors.standardWhite)
|
||||||
print("Index | Name | Installed V. | Latest V. | Update available")
|
print("┌─────┬────────────────────────────────┬──────────────┬───────────┬───────────────────┐")
|
||||||
|
print("│ No. │ Name │ Installed V. │ Latest V. │ Update available │")
|
||||||
|
print("└─────┴────────────────────────────────┴──────────────┴───────────┴───────────────────┘")
|
||||||
try:
|
try:
|
||||||
for plugin in pluginList:
|
for plugin in track(pluginList, description="Checking for updates" ,transient=True, complete_style="cyan"):
|
||||||
try:
|
try:
|
||||||
fileName = getFileName(plugin)
|
fileName = getFileName(plugin)
|
||||||
fileVersion = getFileVersion(plugin)
|
fileVersion = getFileVersion(plugin)
|
||||||
@@ -77,10 +108,8 @@ def checkInstalledPackage(inputSelectedObject="all"):
|
|||||||
i += 1
|
i += 1
|
||||||
continue
|
continue
|
||||||
pluginIdStr = str(pluginId)
|
pluginIdStr = str(pluginId)
|
||||||
|
|
||||||
if fileVersion == '':
|
if fileVersion == '':
|
||||||
fileVersion = 'N/A'
|
fileVersion = 'N/A'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
pluginLatestVersion = INSTALLEDPLUGINLIST[i][2]
|
pluginLatestVersion = INSTALLEDPLUGINLIST[i][2]
|
||||||
except IndexError:
|
except IndexError:
|
||||||
@@ -99,25 +128,31 @@ def checkInstalledPackage(inputSelectedObject="all"):
|
|||||||
|
|
||||||
if pluginIsOutdated == True:
|
if pluginIsOutdated == True:
|
||||||
oldPackages = oldPackages + 1
|
oldPackages = oldPackages + 1
|
||||||
|
|
||||||
if inputSelectedObject != "*" and inputSelectedObject != "all":
|
if inputSelectedObject != "*" and inputSelectedObject != "all":
|
||||||
if inputSelectedObject == pluginIdStr or re.search(inputSelectedObject, fileName, re.IGNORECASE):
|
if inputSelectedObject == pluginIdStr or re.search(inputSelectedObject, fileName, re.IGNORECASE):
|
||||||
print(f" [{1}]".ljust(8), end='')
|
if pluginLatestVersion == 'N/A':
|
||||||
|
print(oColors.brightBlack + f" [{1}]".ljust(8), end='')
|
||||||
|
else:
|
||||||
|
print(f" [{1}]".ljust(8), end='')
|
||||||
print(f"{fileName}".ljust(33), end='')
|
print(f"{fileName}".ljust(33), end='')
|
||||||
print(f"{fileVersion}".ljust(15), end='')
|
print(f"{fileVersion}".ljust(15), end='')
|
||||||
print(f"{pluginLatestVersion}".ljust(12), end='')
|
print(f"{pluginLatestVersion}".ljust(12), end='')
|
||||||
print(f" {pluginIsOutdated}".ljust(5))
|
print(f" {pluginIsOutdated}".ljust(5) + oColors.standardWhite)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
print(f" [{i+1}]".ljust(8), end='')
|
if pluginLatestVersion == 'N/A':
|
||||||
|
print(oColors.brightBlack + f" [{i+1}]".ljust(8), end='')
|
||||||
|
else:
|
||||||
|
print(f" [{i+1}]".ljust(8), end='')
|
||||||
print(f"{fileName}".ljust(33), end='')
|
print(f"{fileName}".ljust(33), end='')
|
||||||
print(f"{fileVersion}".ljust(15), end='')
|
print(f"{fileVersion}".ljust(15), end='')
|
||||||
print(f"{pluginLatestVersion}".ljust(12), end='')
|
print(f"{pluginLatestVersion}".ljust(12), end='')
|
||||||
print(f" {pluginIsOutdated}".ljust(5))
|
print(f" {pluginIsOutdated}".ljust(5) + oColors.standardWhite)
|
||||||
|
|
||||||
i += 1
|
i += 1
|
||||||
except TypeError:
|
except TypeError:
|
||||||
print(oColors.brightRed + "Aborted checking for plugins." + oColors.standardWhite)
|
print(oColors.brightRed + "Error occured: Aborted checking for updates." + oColors.standardWhite)
|
||||||
print(oColors.brightYellow + f"Old packages: [{oldPackages}/{i}]" + oColors.standardWhite)
|
print(oColors.brightYellow + f"Old packages: [{oldPackages}/{i}]" + oColors.standardWhite)
|
||||||
|
|
||||||
|
|
||||||
@@ -131,10 +166,12 @@ def updateInstalledPackage(inputSelectedObject='all'):
|
|||||||
i = 0
|
i = 0
|
||||||
pluginsUpdated = 0
|
pluginsUpdated = 0
|
||||||
indexNumberUpdated = 0
|
indexNumberUpdated = 0
|
||||||
print(f"Updating: {inputSelectedObject}")
|
print(oColors.brightBlack + f"Updating: {inputSelectedObject}" + oColors.standardWhite)
|
||||||
print("Index | Name | Old V. | New V.")
|
print("┌─────┬────────────────────────────────┬────────────┬──────────┐")
|
||||||
|
print("│ No. │ Name │ Old V. │ New V. │")
|
||||||
|
print("└─────┴────────────────────────────────┴────────────┴──────────┘")
|
||||||
try:
|
try:
|
||||||
for plugin in pluginList:
|
for plugin in track(pluginList, description="Updating" ,transient=True, complete_style="red"):
|
||||||
try:
|
try:
|
||||||
fileName = getFileName(plugin)
|
fileName = getFileName(plugin)
|
||||||
fileVersion = getFileVersion(plugin)
|
fileVersion = getFileVersion(plugin)
|
||||||
@@ -147,21 +184,19 @@ def updateInstalledPackage(inputSelectedObject='all'):
|
|||||||
i += 1
|
i += 1
|
||||||
continue
|
continue
|
||||||
pluginIdStr = str(pluginId)
|
pluginIdStr = str(pluginId)
|
||||||
|
if pluginId == None or pluginId == '':
|
||||||
if pluginId == None:
|
|
||||||
print(oColors.brightRed + "Couldn't find plugin id. Sorry :(" + oColors.standardWhite)
|
print(oColors.brightRed + "Couldn't find plugin id. Sorry :(" + oColors.standardWhite)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if inputSelectedObject == pluginIdStr or re.search(inputSelectedObject, fileName, re.IGNORECASE):
|
if inputSelectedObject == pluginIdStr or re.search(inputSelectedObject, fileName, re.IGNORECASE):
|
||||||
if INSTALLEDPLUGINLIST[i][3] == True:
|
if INSTALLEDPLUGINLIST[i][3] == True:
|
||||||
print(f" [{indexNumberUpdated+1}]".ljust(8), end='')
|
print(f" [{indexNumberUpdated+1}]".ljust(8), end='')
|
||||||
print(f"{fileName}".ljust(30), end='')
|
print(f"{fileName}".ljust(33), end='')
|
||||||
print(f"{fileVersion}".ljust(8), end='')
|
print(f"{fileVersion}".ljust(8), end='')
|
||||||
print(" ", end='')
|
print(" ", end='')
|
||||||
print(f"{latestVersion}".ljust(8))
|
print(f"{latestVersion}".ljust(8))
|
||||||
|
|
||||||
if not checkConfig().localPluginFolder:
|
if not checkConfig().localPluginFolder:
|
||||||
if checkConfig().sftp_pathToSeperateDownloadPath is True:
|
if checkConfig().sftp_seperateDownloadPath is True:
|
||||||
pluginPath = checkConfig().sftp_pathToSeperateDownloadPath
|
pluginPath = checkConfig().sftp_pathToSeperateDownloadPath
|
||||||
else:
|
else:
|
||||||
pluginPath = checkConfig().sftp_folderPath
|
pluginPath = checkConfig().sftp_folderPath
|
||||||
@@ -204,7 +239,7 @@ def updateInstalledPackage(inputSelectedObject='all'):
|
|||||||
if inputSelectedObject == 'all':
|
if inputSelectedObject == 'all':
|
||||||
if INSTALLEDPLUGINLIST[i][3] == True:
|
if INSTALLEDPLUGINLIST[i][3] == True:
|
||||||
print(f" [{indexNumberUpdated+1}]".ljust(8), end='')
|
print(f" [{indexNumberUpdated+1}]".ljust(8), end='')
|
||||||
print(f"{fileName}".ljust(30), end='')
|
print(f"{fileName}".ljust(33), end='')
|
||||||
print(f"{fileVersion}".ljust(8), end='')
|
print(f"{fileVersion}".ljust(8), end='')
|
||||||
print(" ", end='')
|
print(" ", end='')
|
||||||
print(f"{latestVersion}".ljust(8))
|
print(f"{latestVersion}".ljust(8))
|
||||||
@@ -214,7 +249,6 @@ def updateInstalledPackage(inputSelectedObject='all'):
|
|||||||
pluginPath = checkConfig().sftp_pathToSeperateDownloadPath
|
pluginPath = checkConfig().sftp_pathToSeperateDownloadPath
|
||||||
else:
|
else:
|
||||||
pluginPath = checkConfig().sftp_folderPath
|
pluginPath = checkConfig().sftp_folderPath
|
||||||
pluginPath = checkConfig().sftp_folderPath
|
|
||||||
pluginPath = f"{pluginPath}/{plugin}"
|
pluginPath = f"{pluginPath}/{plugin}"
|
||||||
sftp = createSFTPConnection()
|
sftp = createSFTPConnection()
|
||||||
indexNumberUpdated += 1
|
indexNumberUpdated += 1
|
||||||
@@ -249,10 +283,10 @@ def updateInstalledPackage(inputSelectedObject='all'):
|
|||||||
|
|
||||||
i = i + 1
|
i = i + 1
|
||||||
except TypeError:
|
except TypeError:
|
||||||
print(oColors.brightRed + "Aborted updating for plugins." + oColors.standardWhite)
|
print(oColors.brightRed + "Error occured: Aborted updating for plugins." + oColors.standardWhite)
|
||||||
print(f"[{pluginsUpdated}/{i}] Plugins updated")
|
print(oColors.brightYellow + f"[{pluginsUpdated}/{i}] Plugins updated" + oColors.standardWhite)
|
||||||
if inputSelectedObject =='all' and pluginsUpdated == 0:
|
if inputSelectedObject =='all' and pluginsUpdated == 0:
|
||||||
print(oColors.brightGreen + "All plugins are on the latest version!" + oColors.standardWhite)
|
print(oColors.brightGreen + "All found plugins are on the latest version!" + oColors.standardWhite)
|
||||||
|
|
||||||
|
|
||||||
def getInstalledPlugin(localFileName, localFileVersion):
|
def getInstalledPlugin(localFileName, localFileVersion):
|
||||||
|
@@ -13,11 +13,11 @@ def clearConsole():
|
|||||||
# https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
|
# https://docs.microsoft.com/en-us/windows/console/console-virtual-terminal-sequences
|
||||||
class oColors:
|
class oColors:
|
||||||
standardWhite = "\033[0m"
|
standardWhite = "\033[0m"
|
||||||
brightYellow = "\033[93m"
|
brightBlack = "\033[90m"
|
||||||
brightMagenta = "\033[95m"
|
|
||||||
brightRed = "\033[91m"
|
brightRed = "\033[91m"
|
||||||
brightGreen = "\033[92m"
|
brightGreen = "\033[92m"
|
||||||
darkMagenta = "\033[35m"
|
brightYellow = "\033[93m"
|
||||||
|
brightMagenta = "\033[95m"
|
||||||
|
|
||||||
|
|
||||||
def printLogo():
|
def printLogo():
|
||||||
@@ -72,9 +72,12 @@ def printLogo():
|
|||||||
oColors.standardWhite)
|
oColors.standardWhite)
|
||||||
print()
|
print()
|
||||||
print()
|
print()
|
||||||
print(oColors.brightYellow + " [" + oColors.darkMagenta + "By Neocky" +
|
print(oColors.brightBlack + " ┌────────────────────────────────────┐" + oColors.standardWhite)
|
||||||
oColors.brightYellow + "] " + oColors.standardWhite)
|
print(oColors.brightBlack + " │ [" + oColors.brightMagenta + "By Neocky" +oColors.brightBlack +
|
||||||
print()
|
"] │ " + oColors.standardWhite)
|
||||||
|
print(oColors.brightBlack + " │ " + oColors.brightMagenta + "https://github.com/Neocky/pluGET" + oColors.brightBlack +
|
||||||
|
" │ " + oColors.standardWhite)
|
||||||
|
print(oColors.brightBlack + " └────────────────────────────────────┘" + oColors.standardWhite)
|
||||||
|
|
||||||
|
|
||||||
def printHorizontalLine():
|
def printHorizontalLine():
|
||||||
|
@@ -12,12 +12,88 @@ from handlers.handle_sftp import createSFTPConnection
|
|||||||
|
|
||||||
def getHelp():
|
def getHelp():
|
||||||
print(oColors.brightYellow+ "Need help?" + oColors.standardWhite)
|
print(oColors.brightYellow+ "Need help?" + oColors.standardWhite)
|
||||||
print("Check the docs here:")
|
print("For a list of all commands: 'help command'")
|
||||||
|
print("Or check the docs here:")
|
||||||
print("https://github.com/Neocky/pluGET")
|
print("https://github.com/Neocky/pluGET")
|
||||||
print("Or go to the official discord.")
|
print("Or go to the official discord.")
|
||||||
print("The link for discord can also be found on Github!")
|
print("The link for discord can also be found on Github!")
|
||||||
|
|
||||||
|
|
||||||
|
def getCommandHelp(optionalParams):
|
||||||
|
if optionalParams == None:
|
||||||
|
optionalParams = 'all'
|
||||||
|
print(oColors.brightBlack + f"Help for command: {optionalParams}" +oColors.standardWhite)
|
||||||
|
print("┌────────────────┬─────────────────┬─────────────────┬────────────────────────────────────────────────────────┐")
|
||||||
|
print("│ Command │ Selected Object │ Optional Params │ Function │")
|
||||||
|
print("└────────────────┴─────────────────┴─────────────────┴────────────────────────────────────────────────────────┘")
|
||||||
|
while True:
|
||||||
|
if optionalParams == 'all':
|
||||||
|
print(oColors.brightBlack + " GENERAL:" + oColors.standardWhite)
|
||||||
|
print(" exit ./anything Exit pluGET")
|
||||||
|
print(" help ./anything Get general help")
|
||||||
|
print(" help command all/command Get specific help to the commands of pluGET")
|
||||||
|
print(oColors.brightBlack + " PLUGIN MANAGEMENT:" + oColors.standardWhite)
|
||||||
|
print(" get Name/ID Version Downloads the latest version of a plugin")
|
||||||
|
print(" check Name/ID/all Check for an update of an installed plugin")
|
||||||
|
print(" update Name/ID/all Update installed plugins to the latest version")
|
||||||
|
print(" search Name Search for a plugin and download the latest version")
|
||||||
|
print(" remove Name/ID Delete an installed plugin")
|
||||||
|
print(oColors.brightBlack + " SERVER SOFTWARE MANAGEMENT:" + oColors.standardWhite)
|
||||||
|
print(" check serverjar Check installed server software for an update")
|
||||||
|
print(" update serverjar Version/Latest Update installed server software to a specific version")
|
||||||
|
print(" get-paper PaperVersion McVersion Downloads a specific PaperMc version")
|
||||||
|
break
|
||||||
|
|
||||||
|
if optionalParams == 'exit':
|
||||||
|
print(oColors.brightBlack + " GENERAL:" + oColors.standardWhite)
|
||||||
|
print(" exit ./anything Exit pluGET")
|
||||||
|
break
|
||||||
|
|
||||||
|
if optionalParams == 'help':
|
||||||
|
print(oColors.brightBlack + " GENERAL:" + oColors.standardWhite)
|
||||||
|
print(" help ./anything Get general help")
|
||||||
|
print(" help command all/command Get specific help to the commands of pluGET")
|
||||||
|
break
|
||||||
|
|
||||||
|
if optionalParams == 'get':
|
||||||
|
print(oColors.brightBlack + " PLUGIN MANAGEMENT:" + oColors.standardWhite)
|
||||||
|
print(print(" get Name/ID Version Downloads the latest version of a plugin"))
|
||||||
|
break
|
||||||
|
|
||||||
|
if optionalParams == 'check':
|
||||||
|
print(oColors.brightBlack + " PLUGIN MANAGEMENT:" + oColors.standardWhite)
|
||||||
|
print(" check Name/ID/all Check for an update of an installed plugin")
|
||||||
|
print(oColors.brightBlack + " SERVER SOFTWARE MANAGEMENT:" + oColors.standardWhite)
|
||||||
|
print(" check serverjar Check installed server software for an update")
|
||||||
|
break
|
||||||
|
|
||||||
|
if optionalParams == 'update':
|
||||||
|
print(oColors.brightBlack + " PLUGIN MANAGEMENT:" + oColors.standardWhite)
|
||||||
|
print(" update Name/ID/all Update installed plugins to the latest version")
|
||||||
|
print(oColors.brightBlack + " SERVER SOFTWARE MANAGEMENT:" + oColors.standardWhite)
|
||||||
|
print(" update serverjar Version/Latest Update installed server software to a specific version")
|
||||||
|
break
|
||||||
|
|
||||||
|
if optionalParams == 'search':
|
||||||
|
print(oColors.brightBlack + " PLUGIN MANAGEMENT:" + oColors.standardWhite)
|
||||||
|
print(" search Name Search for a plugin and download the latest version")
|
||||||
|
break
|
||||||
|
|
||||||
|
if optionalParams == 'remove':
|
||||||
|
print(oColors.brightBlack + " PLUGIN MANAGEMENT:" + oColors.standardWhite)
|
||||||
|
print(" remove Name/ID Delete an installed plugin")
|
||||||
|
break
|
||||||
|
|
||||||
|
if optionalParams == 'get-paper':
|
||||||
|
print(oColors.brightBlack + " SERVER SOFTWARE MANAGEMENT:" + oColors.standardWhite)
|
||||||
|
print(" get-paper PaperVersion McVersion Downloads a specific PaperMc version")
|
||||||
|
break
|
||||||
|
|
||||||
|
else:
|
||||||
|
print(oColors.brightRed + "Error: Help for Command not found. Please try again. :(" + oColors.standardWhite)
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
def check_local_plugin_folder():
|
def check_local_plugin_folder():
|
||||||
if checkConfig().localPluginFolder:
|
if checkConfig().localPluginFolder:
|
||||||
if checkConfig().seperateDownloadPath:
|
if checkConfig().seperateDownloadPath:
|
||||||
|
Reference in New Issue
Block a user