Example #1
0
    def extract(self):

        # Call base class extraction
        extracted = DepSource.extract(self)
        if extracted == False:
            return False

        # Move subdir to parent
        self.movetoparent()
        return True
    def loadxml(self):
        """Load XML"""
        # Load in the xml
        tree = ET.ElementTree(file=self.ConfigPath)
        self.xmlroot = tree.getroot()
        if self.xmlroot.tag != 'Settings':
            raise ValueError('Root Element is not Settings')

        # Directory Settings
        self.DepsDirectory = self.read_element('DepsDirectory')
        self.DepsDirectory = abspath(self.DepsDirectory)
        self.ArchiveDirectory = self.read_element('ArchiveDirectory')
        self.ArchiveDirectory = join(self.DepsDirectory, self.ArchiveDirectory)
        self.GCCVersion = self.read_element('GCCVersion')

        # Set the Archive directory for downloaded sources
        DepSource.ArchiveDir = self.ArchiveDirectory
        # Set the root Extract directory for extracting sources
        DepSource.RootExtractDir = self.DepsDirectory

        # Load in the list of download sources
        self.sources = DepSource.parsexml(self.xmlroot)
        return