Comments (3)
Authored by kevinkjt2000
May 7, 2019
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'
from mcstatus.
Authored by Iphex
May 8, 2019
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.
from mcstatus.
Authored by kevinkjt2000
May 10, 2019
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'
from mcstatus.
Related Issues (20)
- Status fails to process a JSON MOTD containing only a translation HOT 7
- No response was returned. HOT 8
- Socket not closable before program end. HOT 3
- Remove the duplicate logic in connection classes HOT 1
- [Errno 32] Broken pipe HOT 5
- Increase coverage level back to 80%
- Can't acquire online players correctly HOT 14
- Drop python 3.7?
- incorrect operation of status().players.sample HOT 1
- Playerlist times out on Bungeecord Proxy setups HOT 3
- add docs please ._.
- Consider slice async logic to its own classes HOT 1
- Bump dependencies in GitHub Actions with dependabot HOT 4
- Avoid `TYPE_CHECKING` blocks in code HOT 1
- Host documentation on readthedocs.org HOT 1
- Redo the main README to summarize the project's overall goal, link to readthedocs, badges (GitHub CI status, pypi), and explain how to contribute HOT 1
- Make sure the README is copied to pypi long description metadata HOT 1
- How would I await the functions? HOT 14
- TimeoutError while checking bedrock status HOT 22
- Problems with ping Bedrock servers on core PMMP HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mcstatus.