<commit_before>#!/usr/bin/env python
# Author <NAME> - 12/05/2012 <<EMAIL>> : First revision
# Author <NAME> - 13/05/2012 <<EMAIL>> : Added 5.32, 5.28, 5.24 versions (rat v3, v2, v1)
# The ROOT packages base class
import LocalPackage
import os
import PackageUtil

class Root( LocalPackage.LocalPackage ):
    """ Base root installer, different versions only have different names."""
    def __init__( self, name, tarName ):
        """ Initialise the root package."""
        super( Root, self ).__init__( name )
        self._TarName = tarName
        return
    # Functions to override
    def CheckState( self ):
        """ Derived classes should override this to ascertain the package status, downloaded? installed?"""
        if os.path.exists( os.path.join( PackageUtil.kCachePath, self._TarName ) ):
            self._SetMode( 1 ) # Downloaded 
        if os.path.exists( os.path.join( self.GetInstallPath(), "bin/root" ) ):
            self._SetMode( 2 ) # Installed as well
        return
    def GetDependencies( self ):
        """ Return the dependency names as a list of names."""
        return [ "make", "g++", "gcc" ]
    def _Download( self ):
        """ Derived classes should override this to download the package. Return True on success."""
        return PackageUtil.DownloadFile( "ftp://root.cern.ch/root/" + self._TarName )
    def _Install( self ):
        """ Derived classes should override this to install the package, should install only when finished. Return True on success."""
        result = PackageUtil.UnTarFile( self._TarName, self.GetInstallPath(), 1 )
        result = result and PackageUtil.ExecuteSimpleCommand( './configure', ['--enable-minuit2', '--enable-roofit'], None, self.GetInstallPath() )
        result = result and PackageUtil.ExecuteSimpleCommand( 'make', [], None, self.GetInstallPath() )
        return result<commit_msg>Enable building root python bindings.<commit_after>#!/usr/bin/env python
# Author <NAME> - 12/05/2012 <<EMAIL>> : First revision
# Author <NAME> - 13/05/2012 <<EMAIL>> : Added 5.32, 5.28, 5.24 versions (rat v3, v2, v1)
#        <NAME> - 13/06/2012 <<EMAIL>> : Building python module
# The ROOT packages base class
import LocalPackage
import os
import PackageUtil

class Root( LocalPackage.LocalPackage ):
    """ Base root installer, different versions only have different names."""
    def __init__( self, name, tarName ):
        """ Initialise the root package."""
        super( Root, self ).__init__( name )
        self._TarName = tarName
        return
    # Functions to override
    def CheckState( self ):
        """ Derived classes should override this to ascertain the package status, downloaded? installed?"""
        if os.path.exists( os.path.join( PackageUtil.kCachePath, self._TarName ) ):
            self._SetMode( 1 ) # Downloaded 
        if os.path.exists( os.path.join( self.GetInstallPath(), "bin/root" ) ):
            self._SetMode( 2 ) # Installed as well
        return
    def GetDependencies( self ):
        """ Return the dependency names as a list of names."""
        return [ "make", "g++", "gcc" ]
    def _Download( self ):
        """ Derived classes should override this to download the package. Return True on success."""
        return PackageUtil.DownloadFile( "ftp://root.cern.ch/root/" + self._TarName )
    def _Install( self ):
        """ Derived classes should override this to install the package, should install only when finished. Return True on success."""
        result = PackageUtil.UnTarFile( self._TarName, self.GetInstallPath(), 1 )
        result = result and PackageUtil.ExecuteSimpleCommand( './configure', ['--enable-minuit2', '--enable-roofit', '--enable-python'], None, self.GetInstallPath() )
        result = result and PackageUtil.ExecuteSimpleCommand( 'make', [], None, self.GetInstallPath() )
        return result
{'fraction_non_alphanumeric': 0.12432012432012432, 'fraction_numerical': 0.018648018648018648, 'mean_word_length': 3.0103842159916927, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6219400', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1046, 'n_words': 366}