# HG changeset patch # User Andrey Skvortsov # Date 1552481657 -10800 # Node ID 640d639d9bd8877475bc888e0c8cdd871ed4e4be # Parent 2befed4d6ca80ec2ff279f65c568796053b0eb32 Fix header and convert comments to docstrings in PSK_Adapter diff -r 2befed4d6ca8 -r 640d639d9bd8 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: