From e5eccab8719d0a3e1b6cc9a4e48b7e20795ec888 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sun, 24 Feb 2019 23:01:26 +0100 Subject: [PATCH 1/7] Rename client.py -> _client.py --- fbchat/{client.py => _client.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename fbchat/{client.py => _client.py} (100%) diff --git a/fbchat/client.py b/fbchat/_client.py similarity index 100% rename from fbchat/client.py rename to fbchat/_client.py From c1861627fbb4e2b87a4975038eb6dba1a30336f7 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sun, 24 Feb 2019 23:06:29 +0100 Subject: [PATCH 2/7] Make deprecated public `client` module --- fbchat/client.py | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 fbchat/client.py diff --git a/fbchat/client.py b/fbchat/client.py new file mode 100644 index 0000000..846c9db --- /dev/null +++ b/fbchat/client.py @@ -0,0 +1,8 @@ +# -*- coding: UTF-8 -*- +"""This file is here to maintain backwards compatability.""" +from __future__ import unicode_literals + +from .utils import * +from .models import * +from .graphql import * +from ._client import Client From 056171891722558a6a6a7a24f657d9ce1ec8b50d Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sun, 24 Feb 2019 23:08:23 +0100 Subject: [PATCH 3/7] Import utils.py and graphql.py directly into the global module --- fbchat/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fbchat/__init__.py b/fbchat/__init__.py index 91bacb4..3bdd86f 100644 --- a/fbchat/__init__.py +++ b/fbchat/__init__.py @@ -4,11 +4,13 @@ :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 .utils import * +from .graphql import * from .models import * -from .client import * +from ._client import Client __title__ = "fbchat" __version__ = "1.6.3" From bc5163adaf3ecadf075fbc6901b5325e9b4d2092 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sun, 24 Feb 2019 23:15:12 +0100 Subject: [PATCH 4/7] Rename utils.py -> _util.py --- fbchat/_client.py | 2 +- fbchat/{utils.py => _util.py} | 0 fbchat/graphql.py | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename fbchat/{utils.py => _util.py} (100%) diff --git a/fbchat/_client.py b/fbchat/_client.py index 8726f68..a4a363d 100644 --- a/fbchat/_client.py +++ b/fbchat/_client.py @@ -8,7 +8,7 @@ from random import choice from bs4 import BeautifulSoup as bs from mimetypes import guess_type from collections import OrderedDict -from .utils import * +from ._util import * from .models import * from .graphql import * import time diff --git a/fbchat/utils.py b/fbchat/_util.py similarity index 100% rename from fbchat/utils.py rename to fbchat/_util.py diff --git a/fbchat/graphql.py b/fbchat/graphql.py index a6a2896..4bf8cab 100644 --- a/fbchat/graphql.py +++ b/fbchat/graphql.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import json import re from .models import * -from .utils import * +from ._util import * # Shameless copy from https://stackoverflow.com/a/8730674 FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL From 0f99a23af7c07dea8c317a838564a7c56afd8ff1 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sun, 24 Feb 2019 23:16:40 +0100 Subject: [PATCH 5/7] Add deprecated public `utils` module --- fbchat/utils.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 fbchat/utils.py diff --git a/fbchat/utils.py b/fbchat/utils.py new file mode 100644 index 0000000..fedb1ea --- /dev/null +++ b/fbchat/utils.py @@ -0,0 +1,36 @@ +# -*- 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, + LIKES, + GENDERS, + 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, + get_emojisize_from_tags, + require_list, + mimetype_to_key, + get_files_from_urls, + get_files_from_paths, + enum_extend_if_invalid, + get_url_parameters, + get_url_parameter, +) From ab9ca9418144f4dd2e1949886a5df65e4afb3f9e Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sun, 24 Feb 2019 23:17:36 +0100 Subject: [PATCH 6/7] Rename graphql.py -> _graphql.py --- fbchat/{graphql.py => _graphql.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename fbchat/{graphql.py => _graphql.py} (100%) diff --git a/fbchat/graphql.py b/fbchat/_graphql.py similarity index 100% rename from fbchat/graphql.py rename to fbchat/_graphql.py From 40e9825ee0a2ccf7c3e92d4fd6599c1976a240a3 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sun, 24 Feb 2019 23:21:17 +0100 Subject: [PATCH 7/7] Add deprecated public `graphql` module --- fbchat/graphql.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 fbchat/graphql.py diff --git a/fbchat/graphql.py b/fbchat/graphql.py new file mode 100644 index 0000000..aeef27c --- /dev/null +++ b/fbchat/graphql.py @@ -0,0 +1,30 @@ +# -*- coding: UTF-8 -*- +"""This file is here to maintain backwards compatability.""" +from __future__ import unicode_literals + +from .models import * +from .utils import * +from ._graphql import ( + FLAGS, + WHITESPACE, + ConcatJSONDecoder, + graphql_color_to_enum, + get_customization_info, + graphql_to_sticker, + graphql_to_attachment, + graphql_to_extensible_attachment, + graphql_to_subattachment, + graphql_to_live_location, + graphql_to_poll, + graphql_to_poll_option, + graphql_to_plan, + graphql_to_quick_reply, + graphql_to_message, + graphql_to_user, + graphql_to_thread, + graphql_to_group, + graphql_to_page, + graphql_queries_to_json, + graphql_response_to_json, + GraphQL, +)