Exemple #1
0
def load_config_files():
    """
    Load the config files as a normal Ganga session would, taking
    into account environment variables etc.
    """
    from Ganga.Utility.Config import getConfig, setSessionValuesFromFiles
    from Ganga.Runtime import GangaProgram
    system_vars = {}
    for opt in getConfig('System'):
        system_vars[opt] = getConfig('System')[opt]
    config_files = GangaProgram.get_config_files(os.path.expanduser('~/.gangarc'))
    setSessionValuesFromFiles(config_files, system_vars)
Exemple #2
0
def load_config_files():
    """
    Load the config files as a normal Ganga session would, taking
    into account environment variables etc.
    """
    from Ganga.Utility.Config import getConfig, setSessionValuesFromFiles
    from Ganga.Runtime import GangaProgram
    system_vars = {}
    for opt in getConfig('System'):
        system_vars[opt] = getConfig('System')[opt]
    config_files = GangaProgram.get_config_files(ganga_config_file)
    setSessionValuesFromFiles(config_files, system_vars)
Exemple #3
0
def load_config_files():
    """
    Load the config files as a normal Ganga session would, taking
    into account environment variables etc.
    """
    from Ganga.Utility.Config import getConfig, setSessionValuesFromFiles
    from Ganga.Runtime import GangaProgram
    system_vars = {}
    for opt in getConfig('System'):
        system_vars[opt] = getConfig('System')[opt]
        user_config = os.environ.get('GANGA_CONFIG_FILE') or os.path.expanduser('~/.gangarc')
        config_files = GangaProgram.get_config_files(user_config)
        setSessionValuesFromFiles(config_files, system_vars)
Exemple #4
0
    Ganga.Utility.logging.config["Ganga.Utility.Config"] = "DEBUG"
    Ganga.Utility.logging.bootstrap()

    print("Basic Test")
    import sys

    c1 = getConfig("C1")
    c1.setDefaultOptions({"a": 1, "aa": "xx"})

    c2 = getConfig("C2")
    c2["b"] = 2
    c2["bb"] = "yy"

    print("path=", sys.path[0])

    setSessionValuesFromFiles([sys.path[0] + "/ConfigTest.ini"])

    print("C1")
    print(c1.getEffectiveOptions())
    print()
    print("C2")
    print(c2.getEffectiveOptions())

    assert c1["a"] == 3
    assert c1["aa"] == "xx"

    assert c2["b"] == 4
    assert c2["c"] == "x"
    assert c2["d"] == c2["c"]

    print("Basic Test OK")
Exemple #5
0
    Ganga.Utility.logging.config['Ganga.Utility.Config'] = 'DEBUG'
    Ganga.Utility.logging.bootstrap()

    print('Basic Test')
    import sys

    c1 = getConfig('C1')
    c1.setDefaultOptions({'a': 1, 'aa': 'xx'})

    c2 = getConfig('C2')
    c2['b'] = 2
    c2['bb'] = 'yy'

    print('path=', sys.path[0])

    setSessionValuesFromFiles([sys.path[0] + '/ConfigTest.ini'])

    print("C1")
    print(c1.getEffectiveOptions())
    print()
    print("C2")
    print(c2.getEffectiveOptions())

    assert(c1['a'] == 3)
    assert(c1['aa'] == 'xx')

    assert(c2['b'] == 4)
    assert(c2['c'] == 'x')
    assert(c2['d'] == c2['c'])

    print('Basic Test OK')
Exemple #6
0
def ganga_license():
    'Print the full license (GPL)'
    with open(os.path.join(_gangaPythonPath, '..',
                           'LICENSE_GPL')) as printable:
        logger.info(printable.read())


# ------------------------------------------------------------------------------------
# Setup the shutdown manager
atexit.register(_ganga_run_exitfuncs)

system_vars = {}
for opt in getConfig('System'):
    system_vars[opt] = getConfig('System')[opt]
setSessionValuesFromFiles([os.path.expanduser('~/.gangarc')], system_vars)

import ganga
from Ganga.Runtime import plugins

from Ganga.GPIDev.Base.Proxy import setProxyInterface
setProxyInterface(ganga)

from Ganga.Utility.Runtime import loadPlugins, autoPopulateGPI
loadPlugins(ganga)
autoPopulateGPI(ganga)

from Ganga.Core.GangaThread.WorkerThreads import startUpQueues
startUpQueues(ganga)

# ------------------------------------------------------------------------------------
Exemple #7
0

def ganga_license():
    'Print the full license (GPL)'
    with open(os.path.join(_gangaPythonPath, '..', 'LICENSE_GPL')) as printable:
        logger.info(printable.read())


# ------------------------------------------------------------------------------------
# Setup the shutdown manager
atexit.register(_ganga_run_exitfuncs)

system_vars = {}
for opt in getConfig('System'):
    system_vars[opt] = getConfig('System')[opt]
setSessionValuesFromFiles([os.path.expanduser('~/.gangarc')], system_vars)

import ganga
from Ganga.Runtime import plugins

from Ganga.GPIDev.Base.Proxy import setProxyInterface
setProxyInterface(ganga)

from Ganga.Utility.Runtime import loadPlugins, autoPopulateGPI
loadPlugins(ganga)
autoPopulateGPI(ganga)

from Ganga.Core.GangaThread.WorkerThreads import startUpQueues
startUpQueues(ganga)

# ------------------------------------------------------------------------------------