Cleanup and fix setup.py
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
import re
|
||||
import json
|
||||
import magic
|
||||
import urllib.request
|
||||
|
||||
from matrix_client.errors import MatrixRequestError
|
||||
|
||||
|
||||
@@ -7,20 +7,6 @@ from matrix_client.errors import MatrixError, MatrixRequestError
|
||||
|
||||
|
||||
class AsyncHTTPAPI(MatrixHttpApi):
|
||||
"""
|
||||
Contains all raw matrix HTTP client-server API calls using asyncio and coroutines.
|
||||
Examples
|
||||
--------
|
||||
.. code-block: python
|
||||
async def main():
|
||||
async with aiohttp.ClientSession() as session:
|
||||
mapi = AsyncHTTPAPI("http://matrix.org", session)
|
||||
resp = await mapi.get_room_id("#matrix:matrix.org")
|
||||
print(resp)
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.run_until_complete(main())
|
||||
"""
|
||||
|
||||
def __init__(self, base_url, client_session, token=None, identity=None):
|
||||
self.base_url = base_url
|
||||
self.token = token
|
||||
@@ -79,12 +65,6 @@ class AsyncHTTPAPI(MatrixHttpApi):
|
||||
return content.get('avatar_url', None)
|
||||
|
||||
async def get_room_id(self, room_alias):
|
||||
"""Get room id from its alias
|
||||
Args:
|
||||
room_alias(str): The room alias name.
|
||||
Returns:
|
||||
Wanted room's id.
|
||||
"""
|
||||
content = await self._send(
|
||||
"GET",
|
||||
"/directory/room/{}".format(quote(room_alias)),
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ aiohttp
|
||||
ruamel.yaml
|
||||
python-magic
|
||||
SQLAlchemy
|
||||
git+git://github.com/LonamiWebs/Telethon@asyncio#egg=Telethon
|
||||
-e git+git://github.com/LonamiWebs/Telethon@asyncio#egg=Telethon
|
||||
Markdown
|
||||
Pillow
|
||||
future-fstrings
|
||||
|
||||
@@ -14,7 +14,6 @@ setuptools.setup(
|
||||
packages=setuptools.find_packages(),
|
||||
|
||||
install_requires=[
|
||||
"Telethon>=0.17.0.0,<0.18",
|
||||
"aiohttp>=2.3.10,<3",
|
||||
"SQLAlchemy>=1.2.2,<2",
|
||||
"Markdown>=2.6.11,<3",
|
||||
@@ -24,7 +23,8 @@ setuptools.setup(
|
||||
"python-magic>=0.4.15,<0.5",
|
||||
],
|
||||
dependency_links=[
|
||||
"https://github.com/Cadair/matrix-python-sdk/tarball/1fab9821d98d15769e44e66f714d00a32a48d692#egg=matrix_client"
|
||||
"https://github.com/Cadair/matrix-python-sdk/tarball/1fab9821d98d15769e44e66f714d00a32a48d692#egg=matrix_client",
|
||||
"https://github.com/LonamiWebs/Telethon/tarball/7da092894b306d720cc60c04daa2bfba58f81946#egg=Telethon"
|
||||
],
|
||||
|
||||
classifiers=[
|
||||
|
||||
Reference in New Issue
Block a user