Skip to content

Commit

Permalink
Merge pull request #152 from ScilifelabDataCentre/fix_methods
Browse files Browse the repository at this point in the history
self.method now set in base, Closes #150

This will probably result in other errors now, but the method is set now at least
  • Loading branch information
i-oden authored Sep 13, 2021
2 parents 8c4632d + 6a46dfa commit 36f57fd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
7 changes: 6 additions & 1 deletion dds_cli/data_getter.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,16 @@ def __init__(
destination: pathlib.Path = pathlib.Path(""),
silent: bool = False,
verify_checksum: bool = False,
method: str = "get",
):

# Initiate DDSBaseClass to authenticate user
super().__init__(
username=username, config=config, project=project, dds_directory=destination
username=username,
config=config,
project=project,
dds_directory=destination,
method=method,
)

# Initiate DataGetter specific attributes
Expand Down
2 changes: 1 addition & 1 deletion dds_cli/data_lister.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def _construct_rich_tree(
# Check if the tree is t0o large to be printed directly
# and use a pager if that is the case
if tree_length > dds_cli.utils.console.height:
with dds_cli.util.console.pager():
with dds_cli.utils.console.pager():
dds_cli.utils.console.print(
Padding(
tree,
Expand Down
7 changes: 2 additions & 5 deletions dds_cli/data_putter.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,11 @@ def __init__(
source: tuple = (),
source_path_file: pathlib.Path = None,
silent: bool = False,
method: str = "put",
):

# Initiate DDSBaseClass to authenticate user
super().__init__(
username=username,
config=config,
project=project,
)
super().__init__(username=username, config=config, project=project, method=method)

# Initiate DataPutter specific attributes
self.break_on_fail = break_on_fail
Expand Down
6 changes: 4 additions & 2 deletions dds_cli/data_remover.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@
class DataRemover(base.DDSBaseClass):
"""Data remover class."""

def __init__(self, project: str, username: str = None, config: pathlib.Path = None):
def __init__(
self, project: str, username: str = None, config: pathlib.Path = None, method: str = "rm"
):

# Initiate DDSBaseClass to authenticate user
super().__init__(username=username, config=config, project=project)
super().__init__(username=username, config=config, project=project, method=method)

# Only method "ls" can use the DataLister class
if self.method != "rm":
Expand Down

0 comments on commit 36f57fd

Please sign in to comment.