Merge pull request #13 from urda/modernized-readme-fixup

Fixup some README issues
This commit is contained in:
Dinner Bone
2014-09-17 11:25:57 +02:00

View File

@@ -1,34 +1,39 @@
mcstatus mcstatus
======== ========
mcstatus provides an easy way to query Minecraft servers for any information they can expose. It provides two modes of access, 'query' and 'ping', the differences of which are listed below in usage. `mcstatus` provides an easy way to query Minecraft servers for any information they can expose.
It provides two modes of access, `query` and `ping`, the differences of which are listed below in usage.
Usage Usage
----- -----
from mcstatus import MinecraftServer ```python
from mcstatus import MinecraftServer
server = MinecraftServer("localhost", 25565)
server = MinecraftServer("localhost", 25565)
# 'ping' is supported by all Minecraft servers that are version 1.7 or higher.
status = server.ping_server() # 'ping' is supported by all Minecraft servers that are version 1.7 or higher.
print("The server has %d players" % (status.players.online)) status, ping = server.ping_server()
print("The server has {0} players".format(status.players.online))
# 'query' has to be enabled in a servers' server.properties file.
# It may give more information than a ping, such as a full player list or mod information. # 'query' has to be enabled in a servers' server.properties file.
query = query.query_server() # It may give more information than a ping, such as a full player list or mod information.
print("The server has the following players online: " % (string.join(query.players.names, ", "))) query = server.query_server()
print("The server has the following players online: {0}".format(", ".join(query.players.names)))
```
Installation Installation
------------ ------------
mcstatus is available on pypi, and can be installed trivially with: mcstatus is available on pypi, and can be installed trivially with:
pip install mcstatus ```bash
pip install mcstatus
```
Alternatively, just clone this repo! Alternatively, just clone this repo!
License License
------- -------
mcstatus is licensed under Apache 2.0. mcstatus is licensed under Apache 2.0.