Beispiel #1
0
def standardSetup(setup=setup):
    """ Perform automatic initialization of the environment of the package.
    The gangaDir argument is only used by the core package, other packages should have no arguments.
    """

    from Ganga.Utility.Setup import checkPythonVersion
    import sys

    # here we assume that the Ganga has been already prepended to sys.path by
    # the caller
    if checkPythonVersion(_defaultMinVersion, _defaultMinHexVersion):
        for name in setup.packages:
            #            if name == 'pycrypto' and sys.hexversion > 0x2050000:
            #                # hack the pycrypto path for 2.5
            #                setup.packages['pycrypto']['syspath'] = setup.packages['pycrypto']['syspath'].replace('2.3', '2.5')
            #
            #            if name == 'paramiko' and sys.hexversion > 0x2050000:
            #                # hack the paramiko path for 2.5
            #                setup.packages['paramiko']['syspath'] = setup.packages['paramiko']['syspath'].replace('2.3', '2.5')

            setup.setSysPath(name)
            setup.prependPath(name, 'PYTHONPATH')

            # if other PATH variable must be defined, e.g. LD_LIBRARY_PATH, then
            # you should do it this way:
            # setup.prependPath(name,'LD_LIBRARY_PATH')
    else:
        sys.exit()
Beispiel #2
0
def standardSetup(setup=setup):

    # here we assume that the Ganga has been already prepended to sys.path by the caller
    if checkPythonVersion(_defaultMinVersion,_defaultMinHexVersion):
        for name in setup.packages:
            if name == '4Suite' and (sys.hexversion > 0x2050000 and sys.hexversion < 0x2060000):
                # hack the 4Suite path for 2.5
                setup.packages['4Suite']['PYTHONPATH']  =  [ package.replace('2.4','2.5') for package in setup.packages['4Suite']['PYTHONPATH'] ]
                setup.packages['4Suite']['syspath']  =  [ package.replace('2.4','2.5') for package in setup.packages['4Suite']['syspath'] ]
            elif name == '4Suite' and sys.hexversion > 0x2060000:
                # hack the 4Suite path for 2.6
                setup.packages['4Suite']['PYTHONPATH']  =  [ package.replace('2.4','2.6') for package in setup.packages['4Suite']['PYTHONPATH'] ]
                setup.packages['4Suite']['syspath']  =  [ package.replace('2.4','2.6') for package in setup.packages['4Suite']['syspath'] ]
    else:
        sys.exit()

    for p in setup.packages:
        setup.prependPath(p,'PYTHONPATH')
        setup.prependPath(p,'LD_LIBRARY_PATH')
        setup.prependPath(p,'PATH')
        setup.setPath(p,'DQ2_HOME')
        if 'DQ2_ENDUSER_SETUP' in setup.packages[p]:
            os.environ['DQ2_ENDUSER_SETUP'] = setup.packages[p]['DQ2_ENDUSER_SETUP']
        setup.setPath(p,'PANDA_SYS')
        setup.setPath(p,'RUCIO_HOME')
        if 'RUCIO_AUTH_TYPE' in setup.packages[p]:
            os.environ['RUCIO_AUTH_TYPE'] = setup.packages[p]['RUCIO_AUTH_TYPE']

    # update the syspath and PYTHONPATH for the packages
    for name in setup.packages:
        setup.setSysPath(name)
Beispiel #3
0
def standardSetup(setup=setup):
    """ Perform automatic initialization of the environment of the package.
    The gangaDir argument is only used by the core package, other packages should have no arguments.
    """

    from Ganga.Utility.Setup import checkPythonVersion
    import sys

    # here we assume that the Ganga has been already prepended to sys.path by
    # the caller
    if checkPythonVersion(_defaultMinVersion, _defaultMinHexVersion):
        for name in setup.packages:
#            if name == 'pycrypto' and sys.hexversion > 0x2050000:
#                # hack the pycrypto path for 2.5
#                setup.packages['pycrypto']['syspath'] = setup.packages['pycrypto']['syspath'].replace('2.3', '2.5')
#
#            if name == 'paramiko' and sys.hexversion > 0x2050000:
#                # hack the paramiko path for 2.5
#                setup.packages['paramiko']['syspath'] = setup.packages['paramiko']['syspath'].replace('2.3', '2.5')

            setup.setSysPath(name)
            setup.prependPath(name, 'PYTHONPATH')

            # if other PATH variable must be defined, e.g. LD_LIBRARY_PATH, then
            # you should do it this way:
            # setup.prependPath(name,'LD_LIBRARY_PATH')
    else:
        sys.exit()
Beispiel #4
0
def standardSetup(setup=setup):

    # here we assume that the Ganga has been already prepended to sys.path by the caller
    if checkPythonVersion(_defaultMinVersion, _defaultMinHexVersion):
        for name in setup.packages:
            if name == '4Suite' and (sys.hexversion > 0x2050000
                                     and sys.hexversion < 0x2060000):
                # hack the 4Suite path for 2.5
                setup.packages['4Suite']['PYTHONPATH'] = [
                    package.replace('2.4', '2.5')
                    for package in setup.packages['4Suite']['PYTHONPATH']
                ]
                setup.packages['4Suite']['syspath'] = [
                    package.replace('2.4', '2.5')
                    for package in setup.packages['4Suite']['syspath']
                ]
                setup.setSysPath(name)
            elif name == '4Suite' and sys.hexversion > 0x2060000:
                # hack the 4Suite path for 2.6
                setup.packages['4Suite']['PYTHONPATH'] = [
                    package.replace('2.4', '2.6')
                    for package in setup.packages['4Suite']['PYTHONPATH']
                ]
                setup.packages['4Suite']['syspath'] = [
                    package.replace('2.4', '2.6')
                    for package in setup.packages['4Suite']['syspath']
                ]
                setup.setSysPath(name)
            else:
                pass
    else:
        sys.exit()

    for p in setup.packages:
        setup.prependPath(p, 'PYTHONPATH')
        setup.prependPath(p, 'LD_LIBRARY_PATH')
        setup.prependPath(p, 'PATH')
        setup.setPath(p, 'DQ2_HOME')
        if 'DQ2_ENDUSER_SETUP' in setup.packages[p]:
            os.environ['DQ2_ENDUSER_SETUP'] = setup.packages[p][
                'DQ2_ENDUSER_SETUP']
        setup.setPath(p, 'PANDA_SYS')
        setup.setPath(p, 'RUCIO_HOME')
        if 'RUCIO_AUTH_TYPE' in setup.packages[p]:
            os.environ['RUCIO_AUTH_TYPE'] = setup.packages[p][
                'RUCIO_AUTH_TYPE']