Fix header and convert comments to docstrings in PSK_Adapter
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Wed, 13 Mar 2019 15:54:17 +0300
changeset 2544 640d639d9bd8
parent 2543 2befed4d6ca8
child 2545 1cc6390a7c0b
Fix header and convert comments to docstrings in PSK_Adapter
connectors/PYRO/PSK_Adapter.py
--- a/connectors/PYRO/PSK_Adapter.py	Wed Mar 13 15:43:45 2019 +0300
+++ b/connectors/PYRO/PSK_Adapter.py	Wed Mar 13 15:54:17 2019 +0300
@@ -1,3 +1,33 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# This file is part of Beremiz, a Integrated Development Environment for
+# programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
+#
+# Copyright (C) 2019: Edouard TISSERANT
+#
+# See COPYING file for copyrights details.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+
+
+"""
+The TLS-PSK adapter that handles SSL connections instead of regular sockets,
+but using Pre Shared Keys instead of Certificates
+"""
+
 from __future__ import absolute_import
 from __future__ import print_function
 
@@ -12,13 +42,13 @@
 from Pyro.util import Log
 
 
-# The TLS-PSK adapter that handles SSL connections instead of regular sockets,
-# but using Pre Shared Keys instead of Certificates
-#
 class PYROPSKAdapter(PYROAdapter):
-    # This is essentialy the same as in Pyro/protocol.py
-    # only raw_sock wrapping into sock through sslpsk.wrap_socket was added
-    # Pyro unfortunately doesn't allow cleaner customization
+    """
+    This is essentialy the same as in Pyro/protocol.py
+    only raw_sock wrapping into sock through sslpsk.wrap_socket was added
+    Pyro unfortunately doesn't allow cleaner customization
+    """
+
     def bindToURI(self, URI):
         with self.lock:   # only 1 thread at a time can bind the URI
             try: