1# -*- coding: utf-8 -*-
2"""Module to provide an import shortcut for the most common VISA operations.
3
4This file is part of PyVISA.
5
6:copyright: 2014-2019 by PyVISA Authors, see AUTHORS for more details.
7:license: MIT, see COPYING for more details.
8
9"""
10
11import warnings
12
13warnings.warn(
14    (
15        "The visa module provided by PyVISA is being deprecated. "
16        "You can replace `import visa` by `import pyvisa as visa` "
17        "to achieve the same effect.\n\n"
18        "The reason for the deprecation is the possible conflict with "
19        "the visa package provided by the "
20        "https://github.com/visa-sdk/visa-python which can result in "
21        "hard to debug situations."
22    ),
23    FutureWarning,
24)
25
26from pyvisa import logger, __version__, log_to_screen, constants
27from pyvisa.highlevel import ResourceManager
28from pyvisa.errors import (
29    Error,
30    VisaIOError,
31    VisaIOWarning,
32    VisaTypeError,
33    UnknownHandler,
34    OSNotSupported,
35    InvalidBinaryFormat,
36    InvalidSession,
37    LibraryError,
38)
39
40# This is needed to registry all resources.
41from pyvisa.resources import Resource
42from pyvisa.cmd_line_tools import visa_main
43
44__all__ = [
45    "ResourceManager",
46    "constants",
47    "logger",
48    "Error",
49    "VisaIOError",
50    "VisaIOWarning",
51    "VisaTypeError",
52    "UnknownHandler",
53    "OSNotSupported",
54    "InvalidBinaryFormat",
55    "InvalidSession",
56    "LibraryError",
57    "log_to_screen",
58]
59
60if __name__ == "__main__":
61    visa_main()
62