ATLAS Offline Software
Classes | Functions | Variables
python.acmdlib Namespace Reference

Classes

class  Command
 classes ----------------------------------------------------------------— More...
 
class  Plugins
 

Functions

def command (*args, **kwargs)
 
def argument (*args, **kwargs)
 
def register (name, value)
 

Variables

 __doc__
 
 __author__
 
 __all__
 
 ACMD_GROUPNAME
 globals ----------------------------------------------------------------— More...
 
 ACMD_PARSER
 
 prog
 
 description
 
 ACMD_SUBPARSERS
 
 dest
 
 title
 
 metavar
 

Function Documentation

◆ argument()

def python.acmdlib.argument ( args,
**  kwargs 
)
Decorator to add an argument to a command.
Use the `mutual=True` keyword to specify that the argument should belong to a mutual exclusion group.

Definition at line 181 of file acmdlib.py.

181 def argument(*args, **kwargs):
182  """Decorator to add an argument to a command.
183  Use the `mutual=True` keyword to specify that the argument should belong to a mutual exclusion group.
184  """
185  is_mutual = kwargs.pop('mutual', False)
186 
187  def deco(fct):
188  if isinstance(fct, Command):
189  cmd = fct
190  if is_mutual:
191  if not hasattr(cmd, '_acmdlib_mutual_group'):
192  cmd._acmdlib_mutual_group = cmd.add_mutually_exclusive_group()
193  cmd._acmdlib_mutual_group.add_argument(*args, **kwargs)
194  else:
195  cmd.add_argument(*args, **kwargs)
196  else:
197  store_as = '_acmdlib_arguments_mutual' if is_mutual else '_acmdlib_arguments'
198  if not hasattr(fct, store_as):
199  setattr(fct, store_as, [])
200  getattr(fct, store_as).append((args, kwargs))
201  #print "===",args,kwargs,type(fct),fct
202  return fct
203  return deco
204 

◆ command()

def python.acmdlib.command ( args,
**  kwargs 
)
Decorator to declare that a function is a command.

Definition at line 172 of file acmdlib.py.

172 def command(*args, **kwargs):
173  """Decorator to declare that a function is a command.
174  """
175  def deco(fct):
176  return Command(fct, **kwargs)
177  if args:
178  return deco(*args)
179  return deco
180 

◆ register()

def python.acmdlib.register (   name,
  value 
)
Registers a plugin, given a name and value.

ex: register('check-file', 'PyUtils.CheckFileLib:fct')

Definition at line 205 of file acmdlib.py.

205 def register(name, value):
206  """Registers a plugin, given a name and value.
207 
208  ex: register('check-file', 'PyUtils.CheckFileLib:fct')
209  """
210 
211  return Plugins.register(name, value)

Variable Documentation

◆ __all__

python.acmdlib.__all__
private

Definition at line 13 of file acmdlib.py.

◆ __author__

python.acmdlib.__author__
private

Definition at line 11 of file acmdlib.py.

◆ __doc__

python.acmdlib.__doc__
private

Definition at line 10 of file acmdlib.py.

◆ ACMD_GROUPNAME

python.acmdlib.ACMD_GROUPNAME

globals ----------------------------------------------------------------—

Definition at line 26 of file acmdlib.py.

◆ ACMD_PARSER

python.acmdlib.ACMD_PARSER

Definition at line 30 of file acmdlib.py.

◆ ACMD_SUBPARSERS

python.acmdlib.ACMD_SUBPARSERS

Definition at line 35 of file acmdlib.py.

◆ description

python.acmdlib.description

Definition at line 32 of file acmdlib.py.

◆ dest

python.acmdlib.dest

Definition at line 36 of file acmdlib.py.

◆ metavar

python.acmdlib.metavar

Definition at line 38 of file acmdlib.py.

◆ prog

python.acmdlib.prog

Definition at line 31 of file acmdlib.py.

◆ title

python.acmdlib.title

Definition at line 37 of file acmdlib.py.

python.acmdlib.argument
def argument(*args, **kwargs)
Definition: acmdlib.py:181
register
#define register
Definition: dictionary.h:21
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
python.acmdlib.command
def command(*args, **kwargs)
Definition: acmdlib.py:172