Merge branch 'develop'
This commit is contained in:
commit
a13d825702
@ -82,7 +82,7 @@ If no error shows up you are good to go.
|
|||||||
|
|
||||||
>>> import pyrogram
|
>>> import pyrogram
|
||||||
>>> pyrogram.__version__
|
>>> pyrogram.__version__
|
||||||
'0.10.1'
|
'0.10.2'
|
||||||
|
|
||||||
.. _TgCrypto: https://docs.pyrogram.ml/resources/TgCrypto
|
.. _TgCrypto: https://docs.pyrogram.ml/resources/TgCrypto
|
||||||
.. _develop: http://github.com/pyrogram/pyrogram
|
.. _develop: http://github.com/pyrogram/pyrogram
|
||||||
|
@ -23,7 +23,7 @@ __copyright__ = "Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance
|
|||||||
"e" if sys.getfilesystemencoding() != "utf-8" else "\xe8"
|
"e" if sys.getfilesystemencoding() != "utf-8" else "\xe8"
|
||||||
)
|
)
|
||||||
__license__ = "GNU Lesser General Public License v3 or later (LGPLv3+)"
|
__license__ = "GNU Lesser General Public License v3 or later (LGPLv3+)"
|
||||||
__version__ = "0.10.1"
|
__version__ = "0.10.2"
|
||||||
|
|
||||||
from .api.errors import Error
|
from .api.errors import Error
|
||||||
from .client.types import (
|
from .client.types import (
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
from collections import OrderedDict
|
||||||
|
|
||||||
from pyrogram.api.types import (
|
from pyrogram.api.types import (
|
||||||
MessageEntityBold as Bold,
|
MessageEntityBold as Bold,
|
||||||
@ -75,10 +76,11 @@ class HTML:
|
|||||||
text = text.replace(match.group(), body)
|
text = text.replace(match.group(), body)
|
||||||
offset += len(style) * 2 + 5 + (len(url) + 8 if url else 0)
|
offset += len(style) * 2 + 5 + (len(url) + 8 if url else 0)
|
||||||
|
|
||||||
return dict(
|
# TODO: OrderedDict to be removed in Python3.6
|
||||||
message=utils.remove_surrogates(text),
|
return OrderedDict([
|
||||||
entities=entities
|
("message", utils.remove_surrogates(text)),
|
||||||
)
|
("entities", entities)
|
||||||
|
])
|
||||||
|
|
||||||
def unparse(self, message: str, entities: list):
|
def unparse(self, message: str, entities: list):
|
||||||
message = utils.add_surrogates(message).strip()
|
message = utils.add_surrogates(message).strip()
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
from collections import OrderedDict
|
||||||
|
|
||||||
from pyrogram.api.types import (
|
from pyrogram.api.types import (
|
||||||
MessageEntityBold as Bold,
|
MessageEntityBold as Bold,
|
||||||
@ -97,10 +98,11 @@ class Markdown:
|
|||||||
entities.append(entity)
|
entities.append(entity)
|
||||||
message = message.replace(match.group(), body)
|
message = message.replace(match.group(), body)
|
||||||
|
|
||||||
return dict(
|
# TODO: OrderedDict to be removed in Python3.6
|
||||||
message=utils.remove_surrogates(message),
|
return OrderedDict([
|
||||||
entities=entities
|
("message", utils.remove_surrogates(message)),
|
||||||
)
|
("entities", entities)
|
||||||
|
])
|
||||||
|
|
||||||
def unparse(self, message: str, entities: list):
|
def unparse(self, message: str, entities: list):
|
||||||
message = utils.add_surrogates(message).strip()
|
message = utils.add_surrogates(message).strip()
|
||||||
|
Loading…
Reference in New Issue
Block a user