-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pyvisa_py: rename main package and update type annotations
- Loading branch information
1 parent
e69916e
commit ac949d5
Showing
18 changed files
with
401 additions
and
284 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# -*- coding: utf-8 -*- | ||
"""Common code. | ||
:copyright: 2014-2020 by PyVISA-sim Authors, see AUTHORS for more details. | ||
:license: MIT, see LICENSE for more details. | ||
""" | ||
import logging | ||
|
||
from pyvisa import logger | ||
|
||
logger = logging.LoggerAdapter(logger, {"backend": "py"}) # type: ignore | ||
|
||
|
||
class NamedObject(object): | ||
"""A class to construct named sentinels.""" | ||
|
||
#: Name used to identify the sentinel | ||
name: str | ||
|
||
def __init__(self, name) -> None: | ||
self.name = name | ||
|
||
def __repr__(self) -> str: | ||
return "<%s>" % self.name | ||
|
||
__str__ = __repr__ | ||
|
||
|
||
int_to_byte = lambda val: val.to_bytes(1, "big") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.