Public Member Functions | |
def | __init__ |
def | tab |
def | __str__ |
Public Attributes | |
iso | |
depth | |
Static Private Attributes | |
string | _tab = ' ' |
Definition at line 130 of file data.py.
def GenDecay::data::PrettyPrint::__init__ | ( | self, | ||
iso, | ||||
depth = 0 | ||||
) |
def GenDecay::data::PrettyPrint::tab | ( | self | ) |
def GenDecay::data::PrettyPrint::__str__ | ( | self | ) |
Definition at line 141 of file data.py.
00141 : 00142 import decay 00143 ret = [self.tab()+str(self.iso)] 00144 00145 iso2process = [] 00146 for t in self.iso.transitions: # assume only be non-GammaDecay 00147 00148 # Add this transition 00149 #print self.tab()+str(t) 00150 ret.append(self.tab()+str(t)) 00151 00152 # if daughter not stable 00153 if t.final.transitions: 00154 ft = t.final.transitions[0] 00155 # and if daugther decays by gamma 00156 if type(ft.radiation) == decay.GammaDecay: 00157 # save string rep and ground state for later processing 00158 ret.append(self.tab()+PrettyPrint._tab+str(ft)) 00159 if not ft.final in iso2process: 00160 iso2process.append(ft.final) 00161 continue 00162 00163 # otherwise, save for recursion 00164 if not t.final in iso2process: 00165 iso2process.append(t.final) 00166 continue 00167 for iso in iso2process: 00168 pp = PrettyPrint(iso,self.depth+1) 00169 ret.append(str(pp)) 00170 00171 return '\n'.join(ret) 00172 00173 00174 if __name__ == '__main__':
string GenDecay::data::PrettyPrint::_tab = ' ' [static, private] |