mirror of
https://github.com/Neocky/pluGET.git
synced 2024-04-29 16:12:30 +00:00
Fixed bug when plugin wasn't found with description
This commit is contained in:
parent
41527926b2
commit
f4361ad137
@ -1,8 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import io
|
import io
|
||||||
import stat
|
|
||||||
import pysftp
|
|
||||||
import base64
|
import base64
|
||||||
from zipfile import ZipFile
|
from zipfile import ZipFile
|
||||||
from urllib.error import HTTPError
|
from urllib.error import HTTPError
|
||||||
@ -86,6 +84,7 @@ def eggCrackingJar(localJarFileName, searchMode):
|
|||||||
pathToPluginJar = Path(f"{pluginPath}/{localJarFileName}")
|
pathToPluginJar = Path(f"{pluginPath}/{localJarFileName}")
|
||||||
pluginVersion = ''
|
pluginVersion = ''
|
||||||
pluginName = ''
|
pluginName = ''
|
||||||
|
print(localJarFileName)
|
||||||
with ZipFile(pathToPluginJar, 'r') as pluginJar:
|
with ZipFile(pathToPluginJar, 'r') as pluginJar:
|
||||||
try:
|
try:
|
||||||
with io.TextIOWrapper(pluginJar.open('plugin.yml', 'r'), encoding="utf-8") as pluginYml:
|
with io.TextIOWrapper(pluginJar.open('plugin.yml', 'r'), encoding="utf-8") as pluginYml:
|
||||||
@ -117,6 +116,7 @@ def eggCrackingJar(localJarFileName, searchMode):
|
|||||||
|
|
||||||
def getUpdateDescription(pluginId):
|
def getUpdateDescription(pluginId):
|
||||||
url = f"https://api.spiget.org/v2/resources/{pluginId}/updates?size=1&sort=-date"
|
url = f"https://api.spiget.org/v2/resources/{pluginId}/updates?size=1&sort=-date"
|
||||||
|
print(url)
|
||||||
latestDescriptionSearch = doAPIRequest(url)
|
latestDescriptionSearch = doAPIRequest(url)
|
||||||
versionLatestDescription = latestDescriptionSearch[0]["description"]
|
versionLatestDescription = latestDescriptionSearch[0]["description"]
|
||||||
versionLatestDescription = base64.b64decode(versionLatestDescription)
|
versionLatestDescription = base64.b64decode(versionLatestDescription)
|
||||||
@ -228,8 +228,10 @@ def checkInstalledPackage(inputSelectedObject="all"):
|
|||||||
print(f"{fileVersion}".ljust(15), end='')
|
print(f"{fileVersion}".ljust(15), end='')
|
||||||
print(f"{pluginLatestVersion}".ljust(15), end='')
|
print(f"{pluginLatestVersion}".ljust(15), end='')
|
||||||
print(f"{pluginIsOutdated}".ljust(5) + oColors.standardWhite)
|
print(f"{pluginIsOutdated}".ljust(5) + oColors.standardWhite)
|
||||||
description = getUpdateDescription(pluginId)
|
if (pluginLatestVersion != 'N/A'):
|
||||||
print(description)
|
print(oColors.brightYellow + "CHANGELOG:" + oColors.standardWhite)
|
||||||
|
description = getUpdateDescription(pluginId)
|
||||||
|
print(description)
|
||||||
|
|
||||||
i += 1
|
i += 1
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
Loading…
Reference in New Issue
Block a user