Script
DIRAC script.
Usage:
from DIRAC.Core.Base.Script import Script
@Script()
def main():
Script.registerArgument(("Name: user name", "DN: user DN"))
Script.parseCommandLine()
...
- class DIRAC.Core.Base.Script.Script
Bases:
object
Decorator for providing command line executables
All console-scripts entrypoints in DIRAC and downstream extensions should be wrapped in this decorator to allow extensions to override any entry_point.
- classmethod addDefaultOptionValue(option, value)
See
addDefaultEntry()
.
- alreadyInitialized = False
- classmethod disableCS()
See
disableCS()
.
- classmethod enableCS()
See
enableCS()
.
- classmethod getExtraCLICFGFiles()
- classmethod getPositionalArgs(group=False)
- classmethod getUnprocessedSwitches()
- classmethod initialize(script=False, ignoreErrors=False, initializeMonitor=False, enableCommandLine=False)
initialization
- localCfg = <DIRAC.ConfigurationSystem.Client.LocalConfiguration.LocalConfiguration object>
- classmethod parseCommandLine(script=False, ignoreErrors=False, initializeMonitor=False)
Parse command line
- classmethod registerArgument(description, mandatory=True, values=None, default=None)
See
registerCmdArg()
.
- classmethod registerSwitch(showKey, longKey, helpString, callback=False)
See
registerCmdOpt()
.
- scriptName = None
- classmethod setUsageMessage(usageMessage)
See
setUsageMessage()
.
- classmethod showHelp(dummy=False, exitCode=0)
See
showHelp()
.
- DIRAC.Core.Base.Script.addDefaultOptionValue(*args, **kwargs)
- DIRAC.Core.Base.Script.disableCS(*args, **kwargs)
- DIRAC.Core.Base.Script.enableCS(*args, **kwargs)
- DIRAC.Core.Base.Script.getExtraCLICFGFiles(*args, **kwargs)
- DIRAC.Core.Base.Script.getPositionalArgs(*args, **kwargs)
- DIRAC.Core.Base.Script.getUnprocessedSwitches(*args, **kwargs)
- DIRAC.Core.Base.Script.initialize(*args, **kwargs)
- DIRAC.Core.Base.Script.parseCommandLine(*args, **kwargs)
- DIRAC.Core.Base.Script.registerArgument(*args, **kwargs)
- DIRAC.Core.Base.Script.registerSwitch(*args, **kwargs)
- DIRAC.Core.Base.Script.setUsageMessage(*args, **kwargs)