From 7911c2ebae2d1a10e79d4324db34c85f90235200 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 28 Aug 2019 21:09:41 +0200 Subject: [PATCH 1/7] Stop testing Python 2.7 in TravisCI --- .travis.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index a04077f..00c5228 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,17 +11,9 @@ script: pytest -m offline jobs: include: - - python: 2.7 - before_install: - - sudo apt-get -y install python3-pip python3-setuptools - - sudo pip3 install flit - install: flit install --python python --deps production --extras test - - python: 3.4 - python: 3.5 - python: 3.6 - python: 3.7 - dist: xenial - sudo: required - python: pypy3.5 - name: Lint From 5ee93b760aa27f491886c89972593c4646b34893 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 28 Aug 2019 21:24:09 +0200 Subject: [PATCH 2/7] Update badges - Update version numbers - Use badgen.net instead of shields.io - Remove badges from the docs (they're only present in the README) --- README.rst | 16 ++++++++++------ docs/_static/license.svg | 1 - docs/_static/python-versions.svg | 1 - docs/index.rst | 12 ------------ 4 files changed, 10 insertions(+), 20 deletions(-) delete mode 100644 docs/_static/license.svg delete mode 100644 docs/_static/python-versions.svg diff --git a/README.rst b/README.rst index a857438..eb3cc5f 100644 --- a/README.rst +++ b/README.rst @@ -1,23 +1,27 @@ ``fbchat``: Facebook Chat (Messenger) for Python ================================================ -.. image:: https://img.shields.io/badge/license-BSD-blue.svg +.. image:: https://badgen.net/pypi/license/fbchat :target: https://github.com/carpedm20/fbchat/tree/master/LICENSE :alt: License: BSD 3-Clause -.. image:: https://img.shields.io/badge/python-2.7%2C%203.4%2C%203.5%2C%203.6%203.7%20pypy-blue.svg +.. image:: https://badgen.net/badge/python/3.5,3.6,3.7,3.8,pypy?list=| :target: https://pypi.python.org/pypi/fbchat - :alt: Supported python versions: 2.7, 3.4, 3.5, 3.6, 3.7 and pypy + :alt: Supported python versions: 3.5, 3.6, 3.7, 3.8 and pypy -.. image:: https://readthedocs.org/projects/fbchat/badge/?version=latest +.. image:: https://badgen.net/pypi/v/fbchat + :target: https://pypi.python.org/pypi/fbchat + :alt: Project version + +.. image:: https://readthedocs.org/projects/fbchat/badge/?version=stable :target: https://fbchat.readthedocs.io :alt: Documentation -.. image:: https://travis-ci.org/carpedm20/fbchat.svg?branch=master +.. image:: https://badgen.net/travis/carpedm20/fbchat :target: https://travis-ci.org/carpedm20/fbchat :alt: Travis CI -.. image:: https://img.shields.io/badge/code%20style-black-000000.svg +.. image:: https://badgen.net/badge/code%20style/black/black :target: https://github.com/ambv/black :alt: Code style diff --git a/docs/_static/license.svg b/docs/_static/license.svg deleted file mode 100644 index 900d32c..0000000 --- a/docs/_static/license.svg +++ /dev/null @@ -1 +0,0 @@ -licenselicenseBSDBSD \ No newline at end of file diff --git a/docs/_static/python-versions.svg b/docs/_static/python-versions.svg deleted file mode 100644 index f3f3bd4..0000000 --- a/docs/_static/python-versions.svg +++ /dev/null @@ -1 +0,0 @@ -pythonpython2.7, 3.4, 3.5, 3.62.7, 3.4, 3.5, 3.6 \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index b58df24..e5be90b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -11,18 +11,6 @@ Release v\ |version|. (:ref:`install`) -.. generated with: https://img.shields.io/badge/license-BSD-blue.svg - -.. image:: /_static/license.svg - :target: https://github.com/carpedm20/fbchat/blob/master/LICENSE.txt - :alt: License: BSD - -.. generated with: https://img.shields.io/badge/python-2.7%2C%203.4%2C%203.5%2C%203.6-blue.svg - -.. image:: /_static/python-versions.svg - :target: https://pypi.python.org/pypi/fbchat - :alt: Supported python versions: 2.7, 3.4, 3.5 and 3.6 - Facebook Chat (`Messenger `_) for Python. This project was inspired by `facebook-chat-api `_. From 330473a0927d433cf79832b03e507691e58e43c8 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 28 Aug 2019 21:24:59 +0200 Subject: [PATCH 3/7] Update PyPI classifiers and required python version --- docs/index.rst | 2 +- pyproject.toml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/index.rst b/docs/index.rst index e5be90b..7efdb5a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -16,7 +16,7 @@ This project was inspired by `facebook-chat-api Date: Wed, 28 Aug 2019 21:26:59 +0200 Subject: [PATCH 4/7] Remove `six` dependency --- pyproject.toml | 1 - tests/utils.py | 12 ++---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 01fa829..0641406 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,6 @@ Repository = "https://github.com/carpedm20/fbchat/" [tool.flit.metadata.requires-extra] test = [ "pytest~=4.0", - "six~=1.0", ] docs = [ "sphinx~=2.0", diff --git a/tests/utils.py b/tests/utils.py index 52863b5..76bcf9e 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -4,13 +4,11 @@ from __future__ import unicode_literals import threading import logging -import six import pytest from os import environ from random import randrange from contextlib import contextmanager -from six import viewitems from fbchat import Client from fbchat.models import ThreadType, EmojiSize, FBchatFacebookError, Sticker @@ -63,13 +61,7 @@ class ClientThread(threading.Thread): self.client.stopListening() -if six.PY2: - event_class = threading._Event -else: - event_class = threading.Event - - -class CaughtValue(event_class): +class CaughtValue(threading.Event): def set(self, res): self.res = res super(CaughtValue, self).set() @@ -85,7 +77,7 @@ def random_hex(length=20): def subset(a, **b): print(a) print(b) - return viewitems(b) <= viewitems(a) + return b.items() <= a.items() def load_variable(name, cache): From 75378bb7098dc8789650b7d00d5f3f544c27b442 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 28 Aug 2019 21:37:16 +0200 Subject: [PATCH 5/7] Remove Python 2 specific imports --- fbchat/_client.py | 5 ----- fbchat/_util.py | 17 +---------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/fbchat/_client.py b/fbchat/_client.py index 7c8b7ee..23a7916 100644 --- a/fbchat/_client.py +++ b/fbchat/_client.py @@ -15,11 +15,6 @@ from ._state import State import time import json -try: - from urllib.parse import urlparse, parse_qs -except ImportError: - from urlparse import urlparse, parse_qs - ACONTEXT = { "action_history": [ diff --git a/fbchat/_util.py b/fbchat/_util.py index 58fa657..5123590 100644 --- a/fbchat/_util.py +++ b/fbchat/_util.py @@ -8,6 +8,7 @@ from random import random from contextlib import contextmanager from mimetypes import guess_type from os.path import basename +from urllib.parse import parse_qs, urlparse import warnings import logging import requests @@ -19,22 +20,6 @@ from ._exception import ( FBchatPleaseRefresh, ) -try: - from urllib.parse import urlencode, parse_qs, urlparse - - basestring = (str, bytes) -except ImportError: - from urllib import urlencode - from urlparse import parse_qs, urlparse - - basestring = basestring - -# Python 2's `input` executes the input, whereas `raw_input` just returns the input -try: - input = raw_input -except NameError: - pass - # Log settings log = logging.getLogger("client") log.setLevel(logging.DEBUG) From 66505f8f41421c6cf02a5cff9ec2e34ecae557d6 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 28 Aug 2019 21:57:46 +0200 Subject: [PATCH 6/7] Remove redundant encoding specifiers and __future__ imports --- docs/conf.py | 2 -- examples/basic_usage.py | 2 -- examples/echobot.py | 2 -- examples/fetch.py | 2 -- examples/interract.py | 2 -- examples/keepbot.py | 2 -- examples/removebot.py | 2 -- fbchat/__init__.py | 2 -- fbchat/_attachment.py | 3 --- fbchat/_client.py | 3 --- fbchat/_core.py | 3 --- fbchat/_exception.py | 4 ---- fbchat/_file.py | 3 --- fbchat/_graphql.py | 3 --- fbchat/_group.py | 3 --- fbchat/_location.py | 3 --- fbchat/_message.py | 3 --- fbchat/_page.py | 3 --- fbchat/_plan.py | 3 --- fbchat/_poll.py | 3 --- fbchat/_quick_reply.py | 3 --- fbchat/_state.py | 3 --- fbchat/_sticker.py | 3 --- fbchat/_thread.py | 3 --- fbchat/_user.py | 3 --- fbchat/_util.py | 3 --- fbchat/models.py | 2 -- tests/conftest.py | 4 ---- tests/test_base.py | 4 ---- tests/test_fetch.py | 4 ---- tests/test_message_management.py | 4 ---- tests/test_plans.py | 4 ---- tests/test_polls.py | 4 ---- tests/test_search.py | 4 ---- tests/test_send.py | 4 ---- tests/test_tests.py | 4 ---- tests/test_thread_interraction.py | 4 ---- tests/utils.py | 4 ---- 38 files changed, 117 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 0e5309d..4f95bb1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a diff --git a/examples/basic_usage.py b/examples/basic_usage.py index c712dcd..b64f30e 100644 --- a/examples/basic_usage.py +++ b/examples/basic_usage.py @@ -1,5 +1,3 @@ -# -*- coding: UTF-8 -*- - from fbchat import Client from fbchat.models import * diff --git a/examples/echobot.py b/examples/echobot.py index d03159e..ac1e6ab 100644 --- a/examples/echobot.py +++ b/examples/echobot.py @@ -1,5 +1,3 @@ -# -*- coding: UTF-8 -*- - from fbchat import log, Client # Subclass fbchat.Client and override required methods diff --git a/examples/fetch.py b/examples/fetch.py index cbcef40..f18c048 100644 --- a/examples/fetch.py +++ b/examples/fetch.py @@ -1,5 +1,3 @@ -# -*- coding: UTF-8 -*- - from itertools import islice from fbchat import Client from fbchat.models import * diff --git a/examples/interract.py b/examples/interract.py index 12dc21e..f40f1ca 100644 --- a/examples/interract.py +++ b/examples/interract.py @@ -1,5 +1,3 @@ -# -*- coding: UTF-8 -*- - from fbchat import Client from fbchat.models import * diff --git a/examples/keepbot.py b/examples/keepbot.py index b3e835e..73a213c 100644 --- a/examples/keepbot.py +++ b/examples/keepbot.py @@ -1,5 +1,3 @@ -# -*- coding: UTF-8 -*- - from fbchat import log, Client from fbchat.models import * diff --git a/examples/removebot.py b/examples/removebot.py index 91979ff..8b1a941 100644 --- a/examples/removebot.py +++ b/examples/removebot.py @@ -1,5 +1,3 @@ -# -*- coding: UTF-8 -*- - from fbchat import log, Client from fbchat.models import * diff --git a/fbchat/__init__.py b/fbchat/__init__.py index fa53c73..fa58ba9 100644 --- a/fbchat/__init__.py +++ b/fbchat/__init__.py @@ -1,10 +1,8 @@ -# -*- coding: UTF-8 -*- """Facebook Chat (Messenger) for Python :copyright: (c) 2015 - 2019 by Taehoon Kim :license: BSD 3-Clause, see LICENSE for more details. """ -from __future__ import unicode_literals # These imports are far too general, but they're needed for backwards compatbility. from .models import * diff --git a/fbchat/_attachment.py b/fbchat/_attachment.py index 8ce3296..24dc17b 100644 --- a/fbchat/_attachment.py +++ b/fbchat/_attachment.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - import attr from . import _util diff --git a/fbchat/_client.py b/fbchat/_client.py index 23a7916..3d009e0 100644 --- a/fbchat/_client.py +++ b/fbchat/_client.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - import requests import urllib from uuid import uuid1 diff --git a/fbchat/_core.py b/fbchat/_core.py index e7d86b4..e6df0aa 100644 --- a/fbchat/_core.py +++ b/fbchat/_core.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - import logging import aenum diff --git a/fbchat/_exception.py b/fbchat/_exception.py index e49537c..c28d68b 100644 --- a/fbchat/_exception.py +++ b/fbchat/_exception.py @@ -1,7 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - - class FBchatException(Exception): """Custom exception thrown by ``fbchat``. diff --git a/fbchat/_file.py b/fbchat/_file.py index 40ab04d..db3ebf1 100644 --- a/fbchat/_file.py +++ b/fbchat/_file.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - import attr from ._attachment import Attachment diff --git a/fbchat/_graphql.py b/fbchat/_graphql.py index 375f307..9a186ec 100644 --- a/fbchat/_graphql.py +++ b/fbchat/_graphql.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - import json import re from . import _util diff --git a/fbchat/_group.py b/fbchat/_group.py index 1d7b584..e4af880 100644 --- a/fbchat/_group.py +++ b/fbchat/_group.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - import attr from . import _plan from ._thread import ThreadType, Thread diff --git a/fbchat/_location.py b/fbchat/_location.py index e3cc566..a3dc829 100644 --- a/fbchat/_location.py +++ b/fbchat/_location.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - import attr from ._attachment import Attachment from . import _util diff --git a/fbchat/_message.py b/fbchat/_message.py index f2d3a8c..60a52c5 100644 --- a/fbchat/_message.py +++ b/fbchat/_message.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - import attr import json from string import Formatter diff --git a/fbchat/_page.py b/fbchat/_page.py index 7721cf2..76bbad7 100644 --- a/fbchat/_page.py +++ b/fbchat/_page.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - import attr from . import _plan from ._thread import ThreadType, Thread diff --git a/fbchat/_plan.py b/fbchat/_plan.py index bc4cd47..d0dc576 100644 --- a/fbchat/_plan.py +++ b/fbchat/_plan.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - import attr import json from ._core import Enum diff --git a/fbchat/_poll.py b/fbchat/_poll.py index b5944b9..554d91e 100644 --- a/fbchat/_poll.py +++ b/fbchat/_poll.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - import attr diff --git a/fbchat/_quick_reply.py b/fbchat/_quick_reply.py index 1163edc..147632d 100644 --- a/fbchat/_quick_reply.py +++ b/fbchat/_quick_reply.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - import attr from ._attachment import Attachment diff --git a/fbchat/_state.py b/fbchat/_state.py index a20e4f2..ed7b3f2 100644 --- a/fbchat/_state.py +++ b/fbchat/_state.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - import attr import bs4 import re diff --git a/fbchat/_sticker.py b/fbchat/_sticker.py index 024132d..a56ce2a 100644 --- a/fbchat/_sticker.py +++ b/fbchat/_sticker.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - import attr from ._attachment import Attachment diff --git a/fbchat/_thread.py b/fbchat/_thread.py index a93a178..c3f4ab6 100644 --- a/fbchat/_thread.py +++ b/fbchat/_thread.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - import attr from ._core import Enum diff --git a/fbchat/_user.py b/fbchat/_user.py index eae5fdb..af70dbb 100644 --- a/fbchat/_user.py +++ b/fbchat/_user.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- -from __future__ import unicode_literals - import attr from ._core import Enum from . import _plan diff --git a/fbchat/_util.py b/fbchat/_util.py index 5123590..cb8a677 100644 --- a/fbchat/_util.py +++ b/fbchat/_util.py @@ -1,6 +1,3 @@ -# -*- coding: UTF-8 -*- - -from __future__ import unicode_literals import re import json from time import time diff --git a/fbchat/models.py b/fbchat/models.py index 1bab61b..69bfd84 100644 --- a/fbchat/models.py +++ b/fbchat/models.py @@ -1,11 +1,9 @@ -# -*- coding: UTF-8 -*- """This file is here to maintain backwards compatability, and to re-export our models into the global module (see `__init__.py`). A common pattern was to use `from fbchat.models import *`, hence we need this while transitioning to a better code structure. """ -from __future__ import unicode_literals from ._core import Enum from ._exception import FBchatException, FBchatFacebookError, FBchatUserError diff --git a/tests/conftest.py b/tests/conftest.py index 2e1f486..07d598b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- - -from __future__ import unicode_literals - import pytest import json diff --git a/tests/test_base.py b/tests/test_base.py index 6a60482..16ab01c 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- - -from __future__ import unicode_literals - import pytest import py_compile diff --git a/tests/test_fetch.py b/tests/test_fetch.py index d509fad..8515c3f 100644 --- a/tests/test_fetch.py +++ b/tests/test_fetch.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- - -from __future__ import unicode_literals - import pytest from os import path diff --git a/tests/test_message_management.py b/tests/test_message_management.py index 00291ee..adde421 100644 --- a/tests/test_message_management.py +++ b/tests/test_message_management.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- - -from __future__ import unicode_literals - import pytest from fbchat.models import Message, MessageReaction diff --git a/tests/test_plans.py b/tests/test_plans.py index 9e5e6b6..5388e6c 100644 --- a/tests/test_plans.py +++ b/tests/test_plans.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- - -from __future__ import unicode_literals - import pytest from fbchat.models import Plan, FBchatFacebookError, ThreadType diff --git a/tests/test_polls.py b/tests/test_polls.py index 32c2457..daa6f1c 100644 --- a/tests/test_polls.py +++ b/tests/test_polls.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- - -from __future__ import unicode_literals - import pytest from fbchat.models import Poll, PollOption, ThreadType diff --git a/tests/test_search.py b/tests/test_search.py index dda9568..07cc88e 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- - -from __future__ import unicode_literals - from fbchat.models import ThreadType diff --git a/tests/test_send.py b/tests/test_send.py index b5dec30..c45be33 100644 --- a/tests/test_send.py +++ b/tests/test_send.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- - -from __future__ import unicode_literals - import pytest from os import path diff --git a/tests/test_tests.py b/tests/test_tests.py index 1367628..2132f8f 100644 --- a/tests/test_tests.py +++ b/tests/test_tests.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- - -from __future__ import unicode_literals - import pytest diff --git a/tests/test_thread_interraction.py b/tests/test_thread_interraction.py index 041346b..b809c6d 100644 --- a/tests/test_thread_interraction.py +++ b/tests/test_thread_interraction.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- - -from __future__ import unicode_literals - import pytest from fbchat.models import ( diff --git a/tests/utils.py b/tests/utils.py index 76bcf9e..21bed11 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,7 +1,3 @@ -# -*- coding: utf-8 -*- - -from __future__ import unicode_literals - import threading import logging import pytest From 01b80b300eb874524a0bdefe96396ca00e2795d5 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Wed, 28 Aug 2019 21:45:48 +0200 Subject: [PATCH 7/7] Remove explicit new style class declarations --- fbchat/_attachment.py | 2 +- fbchat/_client.py | 2 +- fbchat/_message.py | 4 ++-- fbchat/_plan.py | 2 +- fbchat/_poll.py | 4 ++-- fbchat/_quick_reply.py | 2 +- fbchat/_state.py | 2 +- fbchat/_thread.py | 2 +- fbchat/_user.py | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/fbchat/_attachment.py b/fbchat/_attachment.py index 24dc17b..ec48721 100644 --- a/fbchat/_attachment.py +++ b/fbchat/_attachment.py @@ -3,7 +3,7 @@ from . import _util @attr.s(cmp=False) -class Attachment(object): +class Attachment: """Represents a Facebook attachment.""" #: The attachment ID diff --git a/fbchat/_client.py b/fbchat/_client.py index 3d009e0..ec7efee 100644 --- a/fbchat/_client.py +++ b/fbchat/_client.py @@ -20,7 +20,7 @@ ACONTEXT = { } -class Client(object): +class Client: """A client for the Facebook Chat (Messenger). This is the main class of ``fbchat``, which contains all the methods you use to diff --git a/fbchat/_message.py b/fbchat/_message.py index 60a52c5..9f6afa6 100644 --- a/fbchat/_message.py +++ b/fbchat/_message.py @@ -43,7 +43,7 @@ class MessageReaction(Enum): @attr.s(cmp=False) -class Mention(object): +class Mention: """Represents a ``@mention``.""" #: The thread ID the mention is pointing at @@ -55,7 +55,7 @@ class Mention(object): @attr.s(cmp=False) -class Message(object): +class Message: """Represents a Facebook message.""" #: The actual message diff --git a/fbchat/_plan.py b/fbchat/_plan.py index d0dc576..1a3c5bd 100644 --- a/fbchat/_plan.py +++ b/fbchat/_plan.py @@ -10,7 +10,7 @@ class GuestStatus(Enum): @attr.s(cmp=False) -class Plan(object): +class Plan: """Represents a plan.""" #: ID of the plan diff --git a/fbchat/_poll.py b/fbchat/_poll.py index 554d91e..08c6de6 100644 --- a/fbchat/_poll.py +++ b/fbchat/_poll.py @@ -2,7 +2,7 @@ import attr @attr.s(cmp=False) -class Poll(object): +class Poll: """Represents a poll.""" #: Title of the poll @@ -25,7 +25,7 @@ class Poll(object): @attr.s(cmp=False) -class PollOption(object): +class PollOption: """Represents a poll option.""" #: Text of the poll option diff --git a/fbchat/_quick_reply.py b/fbchat/_quick_reply.py index 147632d..5a9a262 100644 --- a/fbchat/_quick_reply.py +++ b/fbchat/_quick_reply.py @@ -3,7 +3,7 @@ from ._attachment import Attachment @attr.s(cmp=False) -class QuickReply(object): +class QuickReply: """Represents a quick reply.""" #: Payload of the quick reply diff --git a/fbchat/_state.py b/fbchat/_state.py index ed7b3f2..8062b16 100644 --- a/fbchat/_state.py +++ b/fbchat/_state.py @@ -97,7 +97,7 @@ def _2fa_helper(session, code, r): @attr.s(slots=True) # TODO i Python 3: Add kw_only=True -class State(object): +class State: """Stores and manages state required for most Facebook requests.""" user_id = attr.ib() diff --git a/fbchat/_thread.py b/fbchat/_thread.py index c3f4ab6..e39b4b4 100644 --- a/fbchat/_thread.py +++ b/fbchat/_thread.py @@ -70,7 +70,7 @@ class ThreadColor(Enum): @attr.s(cmp=False, init=False) -class Thread(object): +class Thread: """Represents a Facebook thread.""" #: The unique identifier of the thread. Can be used a ``thread_id``. See :ref:`intro_threads` for more info diff --git a/fbchat/_user.py b/fbchat/_user.py index af70dbb..b864b13 100644 --- a/fbchat/_user.py +++ b/fbchat/_user.py @@ -180,7 +180,7 @@ class User(Thread): @attr.s(cmp=False) -class ActiveStatus(object): +class ActiveStatus: #: Whether the user is active now active = attr.ib(None) #: Timestamp when the user was last active