Skip to content

Commit

Permalink
Use new style imports
Browse files Browse the repository at this point in the history
  • Loading branch information
fqqb committed Sep 23, 2024
1 parent f6c1328 commit 7242ea2
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/yamcs/cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import argcomplete
import pkg_resources
from yamcs.core.exceptions import Unauthorized
from yamcs.client import Unauthorized

from yamcs.cli import utils
from yamcs.cli.alarms import AlarmsCommand
Expand Down
3 changes: 1 addition & 2 deletions src/yamcs/cli/dbshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
from typing import Any, List

from google.protobuf import json_format
from yamcs.client import YamcsClient
from yamcs.core.exceptions import YamcsError
from yamcs.client import YamcsClient, YamcsError
from yamcs.protobuf.events import events_pb2

from yamcs.cli import utils
Expand Down
5 changes: 2 additions & 3 deletions src/yamcs/cli/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
from getpass import getpass
from typing import Optional

from yamcs.client import YamcsClient
from yamcs.core import auth
from yamcs.client import Credentials, YamcsClient

from yamcs.cli import utils
from yamcs.cli.utils import eprint
Expand Down Expand Up @@ -112,7 +111,7 @@ def read_credentials(self, username=None):
eprint("*** Password may not be empty")
return False

return auth.Credentials(username=username, password=password)
return Credentials(username=username, password=password)

def save_client_config(
self,
Expand Down
3 changes: 1 addition & 2 deletions src/yamcs/cli/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
import tempfile
from typing import Any, List

from yamcs.client import YamcsClient
from yamcs.core.helpers import to_isostring
from yamcs.client import YamcsClient, to_isostring

from yamcs.cli import utils
from yamcs.cli.completers import BucketCompleter, BucketOrObjectCompleter
Expand Down
5 changes: 2 additions & 3 deletions src/yamcs/cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

import pkg_resources
from dateutil import parser
from yamcs.core import auth
from yamcs.core.helpers import parse_server_timestring, to_isostring
from yamcs.client import Credentials, parse_server_timestring, to_isostring

from yamcs.cli.exceptions import NoInstanceError, NoServerError

Expand Down Expand Up @@ -65,7 +64,7 @@ def read_credentials():
access_token = d["access_token"]
refresh_token = d["refresh_token"]
expiry = parse_server_timestring(d["expiry"]) if "expiry" in d else None
return auth.Credentials(
return Credentials(
access_token=access_token,
refresh_token=refresh_token,
expiry=expiry,
Expand Down

0 comments on commit 7242ea2

Please sign in to comment.