Skip to content

Commit fb1e2ca

Browse files
committed
formatting, cleanup and version bump
1 parent e45b7cf commit fb1e2ca

File tree

7 files changed

+24
-10
lines changed

7 files changed

+24
-10
lines changed

mystbin/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
from .client import MystbinClient
2828
from .errors import *
2929

30-
__version__ = "0.3.2"
31-
VersionInfo = namedtuple("VersionInfo", "major minor micro releaselevel serial")
32-
version_info = VersionInfo(major=0, minor=3, micro=1, releaselevel='final', serial=0)
30+
__version__ = "0.3.3"
31+
VersionInfo = namedtuple(
32+
"VersionInfo", "major minor micro releaselevel serial")
33+
version_info = VersionInfo(major=0, minor=3, micro=3,
34+
releaselevel='final', serial=0)

mystbin/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
import aiohttp
3030
import pkg_resources
31+
3132
try:
3233
import requests
3334
except ImportError:

mystbin/client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from typing import TYPE_CHECKING, Awaitable, Callable, Optional, Type, Union
2828

2929
import aiohttp
30+
3031
if TYPE_CHECKING:
3132
import requests
3233

@@ -85,7 +86,7 @@ def post(self, content: str, syntax: str = None) -> Union[Paste, Awaitable]:
8586
This will post to the Mystb.in API and return the url.
8687
Can pass an optional suffix for the syntax highlighting.
8788
88-
Attributes
89+
Parameters
8990
----------
9091
content: :class:`str`
9192
The content you are posting to the Mystb.in API.
@@ -131,7 +132,7 @@ def get(self, paste_id: str) -> Union[PasteData, Awaitable]:
131132
This will perform a GET request against the Mystb.in API and return the url.
132133
Must be passed a valid paste ID or URL.
133134
134-
Attributes
135+
Parameters
135136
----------
136137
paste_id: :class:`str`
137138
The ID of the paste you are going to retrieve.

mystbin/constants.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424

2525
from re import compile
2626

27+
__all__ = ("API_BASE_URL", "PASTE_BASE", "CLIENT_TIMEOUT", "MB_URL_RE")
28+
2729
API_BASE_URL = "https://mystb.in/api/pastes"
2830
PASTE_BASE = "https://mystb.in/{}{}"
2931

mystbin/errors.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,17 @@
2222
DEALINGS IN THE SOFTWARE.
2323
"""
2424

25+
__all__ = ("APIError", "BadPasteID")
26+
2527

2628
class BadPasteID(ValueError):
2729
""" Bad Paste ID. """
2830

31+
2932
class MystbinException(Exception):
3033
""" Error when interacting with Mystbin. """
3134

35+
3236
class APIError(MystbinException):
3337
"""
3438
Exception relationg to the API of Mystbin.

mystbin/objects.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@
2727

2828
from .constants import PASTE_BASE
2929

30+
3031
class Paste:
3132
"""
3233
A class representing the return data from the API after performing a POST request.
3334
34-
Parameters
35+
Attributes
3536
----------
3637
paste_id: :class:`str`
3738
The ID returned from the API. Genertally it is 3 random choice English words.
@@ -72,11 +73,12 @@ def with_syntax(self, new_syntax: str) -> str:
7273
new_syntax = f".{new_syntax}" if new_syntax else None
7374
return PASTE_BASE.format(self.paste_id, new_syntax)
7475

76+
7577
class PasteData:
7678
"""
7779
A class representing the return data from the API after performing a GET request.
7880
79-
Parameters
81+
Attributes
8082
----------
8183
paste_id: :class:`str`
8284
The ID you wish to retrieve from the API.
@@ -89,7 +91,10 @@ class PasteData:
8991
paste_date: :class:`datetime.datetime`
9092
The date this paste was created on the API.
9193
"""
92-
__slots__ = ("paste_id", "_paste_data", "paste_content", "paste_syntax", "paste_nick", "paste_date")
94+
95+
__slots__ = ("paste_id", "_paste_data", "paste_content",
96+
"paste_syntax", "paste_nick", "paste_date")
97+
9398
def __init__(self, paste_id: str, paste_data: dict):
9499
self.paste_id = paste_id
95100
self._paste_data = paste_data
@@ -119,4 +124,3 @@ def created_at(self) -> datetime.datetime:
119124
def content(self) -> str:
120125
""" :class:`str`: Return the paste content but dedented correctly. """
121126
return dedent(self.paste_content)
122-

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "mystbin.py"
3-
version = "0.3.2"
3+
version = "0.3.3"
44
description = "A small simple wrapper around the mystb.in API."
55
authors = ["AbstractUmbra <Umbra@AbstractUmbra.xyz>"]
66
license = "MIT"

0 commit comments

Comments
 (0)