diff --git a/matrix_client/api.py b/matrix_client/api.py index 3b866f89..6c17f878 100644 --- a/matrix_client/api.py +++ b/matrix_client/api.py @@ -121,12 +121,12 @@ def register(self, content={}, kind='user'): | session (string): The value of the session key given by the | homeserver. - | type (string): Required. The login type that the client is attempting - | to complete. "m.login.dummy" is the only non-interactive type. + | type (string): Required. The login type that the client is + | attempting to complete. "m.login.dummy" is the only + | non-interactive type. kind (str): Specify kind="guest" to register as guest. """ - query_params['kind'] = kind return self._send( "POST", "/register", @@ -209,7 +209,7 @@ def send_state_event(self, room_id, event_type, content, state_key="", event_type(str): The state event type to send. content(dict): The JSON content to send. state_key(str): Optional. The state key for the event. - timestamp (int): Optional. Set origin_server_ts (For application services only) + timestamp (int): Set origin_server_ts (For application services only) """ path = "/rooms/%s/state/%s" % ( quote(room_id), quote(event_type), @@ -230,7 +230,7 @@ def send_message_event(self, room_id, event_type, content, txn_id=None, event_type (str): The event type to send. content (dict): The JSON content to send. txn_id (int): Optional. The transaction ID to use. - timestamp (int): Optional. Set origin_server_ts (For application services only) + timestamp (int): Set origin_server_ts (For application services only) """ if not txn_id: txn_id = str(self.txn_id) + str(int(time() * 1000)) @@ -298,7 +298,7 @@ def send_location(self, room_id, geo_uri, name, thumb_url=None, thumb_info=None, name (str): Description for the location. thumb_url (str): URL to the thumbnail of the location. thumb_info (dict): Metadata about the thumbnail, type ImageInfo. - timestamp (int): Optional. Set origin_server_ts (For application services only) + timestamp (int): Set origin_server_ts (For application services only) """ content_pack = { "geo_uri": geo_uri, @@ -319,7 +319,7 @@ def send_message(self, room_id, text_content, msgtype="m.text", timestamp=None): Args: room_id (str): The room ID to send the event in. text_content (str): The m.text body to send. - timestamp (int): Optional. Set origin_server_ts (For application services only) + timestamp (int): Set origin_server_ts (For application services only) """ return self.send_message_event( room_id, "m.room.message", @@ -333,7 +333,7 @@ def send_emote(self, room_id, text_content, timestamp=None): Args: room_id (str): The room ID to send the event in. text_content (str): The m.emote body to send. - timestamp (int): Optional. Set origin_server_ts (For application services only) + timestamp (int): Set origin_server_ts (For application services only) """ return self.send_message_event( room_id, "m.room.message", @@ -347,7 +347,7 @@ def send_notice(self, room_id, text_content, timestamp=None): Args: room_id (str): The room ID to send the event in. text_content (str): The m.notice body to send. - timestamp (int): Optional. Set origin_server_ts (For application services only) + timestamp (int): Set origin_server_ts (For application services only) """ body = { "msgtype": "m.notice", @@ -391,7 +391,7 @@ def set_room_name(self, room_id, name, timestamp=None): Args: room_id (str): The room ID name (str): The new room name - timestamp (int): Optional. Set origin_server_ts (For application services only) + timestamp (int): Set origin_server_ts (For application services only) """ body = { "name": name @@ -410,7 +410,7 @@ def set_room_topic(self, room_id, topic, timestamp=None): Args: room_id (str): The room ID topic (str): The new room topic - timestamp (int): Optional. Set origin_server_ts (For application services only) + timestamp (int): Set origin_server_ts (For application services only) """ body = { "topic": topic @@ -433,10 +433,11 @@ def set_power_levels(self, room_id, content): in the content arg are reset to default values. Args: - room_id(str): The room ID - content(dict): The JSON content to send. See example content below. + room_id (str): The room ID + content (dict): The JSON content to send. See example content below. + + Example:: - Usage: api = MatrixHttpApi("http://example.com", token="foobar") api.set_power_levels("!exampleroom:example.com", { @@ -512,12 +513,13 @@ def get_membership(self, room_id, user_id): def set_membership(self, room_id, user_id, membership, reason="", profile={}, timestamp=None): """Perform PUT /rooms/$room_id/state/m.room.member/$user_id + Args: room_id (str): The room ID user_id (str): The user ID membership (str): New membership value reason (str): The reason - timestamp (int): Optional. Set origin_server_ts (For application services only) + timestamp (int): Set origin_server_ts (For application services only) """ body = { "membership": membership, diff --git a/tox.ini b/tox.ini index ba008ca5..9c766cc6 100644 --- a/tox.ini +++ b/tox.ini @@ -25,8 +25,9 @@ commands = check-manifest [testenv:docs] +deps = .[doc] changedir = docs -commands = sphinx-build -W docs/source docs/build/html +commands = sphinx-build -W source build/html [travis] python =