File: auto_monitor.py

package info (click to toggle)
pytango 10.1.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,304 kB
  • sloc: python: 27,795; cpp: 16,150; sql: 252; sh: 152; makefile: 43
file content (44 lines) | stat: -rw-r--r-- 1,014 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# SPDX-FileCopyrightText: All Contributors to the PyTango project
# SPDX-License-Identifier: LGPL-3.0-or-later

"""
This is an internal PyTango module.
"""

__all__ = ("auto_monitor_init",)

__docformat__ = "restructuredtext"

from tango import AutoTangoMonitor, AutoTangoAllowThreads


def __AutoTangoMonitor__enter__(self):
    self._acquire()
    return self


def __AutoTangoMonitor__exit__(self, *args, **kwargs):
    self._release()


def __init_AutoTangoMonitor():
    AutoTangoMonitor.__enter__ = __AutoTangoMonitor__enter__
    AutoTangoMonitor.__exit__ = __AutoTangoMonitor__exit__


def __AutoTangoAllowThreads__enter__(self):
    return self


def __AutoTangoAllowThreads__exit__(self, *args, **kwargs):
    self._acquire()


def __init_AutoTangoAllowThreads():
    AutoTangoAllowThreads.__enter__ = __AutoTangoAllowThreads__enter__
    AutoTangoAllowThreads.__exit__ = __AutoTangoAllowThreads__exit__


def auto_monitor_init(doc=True):
    __init_AutoTangoMonitor()
    __init_AutoTangoAllowThreads()