Logo Search packages:      
Sourcecode: mago version File versions  Download package

def mago::application::ubuntu::UpdateManager::download_size (   self  ) 

It returns the download size of the selected updates.

@return: A float with the download size in bytes 

Definition at line 178 of file ubuntu.py.

00178                            :
        """
        It returns the download size of the selected updates.

        @return: A float with the download size in bytes 
        """
        updateManager = ooldtp.context(self.name) 

        try:
            label = updateManager.getchild(role = 'label')
            for i in label:
                label_name = i.getName()
                groups = re.match(self.LBL_DOWNLOADSIZE, label_name)
                
                if groups:
                    # Calculate size based on the tag after the number
                    tag_size = groups.group(6)
                    if tag_size == 'B':
                        size = 1
                    elif tag_size == 'KB':
                        size = 1024
                    elif tag_size == 'MB':
                        size = 1048576
                    elif tag_size == 'GB':
                        size = 1073741824
                    else:
                        size = 0

                    total_size = float(groups.group(1)) * size
                    return total_size

        except ldtp.LdtpExecutionError:
            raise ldtp.LdtpExecutionError, "Error getting the download size."

        return 0.0

    def select_all(self):


Generated by  Doxygen 1.6.0   Back to index