Revision 52fc37bd lib/rapi/baserlib.py

b/lib/rapi/baserlib.py
462 462
  method to do their own opcode input processing (e.g. for static values). The
463 463
  C{$METHOD$_RENAME} variable defines which values are renamed (see
464 464
  L{baserlib.FillOpcode}).
465
  Still default behavior cannot be totally overriden. There are opcode params
466
  that are available to all opcodes, e.g. "depends". In case those params
467
  (currently only "depends") are found in the original request's body, they are
468
  added to the dictionary of parsed parameters and eventually passed to the
469
  opcode. If the parsed body is not represented as a dictionary object, the
470
  values are not added.
465 471

  
466 472
  @cvar GET_OPCODE: Set this to a class derived from L{opcodes.OpCode} to
467 473
    automatically generate a GET handler submitting the opcode
......
528 534
      }
529 535
    return common_static
530 536

  
537
  def _GetDepends(self):
538
    ret = {}
539
    if isinstance(self.request_body, dict):
540
      depends = self.getBodyParameter("depends", None)
541
      if depends:
542
        ret.update({"depends": depends})
543
    return ret
544

  
531 545
  def _GenericHandler(self, opcode, rename, fn):
532 546
    (body, specific_static) = fn()
547
    if isinstance(body, dict):
548
      body.update(self._GetDepends())
533 549
    static = self._GetCommonStatic()
534 550
    if specific_static:
535 551
      static.update(specific_static)

Also available in: Unified diff