Public Member Functions

MGT::Options::Struct Class Reference

Inheritance diagram for MGT::Options::Struct:
MGT::BatchRun::BatchJob MGT::PhageHostApp::TaxaPred MGT::PredProcessor::PerfMetrics MGT::Proj::HctApp::CvTreeId

List of all members.

Public Member Functions

def updateOtherMissing
def updateFromOtherExisting
def isUndef
def setIfUndef
def scalars

Detailed Description

Class to create 'struct's on the fly.
Example: o = Struct()
         o.i = 2
         o.x = 'ababab'
         a = Struct({'i':2,'x':'ababab'})
         b = Struct(i=2,x='ababab')
         In all three cases, the result will be the same.
         __str__ method is redefined so that printing the object of this type
         will show all attributes which are not represented as 'instance at 0xXXXXXX'.
         

Member Function Documentation

def MGT::Options::Struct::isUndef (   self,
  key 
)
Return True if the current value for the key is None or no key exists
def MGT::Options::Struct::scalars (   self )
Return dictionary mapping names of "scalar" attributes to values.
"Scalar" attributes are non-sequence primitive types, such as Int, Float, String, None.
def MGT::Options::Struct::setIfUndef (   self,
  key,
  val 
)
Set key to val if the current value is None or no key exists
def MGT::Options::Struct::updateFromOtherExisting (   self,
  other 
)
Update in self keys that already present in self
def MGT::Options::Struct::updateOtherMissing (   self,
  other 
)
Update in other keys that are not yet present where

The documentation for this class was generated from the following file: