コード例 #1
0
ファイル: JobRegistry.py プロジェクト: wvengen/lgipilot
################################################################################
# Ganga Project. http://cern.ch/ganga
#
# $Id: JobRegistry.py,v 1.1.2.1 2009-07-24 13:39:39 ebke Exp $
################################################################################

# display default values for job list
from RegistrySlice import config
config.addOption('jobs_columns',
                 ("fqid","status","name","subjobs","application","backend","backend.actualCE", "comment"),
                 'list of job attributes to be printed in separate columns')

config.addOption('jobs_columns_width',
                 {'fqid': 8, 'status':10, 'name':10, 'subjobs':8, 'application':15, 'backend':15, 'backend.actualCE':45, 'comment':30},
                 'width of each column')

config.addOption('jobs_columns_functions',
                 {'subjobs' : "lambda j: len(j.subjobs)", 'application': "lambda j: j.application._name", 'backend': "lambda j:j.backend._name", 'comment' : "lambda j: j.comment"},
                 'optional converter functions')

config.addOption('jobs_columns_show_empty',
                 ['fqid'],
                 'with exception of columns mentioned here, hide all values which evaluate to logical false (so 0,"",[],...)')

config.addOption('jobs_status_colours',
                            { 'new'        : 'fx.normal',
                              'submitted'  : 'fg.orange',
                              'running'    : 'fg.green',
                              'completed'  : 'fg.blue',
                              'failed'     : 'fg.red'
                              },
コード例 #2
0
ファイル: BoxRegistry.py プロジェクト: wvengen/lgipilot
from Ganga.GPIDev.Base.Proxy import GPIProxyObjectFactory
import Ganga.Utility.logging
logger = Ganga.Utility.logging.getLogger()

# add display default values for the box
from RegistrySlice import config
config.addOption('box_columns',
                 ("id","type","name","application"),
                 'list of job attributes to be printed in separate columns')

config.addOption('box_columns_width',
                 {'id': 5, 'type':20, 'name':40, 'application':15},
                 'width of each column')

config.addOption('box_columns_functions',
                 {'application': "lambda obj: obj.application._name"},
                 'optional converter functions')

config.addOption('box_columns_show_empty',
                 ['id'],
                 'with exception of columns mentioned here, hide all values which evaluate to logical false (so 0,"",[],...)')

from Ganga.Core import GangaException
class BoxTypeError(GangaException,TypeError):
    def __init__(self,what):
        GangaException.__init__(self,what)
        self.what=what
    def __str__(self):
        return "BoxTypeError: %s"%self.what

from Ganga.GPIDev.Base.Objects import GangaObject