Ejemplo n.º 1
0
 def display_available_datasets_supported_by_dbcollection(self):
     print_text_box('Available datasets for download')
     available_datasets_list = fetch_list_datasets()
     for name in sorted(available_datasets_list):
         tasks = list(sorted(available_datasets_list[name]['tasks'].keys()))
         print('  - {}  {}'.format(name, tasks))
     print('')
Ejemplo n.º 2
0
 def display_registered_datasets_in_cache(self):
     print_text_box('Available datasets in cache for load')
     datasets = self.get_datasets_from_cache()
     for name in sorted(datasets):
         tasks = list(sorted(datasets[name]['tasks'].keys()))
         print('  - {}  {}'.format(name, tasks))
     print('')
Ejemplo n.º 3
0
 def info(self, categories=()):
     """Prints the cache and download data dir paths of the cache."""
     pp = pprint.PrettyPrinter(indent=4)
     print_text_box('Category')
     data = self.manager.data["category"]
     if any(categories):
         data = self._get_filtered_category_data(data, categories)
     pp.pprint(data)
     print('')
Ejemplo n.º 4
0
    def info(self, datasets=(), tasks=()):
        """Prints the dataset information contained in the cache.

        If a list of dataset or task names is specified, only the
        information matching any strings in those lists will be
        displayed.

        Parameters
        ----------
        datasets : str/list/tuple, optional
            List of dataset names.
        tasks : str/list/tuple, optional
            List of task names.

        """
        pp = pprint.PrettyPrinter(indent=4)
        print_text_box('Dataset')
        if any(datasets) or any(tasks):
            data = self._get_select_tasks_and_datasets_data(datasets, tasks)
        else:
            data = self._get_dataset_data()
        pp.pprint(data)
        print('')
Ejemplo n.º 5
0
 def _print_text_box_data_to_screen(self, msg, data):
     pp = pprint.PrettyPrinter(indent=4)
     print_text_box(msg)
     pp.pprint(data)
     print('')
Ejemplo n.º 6
0
 def info(self):
     """Prints the cache and download data dir paths of the cache."""
     pp = pprint.PrettyPrinter(indent=4)
     print_text_box('Info')
     pp.pprint(self.manager.data["info"])
     print('')