diff --git a/src/pastebin/client.py b/src/pastebin/client.py index fc5f73b..b1718f2 100644 --- a/src/pastebin/client.py +++ b/src/pastebin/client.py @@ -10,6 +10,7 @@ import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry from bs4 import BeautifulSoup +from .paste import Paste logger = logging.getLogger() @@ -19,35 +20,6 @@ class ApiRequestException(Exception): pass -class Paste: - def __init__(self, title, href, lang): - self.title = title - self.href = href - self.lang = lang - - self.fetched = False - self.author = None - self.pub_date = None - self.category = None - self.text = None - - def __repr__(self): - return ("Paste(" - f"title='{self.title}', " - f"href='{self.href}', " - f"lang='{self.lang}', " - f"fetched={self.fetched})" - ) - - def __hash__(self): - return hash((self.title, self.href, self.lang)) - - def __eq__(self, other): - if isinstance(other, Paste): - return self.title == other.title and self.href == other.href and self.lang == other.lang - return False - - class PastebinAPI: """ Wrapper class for interacting with Pastebin. diff --git a/src/pastebin/paste.py b/src/pastebin/paste.py new file mode 100644 index 0000000..5129418 --- /dev/null +++ b/src/pastebin/paste.py @@ -0,0 +1,27 @@ +class Paste: + def __init__(self, title, href, lang): + self.title = title + self.href = href + self.lang = lang + + self.fetched = False + self.author = None + self.pub_date = None + self.category = None + self.text = None + + def __repr__(self): + return ("Paste(" + f"title='{self.title}', " + f"href='{self.href}', " + f"lang='{self.lang}', " + f"fetched={self.fetched})" + ) + + def __hash__(self): + return hash((self.title, self.href, self.lang)) + + def __eq__(self, other): + if isinstance(other, Paste): + return self.title == other.title and self.href == other.href and self.lang == other.lang + return False