mirror of https://github.com/zulip/zulip.git
requirements: Upgrade talon fork to 1.4.8.
https://github.com/mailgun/talon/pull/200 Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
6d506ed40a
commit
6364e1b5f3
|
@ -57,8 +57,8 @@ python-gcm
|
||||||
|
|
||||||
# Needed for the email mirror
|
# Needed for the email mirror
|
||||||
html2text
|
html2text
|
||||||
# Forked to avoid pulling in scipy: https://github.com/mailgun/talon/issues/130
|
# Forked to avoid pulling in scipy: https://github.com/mailgun/talon/pull/200
|
||||||
https://github.com/zulip/talon/archive/7d8bdc4dbcfcc5a73298747293b99fe53da55315.zip#egg=talon==1.2.10.zulip1
|
https://github.com/zulip/talon/archive/1711705c952806d4a704c7dbf58f21db8e11756a.zip#egg=talon-core==1.4.8.zulip1&subdirectory=talon-core
|
||||||
|
|
||||||
# Needed for inlining the CSS in emails
|
# Needed for inlining the CSS in emails
|
||||||
premailer
|
premailer
|
||||||
|
|
|
@ -142,7 +142,7 @@ cchardet==2.1.7 \
|
||||||
--hash=sha256:f16517f3697569822c6d09671217fdeab61dfebc7acb5068634d6b0728b86c0b \
|
--hash=sha256:f16517f3697569822c6d09671217fdeab61dfebc7acb5068634d6b0728b86c0b \
|
||||||
--hash=sha256:f86e0566cb61dc4397297696a4a1b30f6391b50bc52b4f073507a48466b6255a \
|
--hash=sha256:f86e0566cb61dc4397297696a4a1b30f6391b50bc52b4f073507a48466b6255a \
|
||||||
--hash=sha256:fdac1e4366d0579fff056d1280b8dc6348be964fda8ebb627c0269e097ab37fa
|
--hash=sha256:fdac1e4366d0579fff056d1280b8dc6348be964fda8ebb627c0269e097ab37fa
|
||||||
# via talon
|
# via talon-core
|
||||||
certifi==2020.12.5 \
|
certifi==2020.12.5 \
|
||||||
--hash=sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c \
|
--hash=sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c \
|
||||||
--hash=sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830
|
--hash=sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830
|
||||||
|
@ -197,7 +197,7 @@ chardet==4.0.0 \
|
||||||
# via
|
# via
|
||||||
# python-debian
|
# python-debian
|
||||||
# requests
|
# requests
|
||||||
# talon
|
# talon-core
|
||||||
click==7.1.2 \
|
click==7.1.2 \
|
||||||
--hash=sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a \
|
--hash=sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a \
|
||||||
--hash=sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc
|
--hash=sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc
|
||||||
|
@ -305,7 +305,7 @@ cssselect==1.1.0 \
|
||||||
# parsel
|
# parsel
|
||||||
# premailer
|
# premailer
|
||||||
# scrapy
|
# scrapy
|
||||||
# talon
|
# talon-core
|
||||||
cssutils==1.0.2 \
|
cssutils==1.0.2 \
|
||||||
--hash=sha256:a2fcf06467553038e98fea9cfe36af2bf14063eb147a70958cfcaa8f5786acaf \
|
--hash=sha256:a2fcf06467553038e98fea9cfe36af2bf14063eb147a70958cfcaa8f5786acaf \
|
||||||
--hash=sha256:c74dbe19c92f5052774eadb15136263548dd013250f1ed1027988e7fef125c8d
|
--hash=sha256:c74dbe19c92f5052774eadb15136263548dd013250f1ed1027988e7fef125c8d
|
||||||
|
@ -427,6 +427,10 @@ html2text==2020.1.16 \
|
||||||
# via
|
# via
|
||||||
# -r requirements/common.in
|
# -r requirements/common.in
|
||||||
# zulip-bots
|
# zulip-bots
|
||||||
|
html5lib==1.1 \
|
||||||
|
--hash=sha256:0d78f8fde1c230e99fe37986a60526d7049ed4bf8a9fadbad5f00e22e58e041d \
|
||||||
|
--hash=sha256:b2e5b40261e20f354d198eae92afc10d750afb487ed5e50f9c4eaf07c184146f
|
||||||
|
# via talon-core
|
||||||
hyper==0.7.0 \
|
hyper==0.7.0 \
|
||||||
--hash=sha256:069514f54231fb7b5df2fb910a114663a83306d5296f588fffcb0a9be19407fc \
|
--hash=sha256:069514f54231fb7b5df2fb910a114663a83306d5296f588fffcb0a9be19407fc \
|
||||||
--hash=sha256:12c82eacd122a659673484c1ea0d34576430afbe5aa6b8f63fe37fcb06a2458c
|
--hash=sha256:12c82eacd122a659673484c1ea0d34576430afbe5aa6b8f63fe37fcb06a2458c
|
||||||
|
@ -694,7 +698,7 @@ lxml==4.6.2 \
|
||||||
# pyoembed
|
# pyoembed
|
||||||
# python3-saml
|
# python3-saml
|
||||||
# scrapy
|
# scrapy
|
||||||
# talon
|
# talon-core
|
||||||
# xmlsec
|
# xmlsec
|
||||||
# zulip-bots
|
# zulip-bots
|
||||||
markdown-include==0.6.0 \
|
markdown-include==0.6.0 \
|
||||||
|
@ -1243,7 +1247,7 @@ regex==2020.11.13 \
|
||||||
--hash=sha256:f8f295db00ef5f8bae530fc39af0b40486ca6068733fb860b42115052206466f
|
--hash=sha256:f8f295db00ef5f8bae530fc39af0b40486ca6068733fb860b42115052206466f
|
||||||
# via
|
# via
|
||||||
# black
|
# black
|
||||||
# talon
|
# talon-core
|
||||||
requests-oauthlib==1.3.0 \
|
requests-oauthlib==1.3.0 \
|
||||||
--hash=sha256:7f71572defaecd16372f9006f33c2ec8c077c3cfa6f5911a9a90202beb513f3d \
|
--hash=sha256:7f71572defaecd16372f9006f33c2ec8c077c3cfa6f5911a9a90202beb513f3d \
|
||||||
--hash=sha256:b4261601a71fd721a8bd6d7aa1cc1d6a8a93b4a9f5e96626f8e4d91e8beeaa6a
|
--hash=sha256:b4261601a71fd721a8bd6d7aa1cc1d6a8a93b4a9f5e96626f8e4d91e8beeaa6a
|
||||||
|
@ -1346,6 +1350,7 @@ six==1.15.0 \
|
||||||
# argon2-cffi
|
# argon2-cffi
|
||||||
# automat
|
# automat
|
||||||
# django-bitfield
|
# django-bitfield
|
||||||
|
# html5lib
|
||||||
# isodate
|
# isodate
|
||||||
# jsonschema
|
# jsonschema
|
||||||
# junit-xml
|
# junit-xml
|
||||||
|
@ -1364,7 +1369,7 @@ six==1.15.0 \
|
||||||
# responses
|
# responses
|
||||||
# social-auth-app-django
|
# social-auth-app-django
|
||||||
# social-auth-core
|
# social-auth-core
|
||||||
# talon
|
# talon-core
|
||||||
# traitlets
|
# traitlets
|
||||||
# twilio
|
# twilio
|
||||||
# w3lib
|
# w3lib
|
||||||
|
@ -1494,8 +1499,8 @@ tabulate==0.8.9 \
|
||||||
--hash=sha256:d7c013fe7abbc5e491394e10fa845f8f32fe54f8dc60c6622c6cf482d25d47e4 \
|
--hash=sha256:d7c013fe7abbc5e491394e10fa845f8f32fe54f8dc60c6622c6cf482d25d47e4 \
|
||||||
--hash=sha256:eb1d13f25760052e8931f2ef80aaf6045a6cceb47514db8beab24cded16f13a7
|
--hash=sha256:eb1d13f25760052e8931f2ef80aaf6045a6cceb47514db8beab24cded16f13a7
|
||||||
# via pyre-check
|
# via pyre-check
|
||||||
https://github.com/zulip/talon/archive/7d8bdc4dbcfcc5a73298747293b99fe53da55315.zip#egg=talon==1.2.10.zulip1 \
|
https://github.com/zulip/talon/archive/1711705c952806d4a704c7dbf58f21db8e11756a.zip#egg=talon-core==1.4.8.zulip1&subdirectory=talon-core \
|
||||||
--hash=sha256:21d87c437379287d09df7a2d2af7bd818d4fa00be619dff446dacbdb4338d921
|
--hash=sha256:e562269ba5f5d71f35f3dd7ee4c0c62a6c95dfb41984766eff645425c4dec71e
|
||||||
# via -r requirements/common.in
|
# via -r requirements/common.in
|
||||||
tblib==1.7.0 \
|
tblib==1.7.0 \
|
||||||
--hash=sha256:059bd77306ea7b419d4f76016aef6d7027cc8a0785579b5aad198803435f882c \
|
--hash=sha256:059bd77306ea7b419d4f76016aef6d7027cc8a0785579b5aad198803435f882c \
|
||||||
|
@ -1632,6 +1637,7 @@ webencodings==0.5.1 \
|
||||||
--hash=sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923
|
--hash=sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923
|
||||||
# via
|
# via
|
||||||
# cssselect2
|
# cssselect2
|
||||||
|
# html5lib
|
||||||
# tinycss2
|
# tinycss2
|
||||||
werkzeug==1.0.1 \
|
werkzeug==1.0.1 \
|
||||||
--hash=sha256:2de2a5db0baeae7b2d2664949077c2ac63fbd16d98da0ff71837f7d1dea3fd43 \
|
--hash=sha256:2de2a5db0baeae7b2d2664949077c2ac63fbd16d98da0ff71837f7d1dea3fd43 \
|
||||||
|
|
|
@ -103,7 +103,7 @@ cchardet==2.1.7 \
|
||||||
--hash=sha256:f16517f3697569822c6d09671217fdeab61dfebc7acb5068634d6b0728b86c0b \
|
--hash=sha256:f16517f3697569822c6d09671217fdeab61dfebc7acb5068634d6b0728b86c0b \
|
||||||
--hash=sha256:f86e0566cb61dc4397297696a4a1b30f6391b50bc52b4f073507a48466b6255a \
|
--hash=sha256:f86e0566cb61dc4397297696a4a1b30f6391b50bc52b4f073507a48466b6255a \
|
||||||
--hash=sha256:fdac1e4366d0579fff056d1280b8dc6348be964fda8ebb627c0269e097ab37fa
|
--hash=sha256:fdac1e4366d0579fff056d1280b8dc6348be964fda8ebb627c0269e097ab37fa
|
||||||
# via talon
|
# via talon-core
|
||||||
certifi==2020.12.5 \
|
certifi==2020.12.5 \
|
||||||
--hash=sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c \
|
--hash=sha256:1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c \
|
||||||
--hash=sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830
|
--hash=sha256:719a74fb9e33b9bd44cc7f3a8d94bc35e4049deebe19ba7d8e108280cfd59830
|
||||||
|
@ -156,7 +156,7 @@ chardet==4.0.0 \
|
||||||
--hash=sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5
|
--hash=sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5
|
||||||
# via
|
# via
|
||||||
# requests
|
# requests
|
||||||
# talon
|
# talon-core
|
||||||
cryptography==3.4.6 \
|
cryptography==3.4.6 \
|
||||||
--hash=sha256:066bc53f052dfeda2f2d7c195cf16fb3e5ff13e1b6b7415b468514b40b381a5b \
|
--hash=sha256:066bc53f052dfeda2f2d7c195cf16fb3e5ff13e1b6b7415b468514b40b381a5b \
|
||||||
--hash=sha256:0923ba600d00718d63a3976f23cab19aef10c1765038945628cd9be047ad0336 \
|
--hash=sha256:0923ba600d00718d63a3976f23cab19aef10c1765038945628cd9be047ad0336 \
|
||||||
|
@ -181,7 +181,7 @@ cssselect==1.1.0 \
|
||||||
--hash=sha256:f95f8dedd925fd8f54edb3d2dfb44c190d9d18512377d3c1e2388d16126879bc
|
--hash=sha256:f95f8dedd925fd8f54edb3d2dfb44c190d9d18512377d3c1e2388d16126879bc
|
||||||
# via
|
# via
|
||||||
# premailer
|
# premailer
|
||||||
# talon
|
# talon-core
|
||||||
cssutils==1.0.2 \
|
cssutils==1.0.2 \
|
||||||
--hash=sha256:a2fcf06467553038e98fea9cfe36af2bf14063eb147a70958cfcaa8f5786acaf \
|
--hash=sha256:a2fcf06467553038e98fea9cfe36af2bf14063eb147a70958cfcaa8f5786acaf \
|
||||||
--hash=sha256:c74dbe19c92f5052774eadb15136263548dd013250f1ed1027988e7fef125c8d
|
--hash=sha256:c74dbe19c92f5052774eadb15136263548dd013250f1ed1027988e7fef125c8d
|
||||||
|
@ -279,6 +279,10 @@ html2text==2020.1.16 \
|
||||||
# via
|
# via
|
||||||
# -r requirements/common.in
|
# -r requirements/common.in
|
||||||
# zulip-bots
|
# zulip-bots
|
||||||
|
html5lib==1.1 \
|
||||||
|
--hash=sha256:0d78f8fde1c230e99fe37986a60526d7049ed4bf8a9fadbad5f00e22e58e041d \
|
||||||
|
--hash=sha256:b2e5b40261e20f354d198eae92afc10d750afb487ed5e50f9c4eaf07c184146f
|
||||||
|
# via talon-core
|
||||||
hyper==0.7.0 \
|
hyper==0.7.0 \
|
||||||
--hash=sha256:069514f54231fb7b5df2fb910a114663a83306d5296f588fffcb0a9be19407fc \
|
--hash=sha256:069514f54231fb7b5df2fb910a114663a83306d5296f588fffcb0a9be19407fc \
|
||||||
--hash=sha256:12c82eacd122a659673484c1ea0d34576430afbe5aa6b8f63fe37fcb06a2458c
|
--hash=sha256:12c82eacd122a659673484c1ea0d34576430afbe5aa6b8f63fe37fcb06a2458c
|
||||||
|
@ -481,7 +485,7 @@ lxml==4.6.2 \
|
||||||
# premailer
|
# premailer
|
||||||
# pyoembed
|
# pyoembed
|
||||||
# python3-saml
|
# python3-saml
|
||||||
# talon
|
# talon-core
|
||||||
# xmlsec
|
# xmlsec
|
||||||
# zulip-bots
|
# zulip-bots
|
||||||
markdown-include==0.6.0 \
|
markdown-include==0.6.0 \
|
||||||
|
@ -854,7 +858,7 @@ regex==2020.11.13 \
|
||||||
--hash=sha256:e3faaf10a0d1e8e23a9b51d1900b72e1635c2d5b0e1bea1c18022486a8e2e52d \
|
--hash=sha256:e3faaf10a0d1e8e23a9b51d1900b72e1635c2d5b0e1bea1c18022486a8e2e52d \
|
||||||
--hash=sha256:f7d29a6fc4760300f86ae329e3b6ca28ea9c20823df123a2ea8693e967b29917 \
|
--hash=sha256:f7d29a6fc4760300f86ae329e3b6ca28ea9c20823df123a2ea8693e967b29917 \
|
||||||
--hash=sha256:f8f295db00ef5f8bae530fc39af0b40486ca6068733fb860b42115052206466f
|
--hash=sha256:f8f295db00ef5f8bae530fc39af0b40486ca6068733fb860b42115052206466f
|
||||||
# via talon
|
# via talon-core
|
||||||
requests-oauthlib==1.3.0 \
|
requests-oauthlib==1.3.0 \
|
||||||
--hash=sha256:7f71572defaecd16372f9006f33c2ec8c077c3cfa6f5911a9a90202beb513f3d \
|
--hash=sha256:7f71572defaecd16372f9006f33c2ec8c077c3cfa6f5911a9a90202beb513f3d \
|
||||||
--hash=sha256:b4261601a71fd721a8bd6d7aa1cc1d6a8a93b4a9f5e96626f8e4d91e8beeaa6a
|
--hash=sha256:b4261601a71fd721a8bd6d7aa1cc1d6a8a93b4a9f5e96626f8e4d91e8beeaa6a
|
||||||
|
@ -891,6 +895,7 @@ six==1.15.0 \
|
||||||
# via
|
# via
|
||||||
# argon2-cffi
|
# argon2-cffi
|
||||||
# django-bitfield
|
# django-bitfield
|
||||||
|
# html5lib
|
||||||
# isodate
|
# isodate
|
||||||
# jsonschema
|
# jsonschema
|
||||||
# libthumbor
|
# libthumbor
|
||||||
|
@ -903,7 +908,7 @@ six==1.15.0 \
|
||||||
# qrcode
|
# qrcode
|
||||||
# social-auth-app-django
|
# social-auth-app-django
|
||||||
# social-auth-core
|
# social-auth-core
|
||||||
# talon
|
# talon-core
|
||||||
# traitlets
|
# traitlets
|
||||||
# twilio
|
# twilio
|
||||||
# zulip
|
# zulip
|
||||||
|
@ -978,8 +983,8 @@ stripe==2.56.0 \
|
||||||
--hash=sha256:2ff904fb8dee0d25f135059468a876852d24dc8cbe0b45d7aff56a028045777c \
|
--hash=sha256:2ff904fb8dee0d25f135059468a876852d24dc8cbe0b45d7aff56a028045777c \
|
||||||
--hash=sha256:6c685eeadf9e3608315b6d84b4f5f2da2909179b65633ce20f296be22ed21a98
|
--hash=sha256:6c685eeadf9e3608315b6d84b4f5f2da2909179b65633ce20f296be22ed21a98
|
||||||
# via -r requirements/common.in
|
# via -r requirements/common.in
|
||||||
https://github.com/zulip/talon/archive/7d8bdc4dbcfcc5a73298747293b99fe53da55315.zip#egg=talon==1.2.10.zulip1 \
|
https://github.com/zulip/talon/archive/1711705c952806d4a704c7dbf58f21db8e11756a.zip#egg=talon-core==1.4.8.zulip1&subdirectory=talon-core \
|
||||||
--hash=sha256:21d87c437379287d09df7a2d2af7bd818d4fa00be619dff446dacbdb4338d921
|
--hash=sha256:e562269ba5f5d71f35f3dd7ee4c0c62a6c95dfb41984766eff645425c4dec71e
|
||||||
# via -r requirements/common.in
|
# via -r requirements/common.in
|
||||||
tlds==2021030200 \
|
tlds==2021030200 \
|
||||||
--hash=sha256:9125f332682e2686503d00642f9059069b440fe452511671bbe52848a7ccdcdb \
|
--hash=sha256:9125f332682e2686503d00642f9059069b440fe452511671bbe52848a7ccdcdb \
|
||||||
|
@ -1027,6 +1032,10 @@ wcwidth==0.2.5 \
|
||||||
--hash=sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784 \
|
--hash=sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784 \
|
||||||
--hash=sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83
|
--hash=sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83
|
||||||
# via prompt-toolkit
|
# via prompt-toolkit
|
||||||
|
webencodings==0.5.1 \
|
||||||
|
--hash=sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78 \
|
||||||
|
--hash=sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923
|
||||||
|
# via html5lib
|
||||||
werkzeug==1.0.1 \
|
werkzeug==1.0.1 \
|
||||||
--hash=sha256:2de2a5db0baeae7b2d2664949077c2ac63fbd16d98da0ff71837f7d1dea3fd43 \
|
--hash=sha256:2de2a5db0baeae7b2d2664949077c2ac63fbd16d98da0ff71837f7d1dea3fd43 \
|
||||||
--hash=sha256:6c80b1e5ad3665290ea39320b91e1be1e0d5f60652b964a3070216de83d2e47c
|
--hash=sha256:6c80b1e5ad3665290ea39320b91e1be1e0d5f60652b964a3070216de83d2e47c
|
||||||
|
|
|
@ -20,8 +20,8 @@ VENV_DEPENDENCIES = [
|
||||||
"python3-dev", # Needed to install typed-ast dependency of mypy
|
"python3-dev", # Needed to install typed-ast dependency of mypy
|
||||||
"python3-pip",
|
"python3-pip",
|
||||||
"virtualenv",
|
"virtualenv",
|
||||||
"libxml2-dev", # Used for installing talon and python-xmlsec
|
"libxml2-dev", # Used for installing talon-core and python-xmlsec
|
||||||
"libxslt1-dev", # Used for installing talon
|
"libxslt1-dev", # Used for installing talon-core
|
||||||
"libpq-dev", # Needed by psycopg2
|
"libpq-dev", # Needed by psycopg2
|
||||||
"libssl-dev", # Needed to build pycurl and other libraries
|
"libssl-dev", # Needed to build pycurl and other libraries
|
||||||
"libmagic1", # Used for install python-magic
|
"libmagic1", # Used for install python-magic
|
||||||
|
|
|
@ -45,4 +45,4 @@ API_FEATURE_LEVEL = 43
|
||||||
# historical commits sharing the same major version, in which case a
|
# historical commits sharing the same major version, in which case a
|
||||||
# minor version bump suffices.
|
# minor version bump suffices.
|
||||||
|
|
||||||
PROVISION_VERSION = "133.0"
|
PROVISION_VERSION = "134.0"
|
||||||
|
|
|
@ -280,11 +280,11 @@ talon_initialized = False
|
||||||
|
|
||||||
|
|
||||||
def extract_plaintext_body(message: EmailMessage, include_quotes: bool = False) -> Optional[str]:
|
def extract_plaintext_body(message: EmailMessage, include_quotes: bool = False) -> Optional[str]:
|
||||||
import talon
|
import talon_core
|
||||||
|
|
||||||
global talon_initialized
|
global talon_initialized
|
||||||
if not talon_initialized:
|
if not talon_initialized:
|
||||||
talon.init()
|
talon_core.init()
|
||||||
talon_initialized = True
|
talon_initialized = True
|
||||||
|
|
||||||
plaintext_content = get_message_part_by_type(message, "text/plain")
|
plaintext_content = get_message_part_by_type(message, "text/plain")
|
||||||
|
@ -292,17 +292,17 @@ def extract_plaintext_body(message: EmailMessage, include_quotes: bool = False)
|
||||||
if include_quotes:
|
if include_quotes:
|
||||||
return plaintext_content
|
return plaintext_content
|
||||||
else:
|
else:
|
||||||
return talon.quotations.extract_from_plain(plaintext_content)
|
return talon_core.quotations.extract_from_plain(plaintext_content)
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
def extract_html_body(message: EmailMessage, include_quotes: bool = False) -> Optional[str]:
|
def extract_html_body(message: EmailMessage, include_quotes: bool = False) -> Optional[str]:
|
||||||
import talon
|
import talon_core
|
||||||
|
|
||||||
global talon_initialized
|
global talon_initialized
|
||||||
if not talon_initialized: # nocoverage
|
if not talon_initialized: # nocoverage
|
||||||
talon.init()
|
talon_core.init()
|
||||||
talon_initialized = True
|
talon_initialized = True
|
||||||
|
|
||||||
html_content = get_message_part_by_type(message, "text/html")
|
html_content = get_message_part_by_type(message, "text/html")
|
||||||
|
@ -310,7 +310,7 @@ def extract_html_body(message: EmailMessage, include_quotes: bool = False) -> Op
|
||||||
if include_quotes:
|
if include_quotes:
|
||||||
return convert_html_to_markdown(html_content)
|
return convert_html_to_markdown(html_content)
|
||||||
else:
|
else:
|
||||||
return convert_html_to_markdown(talon.quotations.extract_from_html(html_content))
|
return convert_html_to_markdown(talon_core.quotations.extract_from_html(html_content))
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue