home/exp1000/acquire_and_label_images.py
def split_and_move_tar(self, tar_path, split_bytes):
        """Split packaged files for downlink and move the chunks to the filestore's toGround folder."""
        
        # Thumbnail packages can be large when acquiring a lot of images.
        # Split the tar file and save smaller chunks in filestore's toGround folder.
        cmd_split_tar = 'split -b {B} {T} {P}'.format(\
            B=split_bytes,\
            T=tar_path,\
            P=FILESTORE_TOGROUND_PATH + "/" + ntpath.basename(tar_path) + "_")

        # Move the split chunks of the tar package to filestore's toGround folder.
        os.system(cmd_split_tar)

        # Get the number of files that the tar file was split into, i.e. the number of chunks.
        chunk_counter = len(glob.glob1(FILESTORE_TOGROUND_PATH, ntpath.basename(tar_path) + "_*"))

        # If the split only resulted in 1 chunk this means that no split was required the begin with. Rename the file as an unsplit tar file.
        # FIXME: Don't split to begin with when this will be the case (compare the tar size to the split size prior to splitting)
        if chunk_counter == 1:

            cmd_rename_single_chunk = 'mv {S} {D}'.format(\
                S=FILESTORE_TOGROUND_PATH + "/" + ntpath.basename(tar_path) + "_aa",\
                D=FILESTORE_TOGROUND_PATH + "/" + ntpath.basename(tar_path))

            os.system(cmd_rename_single_chunk)

        # Delete the unsplit tar file in the experiment's toGround folder.
        os.system('rm {T}'.format(T=tar_path))
Split packaged files for downlink and move the chunks to the filestore's toGround folder.
Split packaged files for downlink and move the chunks to the filestore's toGround folder.
Split packaged files for downlink and move the chunks to the filestore ' s toGround folder .
def split_and_move_tar(self, tar_path, split_bytes):
        cmd_split_tar = 'split -b {B} {T} {P}'.format(\
            B=split_bytes,\
            T=tar_path,\
            P=FILESTORE_TOGROUND_PATH + "/" + ntpath.basename(tar_path) + "_")
        os.system(cmd_split_tar)
        chunk_counter = len(glob.glob1(FILESTORE_TOGROUND_PATH, ntpath.basename(tar_path) + "_*"))
        if chunk_counter == 1:
            cmd_rename_single_chunk = 'mv {S} {D}'.format(\
                S=FILESTORE_TOGROUND_PATH + "/" + ntpath.basename(tar_path) + "_aa",\
                D=FILESTORE_TOGROUND_PATH + "/" + ntpath.basename(tar_path))
            os.system(cmd_rename_single_chunk)
        os.system('rm {T}'.format(T=tar_path))
def split_and_move_tar ( self , tar_path , split_bytes ) : cmd_split_tar = 'split -b {B} {T} {P}' . format ( B = split_bytes , T = tar_path , P = FILESTORE_TOGROUND_PATH + "/" + ntpath . basename ( tar_path ) + "_" ) os . system ( cmd_split_tar ) chunk_counter = len ( glob . glob1 ( FILESTORE_TOGROUND_PATH , ntpath . basename ( tar_path ) + "_*" ) ) if chunk_counter == 1 : cmd_rename_single_chunk = 'mv {S} {D}' . format ( S = FILESTORE_TOGROUND_PATH + "/" + ntpath . basename ( tar_path ) + "_aa" , D = FILESTORE_TOGROUND_PATH + "/" + ntpath . basename ( tar_path ) ) os . system ( cmd_rename_single_chunk ) os . system ( 'rm {T}' . format ( T = tar_path ) )
Split packaged files for downlink and move the chunks to the filestore's toGround folder.
Split packaged files for downlink and move the chunks to the filestore ' s toGround folder .
"""Split packaged files for downlink and move the chunks to the filestore's toGround folder.""" # Thumbnail packages can be large when acquiring a lot of images. # Split the tar file and save smaller chunks in filestore's toGround folder. # Move the split chunks of the tar package to filestore's toGround folder. # Get the number of files that the tar file was split into, i.e. the number of chunks. # If the split only resulted in 1 chunk this means that no split was required the begin with. Rename the file as an unsplit tar file. # FIXME: Don't split to begin with when this will be the case (compare the tar size to the split size prior to splitting) # Delete the unsplit tar file in the experiment's toGround folder.
self
tar_path
split_bytes