Ejemplo n.º 1
0
 def __init__(self, string: str) -> None:
     """
     :param string: NODE:name1/SUBNODE:name2/SUBSUBNODE:name3/ValueName:value
     """
     AbstractTerm.__init__(self)
     self.negative = string.startswith("^")
     list.__init__(self,
                   (self.Node(t) for t in string.strip("^").split("/")))
Ejemplo n.º 2
0
 def __init__(self, *terms):
     AbstractTerm.__init__(self)
     list.__init__(self, (SearchTerm.Convert(t) for t in terms))
Ejemplo n.º 3
0
 def __str__(self):
     return AbstractTerm.__str__(self) + str(self.root)
Ejemplo n.º 4
0
 def __init__(self, term=None):
     AbstractTerm.__init__(self)
     self.root = SearchGroup(term) if term else SearchGroup()
     self.last = self.root
Ejemplo n.º 5
0
 def __str__(self):
     return AbstractTerm.__str__(self) + f"{self.term1} OR {self.term2}"
Ejemplo n.º 6
0
 def __init__(self, term1, term2):
     AbstractTerm.__init__(self)
     self.term1 = term1
     self.term2 = term2
Ejemplo n.º 7
0
 def __str__(self):
     return AbstractTerm.__str__(self) + "/".join(str(n) for n in self)