mirror of
https://github.com/Neocky/pluGET.git
synced 2024-04-29 16:12:30 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
50038c4474 | ||
![]() |
2eb4940574 | ||
![]() |
496334a2fa | ||
![]() |
42be836928 |
@@ -103,7 +103,7 @@ Execute the `installer.bat` file to automaticcally install the needed packages f
|
|||||||
> This is a normal behaviour from the windows defender because this is a unknown `.bat` file.
|
> This is a normal behaviour from the windows defender because this is a unknown `.bat` file.
|
||||||
> To run the `installer.bat` anyway, click `More Info` and then `Run anyway` when the message pops up.
|
> To run the `installer.bat` anyway, click `More Info` and then `Run anyway` when the message pops up.
|
||||||
|
|
||||||
##### Manually
|
#### Manually
|
||||||
Execute this command in the `\plugGET` folder:
|
Execute this command in the `\plugGET` folder:
|
||||||
```python
|
```python
|
||||||
py -m pip install -r requirements.txt
|
py -m pip install -r requirements.txt
|
||||||
|
@@ -29,8 +29,12 @@ def ftp_showPlugins(ftp):
|
|||||||
|
|
||||||
def ftp_upload_file(ftp, itemPath):
|
def ftp_upload_file(ftp, itemPath):
|
||||||
configValues = configurationValues()
|
configValues = configurationValues()
|
||||||
|
if configValues.sftp_seperateDownloadPath is True:
|
||||||
|
uploadFolderPath = configValues.sftp_pathToSeperateDownloadPath
|
||||||
|
else:
|
||||||
|
uploadFolderPath = configValues.sftp_folderPath
|
||||||
try:
|
try:
|
||||||
ftp.cwd(configValues.sftp_folderPath)
|
ftp.cwd(uploadFolderPath)
|
||||||
itemPath = os.path.relpath(itemPath, 'TempSFTPFolder/')
|
itemPath = os.path.relpath(itemPath, 'TempSFTPFolder/')
|
||||||
itemPath = str(itemPath)
|
itemPath = str(itemPath)
|
||||||
currentDirectory = os.getcwd()
|
currentDirectory = os.getcwd()
|
||||||
@@ -46,7 +50,6 @@ def ftp_upload_file(ftp, itemPath):
|
|||||||
|
|
||||||
def ftp_upload_server_jar(ftp, itemPath):
|
def ftp_upload_server_jar(ftp, itemPath):
|
||||||
try:
|
try:
|
||||||
print(f"itempath: {itemPath}")
|
|
||||||
ftp.cwd('.')
|
ftp.cwd('.')
|
||||||
itemPath = os.path.relpath(itemPath, 'TempSFTPFolder/')
|
itemPath = os.path.relpath(itemPath, 'TempSFTPFolder/')
|
||||||
itemPath = str(itemPath)
|
itemPath = str(itemPath)
|
||||||
|
@@ -37,8 +37,12 @@ def sftp_showPlugins(sftp):
|
|||||||
|
|
||||||
def sftp_upload_file(sftp, itemPath):
|
def sftp_upload_file(sftp, itemPath):
|
||||||
configValues = configurationValues()
|
configValues = configurationValues()
|
||||||
|
if configValues.sftp_seperateDownloadPath is True:
|
||||||
|
uploadFolderPath = configValues.sftp_pathToSeperateDownloadPath
|
||||||
|
else:
|
||||||
|
uploadFolderPath = configValues.sftp_folderPath
|
||||||
try:
|
try:
|
||||||
sftp.chdir(configValues.sftp_folderPath)
|
sftp.chdir(uploadFolderPath)
|
||||||
sftp.put(itemPath)
|
sftp.put(itemPath)
|
||||||
|
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
|
@@ -78,19 +78,17 @@ def searchPackage(ressourceName):
|
|||||||
ressourceSelected = ressourceSelected - 1
|
ressourceSelected = ressourceSelected - 1
|
||||||
ressourceId = packageName[ressourceSelected]["id"]
|
ressourceId = packageName[ressourceSelected]["id"]
|
||||||
if not configValues.localPluginFolder:
|
if not configValues.localPluginFolder:
|
||||||
try:
|
|
||||||
if configValues.sftp_seperateDownloadPath is True:
|
if configValues.sftp_seperateDownloadPath is True:
|
||||||
getSpecificPackage(ressourceId, configValues.sftp_pathToSeperateDownloadPath)
|
pluginDownloadPath = configValues.sftp_pathToSeperateDownloadPath
|
||||||
else:
|
else:
|
||||||
getSpecificPackage(ressourceId, configValues.sftp_folderPath)
|
pluginDownloadPath = configValues.sftp_folderPath
|
||||||
except HTTPError as err:
|
|
||||||
print(oColors.brightRed + f"Error: {err.code} - {err.reason}" + oColors.standardWhite)
|
|
||||||
else:
|
else:
|
||||||
try:
|
|
||||||
if configValues.seperateDownloadPath is True:
|
if configValues.seperateDownloadPath is True:
|
||||||
getSpecificPackage(ressourceId, configValues.pathToPluginFolder)
|
pluginDownloadPath = configValues.pathToSeperateDownloadPath
|
||||||
else:
|
else:
|
||||||
getSpecificPackage(ressourceId, configValues.pathToSeperateDownloadPath)
|
pluginDownloadPath = configValues.pathToPluginFolder
|
||||||
|
try:
|
||||||
|
getSpecificPackage(ressourceId, pluginDownloadPath)
|
||||||
except HTTPError as err:
|
except HTTPError as err:
|
||||||
print(oColors.brightRed + f"Error: {err.code} - {err.reason}" + oColors.standardWhite)
|
print(oColors.brightRed + f"Error: {err.code} - {err.reason}" + oColors.standardWhite)
|
||||||
|
|
||||||
|
@@ -86,13 +86,12 @@ def compareVersions(plugin_latest_version, pluginVersion):
|
|||||||
def eggCrackingJar(localJarFileName, searchMode):
|
def eggCrackingJar(localJarFileName, searchMode):
|
||||||
configValues = configurationValues()
|
configValues = configurationValues()
|
||||||
if not configValues.localPluginFolder:
|
if not configValues.localPluginFolder:
|
||||||
if configValues.sftp_useSftp:
|
|
||||||
tempPluginFolderPath = createTempPluginFolder()
|
tempPluginFolderPath = createTempPluginFolder()
|
||||||
|
if configValues.sftp_useSftp:
|
||||||
sftp = createSFTPConnection()
|
sftp = createSFTPConnection()
|
||||||
pathToPluginJar = Path(f"{tempPluginFolderPath}/{localJarFileName}")
|
pathToPluginJar = Path(f"{tempPluginFolderPath}/{localJarFileName}")
|
||||||
sftp_downloadFile(sftp, pathToPluginJar, localJarFileName)
|
sftp_downloadFile(sftp, pathToPluginJar, localJarFileName)
|
||||||
else:
|
else:
|
||||||
tempPluginFolderPath = createTempPluginFolder()
|
|
||||||
ftp = createFTPConnection()
|
ftp = createFTPConnection()
|
||||||
pathToPluginJar = Path(f"{tempPluginFolderPath}/{localJarFileName}")
|
pathToPluginJar = Path(f"{tempPluginFolderPath}/{localJarFileName}")
|
||||||
ftp_downloadFile(ftp, pathToPluginJar, localJarFileName)
|
ftp_downloadFile(ftp, pathToPluginJar, localJarFileName)
|
||||||
@@ -155,11 +154,7 @@ def checkInstalledPackage(inputSelectedObject="all", inputOptionalParam=None):
|
|||||||
try:
|
try:
|
||||||
for plugin in track(pluginList, description="Checking for updates" ,transient=True, complete_style="bright_yellow"):
|
for plugin in track(pluginList, description="Checking for updates" ,transient=True, complete_style="bright_yellow"):
|
||||||
if not configValues.localPluginFolder:
|
if not configValues.localPluginFolder:
|
||||||
if configValues.sftp_seperateDownloadPath is True:
|
|
||||||
pluginFile = f"{configValues.sftp_pathToSeperateDownloadPath}/{plugin}"
|
|
||||||
else:
|
|
||||||
pluginFile = f"{configValues.sftp_folderPath}/{plugin}"
|
pluginFile = f"{configValues.sftp_folderPath}/{plugin}"
|
||||||
|
|
||||||
if configValues.sftp_useSftp:
|
if configValues.sftp_useSftp:
|
||||||
pluginAttributes = sftp_validateFileAttributes(connection, pluginFile)
|
pluginAttributes = sftp_validateFileAttributes(connection, pluginFile)
|
||||||
if pluginAttributes == False:
|
if pluginAttributes == False:
|
||||||
@@ -290,11 +285,7 @@ def updateInstalledPackage(inputSelectedObject='all'):
|
|||||||
for pluginArray in track(INSTALLEDPLUGINLIST, description="Updating" ,transient=True, complete_style="bright_magenta", ):
|
for pluginArray in track(INSTALLEDPLUGINLIST, description="Updating" ,transient=True, complete_style="bright_magenta", ):
|
||||||
plugin = INSTALLEDPLUGINLIST[i][0]
|
plugin = INSTALLEDPLUGINLIST[i][0]
|
||||||
if not configValues.localPluginFolder:
|
if not configValues.localPluginFolder:
|
||||||
if configValues.sftp_seperateDownloadPath is True:
|
|
||||||
pluginFile = f"{configValues.sftp_pathToSeperateDownloadPath}/{plugin}"
|
|
||||||
else:
|
|
||||||
pluginFile = f"{configValues.sftp_folderPath}/{plugin}"
|
pluginFile = f"{configValues.sftp_folderPath}/{plugin}"
|
||||||
|
|
||||||
if configValues.sftp_useSftp:
|
if configValues.sftp_useSftp:
|
||||||
pluginAttributes = sftp_validateFileAttributes(connection, pluginFile)
|
pluginAttributes = sftp_validateFileAttributes(connection, pluginFile)
|
||||||
if pluginAttributes == False:
|
if pluginAttributes == False:
|
||||||
@@ -339,17 +330,17 @@ def updateInstalledPackage(inputSelectedObject='all'):
|
|||||||
print(f"{fileVersion}".ljust(13), end='')
|
print(f"{fileVersion}".ljust(13), end='')
|
||||||
print(f"{latestVersion}".ljust(13))
|
print(f"{latestVersion}".ljust(13))
|
||||||
if not configValues.localPluginFolder:
|
if not configValues.localPluginFolder:
|
||||||
if configValues.sftp_useSftp:
|
|
||||||
if configValues.sftp_seperateDownloadPath is True:
|
if configValues.sftp_seperateDownloadPath is True:
|
||||||
pluginPath = configValues.sftp_pathToSeperateDownloadPath
|
pluginPath = configValues.sftp_pathToSeperateDownloadPath
|
||||||
else:
|
else:
|
||||||
pluginPath = configValues.sftp_folderPath
|
pluginPath = configValues.sftp_folderPath
|
||||||
pluginPath = f"{pluginPath}/{plugin}"
|
pluginPath = f"{pluginPath}/{plugin}"
|
||||||
sftp = createSFTPConnection()
|
|
||||||
indexNumberUpdated += 1
|
indexNumberUpdated += 1
|
||||||
pluginsUpdated += 1
|
pluginsUpdated += 1
|
||||||
|
if configValues.sftp_useSftp:
|
||||||
|
sftp = createSFTPConnection()
|
||||||
try:
|
try:
|
||||||
getSpecificPackage(pluginId, configValues.sftp_folderPath)
|
getSpecificPackage(pluginId, pluginPath)
|
||||||
if configValues.sftp_seperateDownloadPath is False:
|
if configValues.sftp_seperateDownloadPath is False:
|
||||||
sftp.remove(pluginPath)
|
sftp.remove(pluginPath)
|
||||||
except HTTPError as err:
|
except HTTPError as err:
|
||||||
@@ -357,17 +348,11 @@ def updateInstalledPackage(inputSelectedObject='all'):
|
|||||||
pluginsUpdated -= 1
|
pluginsUpdated -= 1
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
print(oColors.brightRed + f"FileNotFoundError: Old plugin file coulnd't be deleted" + oColors.standardWhite)
|
print(oColors.brightRed + f"FileNotFoundError: Old plugin file coulnd't be deleted" + oColors.standardWhite)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
if configValues.sftp_seperateDownloadPath is True:
|
|
||||||
pluginPath = configValues.sftp_pathToSeperateDownloadPath
|
|
||||||
else:
|
|
||||||
pluginPath = configValues.sftp_folderPath
|
|
||||||
pluginPath = f"{pluginPath}/{plugin}"
|
|
||||||
ftp = createFTPConnection()
|
ftp = createFTPConnection()
|
||||||
indexNumberUpdated += 1
|
|
||||||
pluginsUpdated += 1
|
|
||||||
try:
|
try:
|
||||||
getSpecificPackage(pluginId, configValues.sftp_folderPath)
|
getSpecificPackage(pluginId, pluginPath)
|
||||||
if configValues.sftp_seperateDownloadPath is False:
|
if configValues.sftp_seperateDownloadPath is False:
|
||||||
ftp.delete(pluginPath)
|
ftp.delete(pluginPath)
|
||||||
except HTTPError as err:
|
except HTTPError as err:
|
||||||
@@ -380,12 +365,11 @@ def updateInstalledPackage(inputSelectedObject='all'):
|
|||||||
if configValues.seperateDownloadPath is True:
|
if configValues.seperateDownloadPath is True:
|
||||||
pluginPath = configValues.pathToSeperateDownloadPath
|
pluginPath = configValues.pathToSeperateDownloadPath
|
||||||
else:
|
else:
|
||||||
pluginPath = pluginFolderPath
|
pluginPath = configValues.pathToPluginFolder
|
||||||
pluginPath = Path(f"{pluginPath}/{plugin}")
|
|
||||||
indexNumberUpdated += 1
|
indexNumberUpdated += 1
|
||||||
pluginsUpdated += 1
|
pluginsUpdated += 1
|
||||||
try:
|
try:
|
||||||
getSpecificPackage(pluginId, pluginFolderPath)
|
getSpecificPackage(pluginId, pluginPath)
|
||||||
if configValues.seperateDownloadPath is False:
|
if configValues.seperateDownloadPath is False:
|
||||||
os.remove(pluginPath)
|
os.remove(pluginPath)
|
||||||
except HTTPError as err:
|
except HTTPError as err:
|
||||||
|
Reference in New Issue
Block a user