grr/server/grr_response_server/flow_base.py
def DualDBFlow(cls):
  """Decorator that creates AFF4 and RELDB flows from a given mixin."""

  if issubclass(cls, flow.GRRFlow):
    raise ValueError("Mixin class shouldn't inherit from GRRFlow.")

  if cls.__name__[-5:] != "Mixin":
    raise ValueError("Flow mixin should have a name that ends in 'Mixin'.")

  flow_name = cls.__name__[:-5]
  aff4_cls = type(flow_name, (cls, flow.GRRFlow), {})
  aff4_cls.__doc__ = cls.__doc__
  setattr(aff4_flows, flow_name, aff4_cls)

  reldb_cls = type(flow_name, (cls, FlowBase), {})
  reldb_cls.__doc__ = cls.__doc__
  setattr(sys.modules[cls.__module__], flow_name, reldb_cls)

  return cls
Decorator that creates AFF4 and RELDB flows from a given mixin.
Decorator that creates AFF4 and RELDB flows from a given mixin.
Decorator that creates AFF4 and RELDB flows from a given mixin .
def DualDBFlow(cls):
  if issubclass(cls, flow.GRRFlow):
    raise ValueError("Mixin class shouldn't inherit from GRRFlow.")
  if cls.__name__[-5:] != "Mixin":
    raise ValueError("Flow mixin should have a name that ends in 'Mixin'.")
  flow_name = cls.__name__[:-5]
  aff4_cls = type(flow_name, (cls, flow.GRRFlow), {})
  aff4_cls.__doc__ = cls.__doc__
  setattr(aff4_flows, flow_name, aff4_cls)
  reldb_cls = type(flow_name, (cls, FlowBase), {})
  reldb_cls.__doc__ = cls.__doc__
  setattr(sys.modules[cls.__module__], flow_name, reldb_cls)
  return cls
def DualDBFlow ( cls ) : if issubclass ( cls , flow . GRRFlow ) : raise ValueError ( "Mixin class shouldn't inherit from GRRFlow." ) if cls . __name__ [ - 5 : ] != "Mixin" : raise ValueError ( "Flow mixin should have a name that ends in 'Mixin'." ) flow_name = cls . __name__ [ : - 5 ] aff4_cls = type ( flow_name , ( cls , flow . GRRFlow ) , { } ) aff4_cls . __doc__ = cls . __doc__ setattr ( aff4_flows , flow_name , aff4_cls ) reldb_cls = type ( flow_name , ( cls , FlowBase ) , { } ) reldb_cls . __doc__ = cls . __doc__ setattr ( sys . modules [ cls . __module__ ] , flow_name , reldb_cls ) return cls
Decorator that creates AFF4 and RELDB flows from a given mixin.
Decorator that creates AFF4 and RELDB flows from a given mixin .
"""Decorator that creates AFF4 and RELDB flows from a given mixin."""
cls