Пример #1
0
 def selectors (self) :
     parent = self.parent
     parent_sep = self.parent_sep
     if parent is not None :
         return \
             [   parent_sep.join (s)
             for s in cartesian (parent.selectors, self._selectors)
             ]
     ps = parent_sep.strip ()
     return [(ps + s) for s in self._selectors]
Пример #2
0
 def __call__(self, parent):
     parent_sep = self.parent_sep
     if parent is not None:
         result = \
             [   parent_sep.join (s)
             for s in cartesian (parent.selectors, self._selectors)
             ]
     else:
         ps = parent_sep.lstrip()
         result = [(ps + s) for s in self._selectors]
     return result
Пример #3
0
 def _m_create_auto_children(cls):
     adrs = tuple \
         ( tuple
             ( (r.name, c)
             for c in sorted
                 ( pyk.itervalues (r.E_Type.children_np)
                 , key = TFL.Getter.i_rank
                 )
             if not
                 (  cls.type_name in c.refuse_links
                 or c.type_name   in r.refuse_e_types
                 )
             )
         for r in cls.Roles
         if  r.auto_derive_np and r.E_Type.children_np
         )
     if adrs:
         for adr in cartesian(*adrs):
             cls._m_create_role_child(*adr)
Пример #4
0
 def _m_create_auto_children (cls) :
     adrs = tuple \
         ( tuple
             ( (r.name, c)
             for c in sorted
                 ( pyk.itervalues (r.E_Type.children_np)
                 , key = TFL.Getter.i_rank
                 )
             if not
                 (  cls.type_name in c.refuse_links
                 or c.type_name   in r.refuse_e_types
                 )
             )
         for r in cls.Roles
         if  r.auto_derive_np and r.E_Type.children_np
         )
     if adrs :
         for adr in cartesian (* adrs) :
             cls._m_create_role_child (* adr)