2021-03-03 16:13:43 +00:00
|
|
|
import time
|
2021-03-08 01:56:00 +00:00
|
|
|
import sys
|
|
|
|
from consoleoutput import consoleTitle, clearConsole, printMainMenu, oColors
|
|
|
|
from plugin_downloader import downloadPackageManual, apiCallTest, searchPackage, getPackageVersion
|
|
|
|
from plugin_updatechecker import updateInstalledPackage, checkInstalledPackage
|
|
|
|
|
|
|
|
|
|
|
|
def createInputLists():
|
|
|
|
global COMMANDLIST
|
|
|
|
COMMANDLIST = [
|
|
|
|
'get',
|
|
|
|
'update',
|
|
|
|
'check',
|
|
|
|
'exit'
|
|
|
|
]
|
|
|
|
global INPUTSELECTEDOBJECT
|
|
|
|
INPUTSELECTEDOBJECT = [
|
|
|
|
'all',
|
|
|
|
'*'
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
def handleInput(inputCommand, inputSelectedObject, inputParams):
|
|
|
|
while True:
|
|
|
|
if inputCommand == 'get':
|
|
|
|
getPackageVersion(r"C:\\Users\USER\Desktop\\", inputSelectedObject, inputParams)
|
|
|
|
break
|
|
|
|
if inputCommand == 'update':
|
|
|
|
#if inputSelectedObject in INPUTSELECTEDOBJECT:
|
|
|
|
updateInstalledPackage(r'C:\\Users\\USER\\Desktop\\plugins', inputSelectedObject)
|
|
|
|
break
|
|
|
|
if inputCommand == 'check':
|
|
|
|
checkInstalledPackage(r'C:\\Users\\USER\\Desktop\\plugins', inputSelectedObject)
|
|
|
|
break
|
|
|
|
if inputCommand == 'exit':
|
|
|
|
sys.exit()
|
|
|
|
else:
|
|
|
|
print(oColors.brightRed + "Command not found. Please try again." + oColors.standardWhite)
|
|
|
|
getInput()
|
|
|
|
getInput()
|
2021-03-07 00:49:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
def getInput():
|
2021-03-08 01:56:00 +00:00
|
|
|
while True:
|
|
|
|
try:
|
|
|
|
inputCommand, inputSelectedObject, *inputParams = input("pluGET >> ").split()
|
|
|
|
break
|
|
|
|
except ValueError:
|
|
|
|
print(oColors.brightRed + "Wrong input! Use: > *command* *selectedObject* *optionalParams*" + oColors.standardWhite)
|
|
|
|
|
|
|
|
inputParams = inputParams[0] if inputParams else None
|
2021-03-07 00:49:57 +00:00
|
|
|
print(inputCommand)
|
|
|
|
print(inputSelectedObject)
|
|
|
|
print(inputParams)
|
2021-03-08 01:56:00 +00:00
|
|
|
handleInput(inputCommand, inputSelectedObject, inputParams)
|
2021-03-03 16:13:43 +00:00
|
|
|
|
|
|
|
|
2021-03-03 22:25:44 +00:00
|
|
|
def inputOption(inputOptionString):
|
2021-03-04 23:09:03 +00:00
|
|
|
inputString = None
|
|
|
|
print(inputOptionString)
|
|
|
|
if inputOptionString == 1:
|
|
|
|
inputString = input("SpigotMC Ressource ID: ")
|
|
|
|
if inputOptionString == 2:
|
|
|
|
inputString = input("SpigotMC Ressource ID: ")
|
|
|
|
if inputOptionString == 3:
|
|
|
|
inputString = input(" SpigotMC Ressource Name: ")
|
2021-03-03 22:25:44 +00:00
|
|
|
print("ich bin ein test")
|
2021-03-04 23:09:03 +00:00
|
|
|
return inputString
|
2021-03-03 22:25:44 +00:00
|
|
|
|
|
|
|
|
2021-03-07 00:49:57 +00:00
|
|
|
def handleInputOLD(inputString):
|
2021-03-03 16:13:43 +00:00
|
|
|
if inputString == "1":
|
|
|
|
downloadPackageManual()
|
|
|
|
if inputString == "2":
|
2021-03-03 22:25:44 +00:00
|
|
|
ressourceId = inputOption(2)
|
|
|
|
apiCallTest(ressourceId)
|
2021-03-03 16:13:43 +00:00
|
|
|
if inputString == "3":
|
2021-03-03 22:25:44 +00:00
|
|
|
ressourceName = inputOption(3)
|
|
|
|
searchPackage(ressourceName)
|
2021-03-03 16:13:43 +00:00
|
|
|
if inputString == "4":
|
2021-03-08 01:56:00 +00:00
|
|
|
#getLatestPackageVersionInteractive(r"C:\\Users\USER\Desktop\\")
|
|
|
|
print("4")
|
2021-03-03 16:13:43 +00:00
|
|
|
if inputString == "5":
|
2021-03-08 01:56:00 +00:00
|
|
|
#updateAllInstalledPackages(r'C:\\Users\\USER\\Desktop\\plugins')
|
|
|
|
print("5")
|
2021-03-03 16:13:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
def inputMainMenu():
|
2021-03-08 01:56:00 +00:00
|
|
|
createInputLists()
|
2021-03-03 16:13:43 +00:00
|
|
|
clearConsole()
|
|
|
|
printMainMenu()
|
2021-03-07 00:49:57 +00:00
|
|
|
getInput()
|
|
|
|
#inputSt = input(" pluGET >> ")
|
|
|
|
#handleInputOLD(inputSt)
|
2021-03-03 16:13:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
def outputTest():
|
|
|
|
print("Hello world")
|
|
|
|
print("Waiting still seconds: 5", end='\r')
|
|
|
|
time.sleep(1)
|
|
|
|
print("Waiting still seconds: 4", end='\r')
|
|
|
|
time.sleep(1)
|
|
|
|
print("Waiting still seconds: 3", end='\r')
|
|
|
|
time.sleep(1)
|
|
|
|
print("Waiting still seconds: 2", end='\r')
|
|
|
|
time.sleep(1)
|
|
|
|
print("Waiting still seconds: 1", end='\r')
|
|
|
|
time.sleep(1)
|
|
|
|
print("Done ✅☑✔ ")
|
|
|
|
input("Press key to end program...")
|
|
|
|
|
2021-03-07 00:49:57 +00:00
|
|
|
|
2021-03-08 01:56:00 +00:00
|
|
|
#createCloudScraperInstance()
|
2021-03-03 16:13:43 +00:00
|
|
|
consoleTitle()
|
|
|
|
inputMainMenu()
|
2021-03-03 22:25:44 +00:00
|
|
|
outputTest()
|