From ac53e98cd0a97b4df158beae67784df4d58f48cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 11 Jul 2014 07:58:55 +0200 Subject: [PATCH] Add some missing docstrings --- qweechat/config.py | 1 + qweechat/network.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/qweechat/config.py b/qweechat/config.py index ae7585d..2aa5909 100644 --- a/qweechat/config.py +++ b/qweechat/config.py @@ -128,5 +128,6 @@ def write(config): def color_options(): + """Return color options.""" global config_color_options return config_color_options diff --git a/qweechat/network.py b/qweechat/network.py index 78bb0ce..064c45e 100644 --- a/qweechat/network.py +++ b/qweechat/network.py @@ -111,12 +111,15 @@ class Network(QtCore.QObject): self.statusChanged.emit(self.status_disconnected, None) def is_connected(self): + """Return True if the socket is connected, False otherwise.""" return self._socket.state() == QtNetwork.QAbstractSocket.ConnectedState def is_ssl(self): + """Return True if SSL is used, False otherwise.""" return self._ssl def connect_weechat(self, server, port, ssl, password, lines): + """Connect to WeeChat.""" self._server = server try: self._port = int(port) @@ -139,6 +142,7 @@ class Network(QtCore.QObject): self.statusChanged.emit(self.status_connecting, None) def disconnect_weechat(self): + """Disconnect from WeeChat.""" if self._socket.state() == QtNetwork.QAbstractSocket.UnconnectedState: return if self._socket.state() == QtNetwork.QAbstractSocket.ConnectedState: @@ -149,12 +153,15 @@ class Network(QtCore.QObject): self._socket.abort() def send_to_weechat(self, message): + """Send a message to WeeChat.""" self._socket.write(message.encode('utf-8')) def desync_weechat(self): + """Desynchronize from WeeChat.""" self.send_to_weechat('desync\n') def sync_weechat(self): + """Synchronize with WeeChat.""" self.send_to_weechat('\n'.join(_PROTO_SYNC_CMDS)) def status_icon(self, status):