Example #1
0
 def create(self, dataset_id, storagebox, dataset_path, path, render_format):
     """
     Create datafile record(s) for an existing file or for all files
     within a directory.
     """
     # pylint: disable=too-many-arguments
     # pylint: disable=no-self-use
     if os.path.isdir(path):
         num_created = DataFile.create_datafiles(dataset_id, storagebox, dataset_path, path)
         print("%s datafiles created." % num_created)
     else:
         datafile = DataFile.create_datafile(dataset_id, storagebox, dataset_path, path)
         print(render(datafile, render_format))
         print("DataFile created successfully.")
Example #2
0
 def get(self, datafile_id, render_format):
     """
     Display datafile record.
     """
     # pylint: disable=no-self-use
     datafile = DataFile.get(datafile_id)
     print(render(datafile, render_format))
Example #3
0
 def list(self, dataset_id, directory, filename, filters, limit, offset, order_by, render_format):
     """
     Display list of datafile records.
     """
     # pylint: disable=too-many-arguments
     # pylint: disable=no-self-use
     datafiles = DataFile.list(dataset_id, directory, filename, filters, limit, offset, order_by)
     print(render(datafiles, render_format))
Example #4
0
 def update(self, datafile_id, md5sum, render_format):
     """
     Update datafile record.
     """
     # pylint: disable=no-self-use
     datafile = DataFile.update(datafile_id, md5sum)
     print(render(datafile, render_format))
     print("DataFile updated successfully.")
Example #5
0
 def get(self, dataset_id, render_format):
     """
     Display dataset record.
     """
     # pylint: disable=no-self-use
     dataset = Dataset.get(dataset_id)
     print(render(dataset, render_format))
     if render_format == 'table':
         datafiles = DataFile.list(dataset_id)
         print(render(datafiles, render_format))
Example #6
0
 def upload(self, dataset_id, storagebox, dataset_path, file_path):
     """
     Upload datafile.
     """
     # pylint: disable=no-self-use
     DataFile.upload(dataset_id, storagebox, dataset_path, file_path)
Example #7
0
 def download(self, datafile_id):
     """
     Download datafile.
     """
     # pylint: disable=no-self-use
     DataFile.download(datafile_id)
Example #8
0
 def verify(self, datafile_id):
     """
     Ask MyTardis to verify a datafile.
     """
     # pylint: disable=no-self-use
     DataFile.verify(datafile_id)