Skip to content

Commit

Permalink
docs: Update basic usage with better wording for examples. (tektronix#83
Browse files Browse the repository at this point in the history
)

Signed-off-by: v12ganesh [email protected]
  • Loading branch information
nfelt14 authored Nov 3, 2023
1 parent 83bb987 commit 53e4547
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
16 changes: 12 additions & 4 deletions docs/basic_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ This will print the available VISA devices to the console when run from a shell

## Adding devices

Configure device connections as needed using the
[config file](configuration.md#config-file), an
[environment variable](configuration.md#environment-variable), or
via [Python code](configuration.md#python-code) (shown here). See the
[Configuration guide](configuration.md) for more information on how to
configure devices to connect with.

```{literalinclude} ../examples/miscellaneous/adding_devices.py
---
language: python
Expand All @@ -35,9 +42,10 @@ language: python

## Adding devices with environment variables

Configure device environment variables as needed using the config file or
[Python](#adding-devices). See the [Configuration guide](configuration.md) for
more information on how to do that.
Device configuration information can be defined in an
[environment variable](configuration.md#environment-variable), usually done
outside the Python code for ease of automation
(shown inside the Python code here for demonstration purposes).

```{literalinclude} ../examples/miscellaneous/adding_devices_with_env_var.py
---
Expand Down Expand Up @@ -148,6 +156,6 @@ In order to do this a few things will need to be created:
```{literalinclude} ../examples/miscellaneous/custom_device_driver_support.py
---
language: python
emphasize-lines: 9-14,21-23,26
emphasize-lines: 7-12,19-21,28-30
---
```
2 changes: 1 addition & 1 deletion src/tm_devices/driver_mixins/class_extension_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def wrap(function: Callable[[_EM], _T]) -> None:

# Handle being called as @add_property() with parens.
if method is None:
return wrap
return wrap # pyright: ignore[reportUnknownVariableType]

# called as @add_property without parens.
return wrap(method)

0 comments on commit 53e4547

Please sign in to comment.