From 53c19f473bdaa8da56e81d5a20c9801dd6a161b0 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sun, 23 Jun 2019 17:38:27 +0200 Subject: [PATCH] Remove utils.py The file, and contained functions, were explicitly documented as something you couldn't rely on for backwards compatibility --- docs/api.rst | 11 ----------- fbchat/__init__.py | 2 +- fbchat/_client.py | 2 +- fbchat/utils.py | 32 -------------------------------- 4 files changed, 2 insertions(+), 45 deletions(-) delete mode 100644 fbchat/utils.py diff --git a/docs/api.rst b/docs/api.rst index afebc78..3c9202a 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -31,14 +31,3 @@ A good tip is to write ``from fbchat.models import *`` at the start of your sour .. automodule:: fbchat.models :members: :undoc-members: - - -.. _api_utils: - -Utils ------ - -These functions and values are used internally by fbchat, and are subject to change. Do **NOT** rely on these to be backwards compatible! - -.. automodule:: fbchat.utils - :members: diff --git a/fbchat/__init__.py b/fbchat/__init__.py index b7aaf85..cc95ada 100644 --- a/fbchat/__init__.py +++ b/fbchat/__init__.py @@ -7,11 +7,11 @@ from __future__ import unicode_literals # These imports are far too general, but they're needed for backwards compatbility. -from .utils import * from .models import * from ._graphql import graphql_queries_to_json, graphql_response_to_json, GraphQL from ._client import Client +from ._util import log # TODO: Remove this __title__ = "fbchat" __version__ = "1.6.5" diff --git a/fbchat/_client.py b/fbchat/_client.py index 69358bd..d78964f 100644 --- a/fbchat/_client.py +++ b/fbchat/_client.py @@ -59,7 +59,7 @@ class Client(object): :param email: Facebook `email`, `id` or `phone number` :param password: Facebook account password - :param user_agent: Custom user agent to use when sending requests. If `None`, user agent will be chosen from a premade list (see :any:`utils.USER_AGENTS`) + :param user_agent: Custom user agent to use when sending requests. If `None`, user agent will be chosen from a premade list :param max_tries: Maximum number of times to try logging in :param session_cookies: Cookies from a previous session (Will default to login if these are invalid) :param logging_level: Configures the `logging level `_. Defaults to `INFO` diff --git a/fbchat/utils.py b/fbchat/utils.py deleted file mode 100644 index dc3385e..0000000 --- a/fbchat/utils.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: UTF-8 -*- -"""This file is here to maintain backwards compatability.""" -from __future__ import unicode_literals - -from .models import * -from ._util import ( - log, - handler, - USER_AGENTS, - ReqUrl, - facebookEncoding, - now, - strip_to_json, - get_decoded_r, - get_decoded, - parse_json, - get_json, - digitToChar, - str_base, - generateMessageID, - getSignatureID, - generateOfflineThreadingID, - check_json, - check_request, - get_jsmods_require, - require_list, - mimetype_to_key, - get_files_from_urls, - get_files_from_paths, - get_url_parameters, - get_url_parameter, -)