Style fixes.
This commit is contained in:
parent
ad208cbb3a
commit
ce718a9259
3 changed files with 21 additions and 23 deletions
8
main.py
8
main.py
|
@ -212,8 +212,8 @@ def try_ssl_handshake(server):
|
||||||
|
|
||||||
message = ("{prefix}Error while doing SSL handshake"
|
message = ("{prefix}Error while doing SSL handshake"
|
||||||
": {error}").format(
|
": {error}").format(
|
||||||
prefix=W.prefix("network"),
|
prefix=W.prefix("network"),
|
||||||
error=str_error)
|
error=str_error)
|
||||||
|
|
||||||
server_buffer_prnt(server, message)
|
server_buffer_prnt(server, message)
|
||||||
|
|
||||||
|
@ -242,8 +242,8 @@ def receive_cb(server_name, file_descriptor):
|
||||||
|
|
||||||
message = ("{prefix}Error while reading from "
|
message = ("{prefix}Error while reading from "
|
||||||
"socket: {error}").format(
|
"socket: {error}").format(
|
||||||
prefix=W.prefix("network"),
|
prefix=W.prefix("network"),
|
||||||
error=str_error)
|
error=str_error)
|
||||||
|
|
||||||
server_buffer_prnt(server, message)
|
server_buffer_prnt(server, message)
|
||||||
|
|
||||||
|
|
|
@ -106,10 +106,10 @@ class MatrixClient:
|
||||||
|
|
||||||
path = ("{api}/rooms/{room}/send/m.room.message/"
|
path = ("{api}/rooms/{room}/send/m.room.message/"
|
||||||
"{tx_id}?{query_parameters}").format(
|
"{tx_id}?{query_parameters}").format(
|
||||||
api=MATRIX_API_PATH,
|
api=MATRIX_API_PATH,
|
||||||
room=quote(room_id),
|
room=quote(room_id),
|
||||||
tx_id=quote(str(self._get_txn_id())),
|
tx_id=quote(str(self._get_txn_id())),
|
||||||
query_parameters=urlencode(query_parameters))
|
query_parameters=urlencode(query_parameters))
|
||||||
|
|
||||||
return HttpRequest(RequestType.PUT, self.host, path, content)
|
return HttpRequest(RequestType.PUT, self.host, path, content)
|
||||||
|
|
||||||
|
@ -146,12 +146,12 @@ class MatrixClient:
|
||||||
return HttpRequest(RequestType.PUT, self.host, path, content)
|
return HttpRequest(RequestType.PUT, self.host, path, content)
|
||||||
|
|
||||||
def room_get_messages(
|
def room_get_messages(
|
||||||
self,
|
self,
|
||||||
room_id,
|
room_id,
|
||||||
start_token,
|
start_token,
|
||||||
end_token="",
|
end_token="",
|
||||||
limit=10,
|
limit=10,
|
||||||
direction='b'
|
direction='b'
|
||||||
):
|
):
|
||||||
query_parameters = {
|
query_parameters = {
|
||||||
"access_token": self.access_token,
|
"access_token": self.access_token,
|
||||||
|
|
|
@ -224,8 +224,8 @@ class MatrixServer:
|
||||||
|
|
||||||
message = ("{prefix}Error while writing to "
|
message = ("{prefix}Error while writing to "
|
||||||
"socket: {error}").format(
|
"socket: {error}").format(
|
||||||
prefix=W.prefix("network"),
|
prefix=W.prefix("network"),
|
||||||
error=strerr)
|
error=strerr)
|
||||||
|
|
||||||
server_buffer_prnt(self, message)
|
server_buffer_prnt(self, message)
|
||||||
server_buffer_prnt(
|
server_buffer_prnt(
|
||||||
|
@ -242,7 +242,7 @@ class MatrixServer:
|
||||||
server_buffer_prnt(
|
server_buffer_prnt(
|
||||||
self,
|
self,
|
||||||
"{prefix}matrix: Error while writing to socket".format(
|
"{prefix}matrix: Error while writing to socket".format(
|
||||||
W.prefix("network")))
|
prefix=W.prefix("network")))
|
||||||
server_buffer_prnt(
|
server_buffer_prnt(
|
||||||
self,
|
self,
|
||||||
("{prefix}matrix: disconnecting from server...").format(
|
("{prefix}matrix: disconnecting from server...").format(
|
||||||
|
@ -379,10 +379,10 @@ class MatrixServer:
|
||||||
|
|
||||||
message = ("{prefix}matrix: Connecting to "
|
message = ("{prefix}matrix: Connecting to "
|
||||||
"{server}:{port}{ssl}...").format(
|
"{server}:{port}{ssl}...").format(
|
||||||
prefix=W.prefix("network"),
|
prefix=W.prefix("network"),
|
||||||
server=self.address,
|
server=self.address,
|
||||||
port=self.port,
|
port=self.port,
|
||||||
ssl=ssl_message)
|
ssl=ssl_message)
|
||||||
|
|
||||||
W.prnt(self.server_buffer, message)
|
W.prnt(self.server_buffer, message)
|
||||||
|
|
||||||
|
@ -499,5 +499,3 @@ def send_cb(server_name, file_descriptor):
|
||||||
server.try_send(server, server.send_buffer)
|
server.try_send(server, server.send_buffer)
|
||||||
|
|
||||||
return W.WEECHAT_RC_OK
|
return W.WEECHAT_RC_OK
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue