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 179 of file acmdlib.py.

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

◆ command()

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

Definition at line 170 of file acmdlib.py.

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

◆ 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 203 of file acmdlib.py.

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

Variable Documentation

◆ __all__

python.acmdlib.__all__
private

Definition at line 11 of file acmdlib.py.

◆ __author__

python.acmdlib.__author__
private

Definition at line 9 of file acmdlib.py.

◆ __doc__

python.acmdlib.__doc__
private

Definition at line 8 of file acmdlib.py.

◆ ACMD_GROUPNAME

python.acmdlib.ACMD_GROUPNAME

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

Definition at line 24 of file acmdlib.py.

◆ ACMD_PARSER

python.acmdlib.ACMD_PARSER

Definition at line 28 of file acmdlib.py.

◆ ACMD_SUBPARSERS

python.acmdlib.ACMD_SUBPARSERS

Definition at line 33 of file acmdlib.py.

◆ description

python.acmdlib.description

Definition at line 30 of file acmdlib.py.

◆ dest

python.acmdlib.dest

Definition at line 34 of file acmdlib.py.

◆ metavar

python.acmdlib.metavar

Definition at line 36 of file acmdlib.py.

◆ prog

python.acmdlib.prog

Definition at line 29 of file acmdlib.py.

◆ title

python.acmdlib.title

Definition at line 35 of file acmdlib.py.

python.acmdlib.argument
def argument(*args, **kwargs)
Definition: acmdlib.py:179
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:170