Skip to content

Commit 88dcfc8

Browse files
committed
Use new-style imports in the examples
1 parent f983106 commit 88dcfc8

7 files changed

Lines changed: 13 additions & 13 deletions

File tree

docs/general/index.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ Provide credentials if Yamcs is secured:
2828

2929
.. code-block:: python
3030
31-
from yamcs.client import YamcsClient
32-
from yamcs.core.auth import Credentials
31+
from yamcs.client import Credentials, YamcsClient
3332
3433
credentials = Credentials(username='admin', password='password')
3534
client = YamcsClient('localhost:8090', credentials=credentials)

yamcs-client/examples/alarms.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ def acknowledge_all():
1616
"""Acknowledges all active alarms."""
1717
for alarm in processor.list_alarms():
1818
if not alarm.is_acknowledged:
19-
processor.acknowledge_alarm(alarm, comment="false alarm")
19+
processor.acknowledge_alarm(
20+
alarm.name,
21+
alarm.sequence_number,
22+
comment="false alarm",
23+
)
2024

2125

2226
if __name__ == "__main__":

yamcs-client/examples/authenticate.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from time import sleep
22

3-
from yamcs.client import YamcsClient
4-
from yamcs.core.auth import Credentials
3+
from yamcs.client import Credentials, YamcsClient
54

65
# For this example to work, enable security in Yamcs by
76
# configuring appropriate authentication modules.

yamcs-client/examples/commanding.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from time import sleep
22

3-
from yamcs.client import YamcsClient
4-
from yamcs.tmtc.model import VerificationConfig
3+
from yamcs.client import VerificationConfig, YamcsClient
54

65

76
def issue_command():

yamcs-client/examples/modify_dump.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import struct
22

33
from google.protobuf.internal.encoder import _VarintBytes
4-
from yamcs.core.helpers import split_protobuf_stream
4+
from yamcs.client import split_protobuf_stream
55
from yamcs.protobuf.table import table_pb2
66

77
"""
8-
This file gives some clues as to how one might modify a raw
9-
table dump, for example to manually apply data migrations
8+
This script provides some hints as to how one might modify a
9+
raw table dump, for example to manually apply data migrations
1010
between a dump and restore.
1111
1212
This is a rare use case. The decode/encode logic is not easy

yamcs-client/examples/reconnection.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from time import sleep
22

3-
from yamcs.client import YamcsClient
4-
from yamcs.core.exceptions import ConnectionFailure
3+
from yamcs.client import ConnectionFailure, YamcsClient
54

65
"""
76
Subscription types are modeled as Python futures which cover

yamcs-client/examples/scripting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from yamcs.client.core import YamcsClient
1+
from yamcs.client import YamcsClient
22

33

44
def run_script():

0 commit comments

Comments
 (0)