From c5b966d608b1da67b25801e0520e96c3c89ca434 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Genevi=C3=A8ve=20Boucher?= <genevieve.boucher@umontreal.ca>
Date: Sat, 13 Feb 2021 11:21:28 -0500
Subject: [PATCH] Updating the get_datafiles_list use to avoid having the
 deprecated message Adding print statement when dataset id and datafile id is
 submitted Mini change to print statement

---
 pyiricdata/Client.py   | 2 +-
 pyiricdata/__main__.py | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/pyiricdata/Client.py b/pyiricdata/Client.py
index 80276ee..1125cc4 100755
--- a/pyiricdata/Client.py
+++ b/pyiricdata/Client.py
@@ -103,7 +103,7 @@ class Client:
         except:
             self.datafiles = None
             sys.stderr.write(
-                'get_available_datafiles() method is not ' +
+                'WARNING: get_available_datafiles() method is not ' +
                 'implemented in api/v1 of IRIC-Data\n'
             )
 
diff --git a/pyiricdata/__main__.py b/pyiricdata/__main__.py
index 19ce4c0..893a661 100755
--- a/pyiricdata/__main__.py
+++ b/pyiricdata/__main__.py
@@ -32,6 +32,10 @@ def main():
         dsid = args['dataset_id']
         dfid = args['datafile_id']
 
+        if dfid and dsid:
+            print("You've submitted a datafile id and a dataset id")
+            print("Dataset ID will be ignored")
+
         if dfid:
             print('Datafile ID: OK')
         else:
@@ -45,7 +49,7 @@ def main():
                     print('No dataset for user %s' % args['username'])
                     return
 
-            df = client.get_dataset_filelist(dsid)
+            df = client.get_datafiles_list(dataset_id=dsid)
             if not df.empty:
                 print(df)
                 print('Download datafile using ID or complete dataset using "all"')
@@ -88,7 +92,7 @@ def main():
         print(client.labs)
         print(client.datasets)
         dsid = input('Enter dataset ID: ')
-        df = client.get_dataset_filelist(dsid)
+        df = client.get_datafiles_list(dataset_id=dsid)
         if not df.empty:
             print(df)
             file_id = input('Enter file ID: ')
-- 
GitLab