| 1 |
# |
| 2 |
# This file is part of the PyMeasure package. |
| 3 |
# |
| 4 |
# Copyright (c) 2013-2024 PyMeasure Developers |
| 5 |
# |
| 6 |
# Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 |
# of this software and associated documentation files (the "Software"), to deal |
| 8 |
# in the Software without restriction, including without limitation the rights |
| 9 |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 |
# copies of the Software, and to permit persons to whom the Software is |
| 11 |
# furnished to do so, subject to the following conditions: |
| 12 |
# |
| 13 |
# The above copyright notice and this permission notice shall be included in |
| 14 |
# all copies or substantial portions of the Software. |
| 15 |
# |
| 16 |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 |
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 |
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 |
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 |
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 |
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 22 |
# THE SOFTWARE. |
| 23 |
# |
| 24 |
|
| 25 |
from .adapter import Adapter |
| 26 |
|
| 27 |
|
| 28 |
class TelnetAdapter(Adapter): |
| 29 |
""" Adapter class for using the Python telnetlib package to allow |
| 30 |
communication to instruments |
| 31 |
|
| 32 |
This Adapter has been removed from service as the underlying library is missing! |
| 33 |
|
| 34 |
.. deprecated:: 0.11.2 |
| 35 |
The Python telnetlib module is deprecated since Python 3.11 and will be removed |
| 36 |
in Python 3.13 release. |
| 37 |
As a result, TelnetAdapter is deprecated, use VISAAdapter instead. |
| 38 |
The VISAAdapter supports TCPIP socket connections. When using the VISAAdapter, |
| 39 |
the `resource_name` argument should be `TCPIP[board]::<host>::<port>::SOCKET`. |
| 40 |
see here, <https://pyvisa.readthedocs.io/en/latest/introduction/names.html> |
| 41 |
""" |
| 42 |
|
| 43 |
def __init__(self, host, port=0, query_delay=0, preprocess_reply=None, |
| 44 |
**kwargs): |
| 45 |
raise NotImplementedError( |
| 46 |
"The TelnetAdapter has been removed, as the telnetlib module is deprecated. " |
| 47 |
"Use the VISAAdapter instead. The VISAAdapter supports TCPIP socket connections. " |
| 48 |
"When using the VISAAdapter, the `resource_name` argument should be " |
| 49 |
"`TCPIP[board]::<host>::<port>::SOCKET`. " |
| 50 |
"see here, <https://pyvisa.readthedocs.io/en/latest/introduction/names.html>") |
| 51 |
|
| 52 |
def __repr__(self): |
| 53 |
return "<TelnetAdapter()>" |