python/scannerpy/database.py
def ingest_videos(self, videos, force=False):
        """
        Creates a Table from a video.

        Args:
            videos: TODO(wcrichto)


        Kwargs:
            force: TODO(wcrichto)

        Returns:
            (list of created Tables, list of (path, reason) failures to ingest)
        """

        if len(videos) == 0:
            raise ScannerException('Must ingest at least one video.')

        [table_names, paths] = zip(*videos)
        to_delete = []
        for table_name in table_names:
            if self.has_table(table_name):
                if force is True:
                    to_delete.append(table_name)
                else:
                    raise ScannerException(
                        'Attempted to ingest over existing table {}'
                        .format(table_name))
        self.delete_tables(to_delete)
        ingest_params = self.protobufs.IngestParameters()
        ingest_params.table_names.extend(table_names)
        ingest_params.video_paths.extend(paths)
        ingest_result = self._try_rpc(
            lambda: self._master.IngestVideos(ingest_params))
        if not ingest_result.result.success:
            raise ScannerException(ingest_result.result.msg)
        failures = zip(ingest_result.failed_paths, ingest_result.failed_messages)

        self._cached_db_metadata = None
        return ([self.table(t) for (t, p) in videos
                if p not in ingest_result.failed_paths],
                failures)

        Creates a Table from a video.

        Args:
            videos: TODO(wcrichto)


        Kwargs:
            force: TODO(wcrichto)

        Returns:
            (list of created Tables, list of (path, reason) failures to ingest)
        
Creates a Table from a video.
Creates a Table from a video .
def ingest_videos(self, videos, force=False):
        if len(videos) == 0:
            raise ScannerException('Must ingest at least one video.')
        [table_names, paths] = zip(*videos)
        to_delete = []
        for table_name in table_names:
            if self.has_table(table_name):
                if force is True:
                    to_delete.append(table_name)
                else:
                    raise ScannerException(
                        'Attempted to ingest over existing table {}'
                        .format(table_name))
        self.delete_tables(to_delete)
        ingest_params = self.protobufs.IngestParameters()
        ingest_params.table_names.extend(table_names)
        ingest_params.video_paths.extend(paths)
        ingest_result = self._try_rpc(
            lambda: self._master.IngestVideos(ingest_params))
        if not ingest_result.result.success:
            raise ScannerException(ingest_result.result.msg)
        failures = zip(ingest_result.failed_paths, ingest_result.failed_messages)
        self._cached_db_metadata = None
        return ([self.table(t) for (t, p) in videos
                if p not in ingest_result.failed_paths],
                failures)
def ingest_videos ( self , videos , force = False ) : if len ( videos ) == 0 : raise ScannerException ( 'Must ingest at least one video.' ) [ table_names , paths ] = zip ( * videos ) to_delete = [ ] for table_name in table_names : if self . has_table ( table_name ) : if force is True : to_delete . append ( table_name ) else : raise ScannerException ( 'Attempted to ingest over existing table {}' . format ( table_name ) ) self . delete_tables ( to_delete ) ingest_params = self . protobufs . IngestParameters ( ) ingest_params . table_names . extend ( table_names ) ingest_params . video_paths . extend ( paths ) ingest_result = self . _try_rpc ( lambda : self . _master . IngestVideos ( ingest_params ) ) if not ingest_result . result . success : raise ScannerException ( ingest_result . result . msg ) failures = zip ( ingest_result . failed_paths , ingest_result . failed_messages ) self . _cached_db_metadata = None return ( [ self . table ( t ) for ( t , p ) in videos if p not in ingest_result . failed_paths ] , failures )
Creates a Table from a video.
Creates a Table from a video .
"""
        Creates a Table from a video.

        Args:
            videos: TODO(wcrichto)


        Kwargs:
            force: TODO(wcrichto)

        Returns:
            (list of created Tables, list of (path, reason) failures to ingest)
        """
(list of created Tables, list of (path, reason) failures to ingest)
( list of created Tables list of ( path reason ) failures to ingest )
self
videos
None
force