diff --git a/README.md b/README.md index 42073d5..162e680 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,10 @@ # MineHost Interface -A python library for executing commands or gettings information about MineHost minecraft servers. \ No newline at end of file +A python library for executing commands or gettings information about MineHost minecraft servers. + +Documentation: https://rokaspuzonas.github.io/minehost-interface + +## Installation +``` +pip install minehost-interface +``` diff --git a/main.py b/main.py new file mode 100644 index 0000000..602ecfe --- /dev/null +++ b/main.py @@ -0,0 +1,37 @@ +import minehost + +# Ensure that the latest are installed +# pip install -U setuptools wheel + +# Build package +# python3 setup.py sdist bdist_wheel + +# Upload to Test PyPi +# twine upload -R testpypi dist/* + +# Upload to PyPi +# twine upload dist/* + +# Install package from Test PyPi +# pip install --index-url https://test.pypi.org/simple/ + +def main(): + session = minehost.Session() + + try: + with open("session-id.ignore.txt", "r") as f: + session.cookies.set("PHPSESSID", f.read()) + if not session.isValid(): + raise minehost.InvalidSessionException + except (IOError, minehost.InvalidSessionException): + session.login("kasparas253@gmail.com", "5e1877") + + acc = minehost.Account(session=session) + server = acc.getServer() + print(server.getInfo()) + + with open("session-id.ignore.txt", "w") as f: + f.write(session.cookies.get("PHPSESSID")) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/setup.py b/setup.py index 93bd3db..475bf9d 100644 --- a/setup.py +++ b/setup.py @@ -5,13 +5,17 @@ with open("README.md", "r") as f: setuptools.setup( name="minehost-interface", - version="1.0.2", + version="1.0.3", author="Rokas Puzonas", author_email="rokas.puz@gmail.com", description="A simple for interacting with minehost servers.", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/RokasPuzonas/minehost-interface", + project_urls={ + "Documentation": "https://rokaspuzonas.github.io/minehost-interface", + "Source Code": "https://github.com/RokasPuzonas/minehost-interface", + }, license="MIT", packages=setuptools.find_packages(), classifiers=[