コード例 #1
0
 def _atoms(self, seen_etypes):
     seen_etypes[self.E_Type.type_name] += 1
     rc = self._recursion_limit
     for c in self.Attrs:
         if self._do_recurse(c, rc, seen_etypes) and not c._polymorphic:
             for ct in c._atoms(ETC(seen_etypes)):
                 yield ct
コード例 #2
0
 def _sig_map_transitive(self, seen_etypes):
     seen_etypes = ETC(dict(seen_etypes, **self.seen_refuse_e_types))
     result = self.__super._sig_map_transitive(seen_etypes)
     E_Types_AQ = self.E_Types_AQ
     if E_Types_AQ:
         for aq in pyk.itervalues(E_Types_AQ):
             result.update(aq._sig_map_transitive(seen_etypes))
     return result
コード例 #3
0
ファイル: Querier.py プロジェクト: JPilarr/tapyr
 def _attrs_transitive(self, seen_etypes):
     seen_etypes[self.E_Type.type_name] += 1
     rc = self._recursion_limit
     for c in self.Attrs:
         if self._do_recurse(c, rc, seen_etypes) and not c._polymorphic:
             yield from c._attrs_transitive(ETC(seen_etypes))
         else:
             yield c
コード例 #4
0
 def _as_json_cargo(self, seen_etypes):
     ET = self.E_Type
     seen_etypes[ET.type_name] += 1
     result = self.__super._as_json_cargo(seen_etypes)
     if self._do_recurse(self, self._recursion_limit, seen_etypes):
         if not self._polymorphic:
             attrs = list \
                 (c._as_json_cargo (ETC (seen_etypes)) for c in self.Attrs)
             if attrs:
                 result["attrs"] = attrs
     return result
コード例 #5
0
 def _as_json_cargo(self, seen_etypes):
     seen_etypes = ETC(dict(seen_etypes, **self.seen_refuse_e_types))
     result = {}
     E_Types_CNP = self.E_Types_CNP
     if E_Types_CNP:
         ### Process `E_Types_CNP` first to allow inclusion of own `E_Type`
         ### in `children_np` before `__super` increments `seen_etypes`
         result ["children_np"] = list  \
             (   self [etn]._as_json_cargo (seen_etypes)
             for etn in sorted (E_Types_CNP)
             )
     result.update(self.__super._as_json_cargo(seen_etypes))
     return result
コード例 #6
0
 def _as_template_elem(self, seen_etypes):
     seen_etypes = ETC(dict(seen_etypes, **self.seen_refuse_e_types))
     E_Types_CNP = self.E_Types_CNP
     if E_Types_CNP:
         ### Process `E_Types_CNP` first to allow inclusion of own `E_Type`
         ### in `children_np` before `__super` increments `seen_etypes`
         children_np = list \
             (   self [etn]._as_template_elem (seen_etypes)
             for etn in sorted (E_Types_CNP)
             )
     result = self.__super._as_template_elem(seen_etypes)
     result["ui_type_name"] = self.E_Type.ui_name_T
     if E_Types_CNP:
         result["children_np"] = children_np
     return result
コード例 #7
0
 def Unwrapped_Atoms(self):
     return tuple(self._unwrapped_atoms(ETC()))
コード例 #8
0
 def Attrs_Transitive(self):
     return tuple(self._attrs_transitive(ETC()))
コード例 #9
0
 def Atoms(self):
     return tuple(self._atoms(ETC()))
コード例 #10
0
 def As_Template_Elem(self):
     return self._as_template_elem(ETC())
コード例 #11
0
 def As_Json_Cargo(self):
     return self._as_json_cargo(ETC())
コード例 #12
0
 def Sig_Map(self):
     result = {}
     seen_etypes = ETC()
     for c in self.Attrs:
         result.update(c._sig_map_transitive(seen_etypes))
     return result