mirror of
https://github.com/yawaflua/Py-SPW.git
synced 2025-12-11 15:56:22 +02:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4729e9cdf | ||
|
|
21ee8e1fa5 | ||
|
|
0eebcca218 | ||
|
|
352ca0f032 | ||
|
|
dda2abd661 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -157,3 +157,6 @@ upload.bat
|
||||
pypi.md
|
||||
|
||||
_build
|
||||
|
||||
dotenv.sh
|
||||
publish.sh
|
||||
|
||||
3
MANIFEST.in
Normal file
3
MANIFEST.in
Normal file
@@ -0,0 +1,3 @@
|
||||
include LICENSE
|
||||
include requirements.txt
|
||||
include README.md
|
||||
@@ -30,5 +30,5 @@ print(api.check_access('437610383310716930'))
|
||||
|
||||
## Links
|
||||
- [PyPi](https://pypi.org/project/Py-SPW)
|
||||
- [Documentation](https://pyspw.xstl.ru/latest)
|
||||
- [Documentation](https://pyspw.xstl.ru/en/latest/)
|
||||
- [API](https://github.com/sp-worlds/api-docs)
|
||||
@@ -57,7 +57,7 @@ class _SkinPart:
|
||||
class Skin:
|
||||
__visage_surgeplay_url = 'https://visage.surgeplay.com/'
|
||||
|
||||
def __init__(self, profile: UserProfile):
|
||||
def __init__(self, profile: str):
|
||||
self._profile = profile
|
||||
self._variant = SkinVariant(profile.skin_variant)
|
||||
|
||||
@@ -98,7 +98,7 @@ class User:
|
||||
self._uuid = mapi.get_uuid(nickname)
|
||||
if self._uuid is None:
|
||||
raise MojangAccountNotFound(self._nickname)
|
||||
self._profile = mapi.get_profile(self._uuid)
|
||||
|
||||
|
||||
@property
|
||||
def nickname(self) -> str:
|
||||
@@ -108,12 +108,8 @@ class User:
|
||||
def uuid(self) -> str:
|
||||
return self._uuid
|
||||
|
||||
@property
|
||||
def profile(self) -> UserProfile:
|
||||
return self._profile
|
||||
|
||||
def get_skin(self) -> Skin:
|
||||
"""
|
||||
Получения объекта скина пользователя.
|
||||
"""
|
||||
return Skin(self._profile)
|
||||
return Skin(self._uuid)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
from .api import *
|
||||
|
||||
__version__ = '1.5.0'
|
||||
__version__ = '1.5.2'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import json
|
||||
import platform
|
||||
from base64 import b64encode
|
||||
from dataclasses import dataclass
|
||||
@@ -57,7 +58,10 @@ class SpApi:
|
||||
except rq.exceptions.ConnectionError as error:
|
||||
raise err.SpwApiError(error)
|
||||
|
||||
if response.headers.get('Content-Type') != 'application/json':
|
||||
try:
|
||||
response.json()
|
||||
|
||||
except json.JSONDecodeError:
|
||||
raise err.SpwApiDDOS()
|
||||
|
||||
if response.ok or response.status_code in ignore_codes:
|
||||
|
||||
6
setup.py
6
setup.py
@@ -1,8 +1,6 @@
|
||||
from os import path
|
||||
from setuptools import setup
|
||||
|
||||
from pyspw import __version__
|
||||
|
||||
this_directory = path.abspath(path.dirname(__file__))
|
||||
|
||||
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
|
||||
@@ -10,6 +8,8 @@ with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
|
||||
|
||||
requirements = open('requirements.txt', 'r').read().split('\n')
|
||||
|
||||
exec(sorted([el if el.startswith('__version__') else 'Z' for el in open('./pyspw/__init__.py', 'r').read().split('\n')], reverse=True)[0])
|
||||
|
||||
setup(
|
||||
name='Py-SPW',
|
||||
version=__version__,
|
||||
@@ -17,7 +17,7 @@ setup(
|
||||
url='https://github.com/teleportx/Py-SPW',
|
||||
license='MIT License',
|
||||
author='Stepan Khozhempo',
|
||||
author_email='stepan@khoz.ru',
|
||||
author_email='stepan@xstl.ru',
|
||||
description='Python library for spworlds API',
|
||||
long_description=description_md,
|
||||
long_description_content_type='text/markdown',
|
||||
|
||||
Reference in New Issue
Block a user