Closed sanjok-bless closed 5 years ago
It would appear that each plugin name and version is separated by a space. Will you try using name, version = plugin.split(" ")
on each plugin?
>>> name, version = "Foo 1.0".split(" ")
>>> name
'Foo'
>>> version
'1.0'
It would appear that each plugin name and version are separated by a space. Will you try using
name, version = plugin.split(" ")
Does not work in Python as the query brings back plugin as a list. For Example: ['CoreProtect 2.16.3', 'EditableSign 5.5.2', 'VeinMiner 1.14.0', 'ChestSort 5.0.2'] We can just iterate over it tho with for example
plugins = ""
plugins_versions = query.software.plugins # ex. Veinminer 2.5
for i in plugins_versions:
plug = i.split(" ")
plugins = plug[0] + ", " + plugins
plugins = plugins[:-2] #cut the last , and space
This gives us plugins as a String that we can directly use
CoreProtect, EditableSign, VeinMiner, ChestSort
I am pretty sure that there is a prettier solution for this, but I am quite the noob in python so I apologize.
This one-liner should help:
>>> plugins
['GrieferGamesBan 1.0', 'WorldEdit 6.1.2,b3fbe8b', 'Prefix 2.1.3', 'VoteKick 2.0', 'RankSigns 0.7.2', 'PermissionsEx 1.23.4', 'GrieferGames 3.0', 'PlugMan 2.1.5', 'SetSpawn 3.1', 'MOTD 2.3.2', 'ViaVersion 2.0.1', 'Tablist 1.3.2.9', 'Vault 1.5.5-b47', 'ProtocolLib 4.4.0', 'WorldGuard 6.1', 'NoCheatPlus 3.16.0-RC-sMD5NET-b1134', 'Essentials 2.0.1-b171', 'AntiTab 2.3', 'JoinMessagePlus 3.1', 'PlotSquared 3.5.0-SNAPSHOT-2b561f2', 'Multiverse-Core 2.5-b717', 'AuthMe 5.6.0-beta1-b2226', 'HolographicDisplays 2.1.11']
>>> ", ".join([plugin.split(" ")[0] for plugin in plugins])
'GrieferGamesBan, WorldEdit, Prefix, VoteKick, RankSigns, PermissionsEx, GrieferGames, PlugMan, SetSpawn, MOTD, ViaVersion, Tablist, Vault, ProtocolLib, WorldGuard, NoCheatPlus, Essentials, AntiTab, JoinMessagePlus, PlotSquared, Multiverse-Core, AuthMe, HolographicDisplays'
Now when I check minecraft server with query.software.plugins I get a list with versions: WorldBorder 1.6.0,MultiWorld 2.9.0,AutomaticPrivates 1,Fix_bugs 0.1,WorldEdit 1141-2ed92da,PlgSetspawn 5.0,CreativeGates 1.4,ColoredSigns 4.1,FullJoinVip 1.0,RandomChestCmd 2.3.0,PlayerServer Information 1.0,PermissionsEx 1.20.4,AntiRelog 2.5.0,TP_RG_kot525 0.1,WorldGuard 5.7.1,OtkatPlagin 0.1,InversionTimeWorld 0.1,FixedIS_kot525 0.1,AutoMessage 2.3.1,iConomy 7.0,bonus_kot525 1,LogKot525 0.1,LokiBlocker 0.5.2,ShoppingRG_kot525 0.1,OpenInv 2.0.8,ChestShop 3.5,FirstJoinPlus 1.8.2,ProtocolLib 3.1.2,AutoSaveWorld 3.6,ProMessage_Kot525 0.1,Essentials 2.9.6,ChatManager 1.19.1,NoCheatPlus 3.11.1-RC-sMD5NET-b743,ChatGuard 5.8
How can I get plugins list without versions? Is it possible?