cubicweb/sobjects/textparsers.py
branch3.26
changeset 12432 2fcb53ee5178
parent 11811 f09efeead7f9
equal deleted inserted replaced
12431:a570191d67b0 12432:2fcb53ee5178
    57 class ChangeStateTextParser(TextParser):
    57 class ChangeStateTextParser(TextParser):
    58     """search some text for change state instruction in the form
    58     """search some text for change state instruction in the form
    59 
    59 
    60          :<transition name>: #?<eid>
    60          :<transition name>: #?<eid>
    61     """
    61     """
    62     instr_rgx = re.compile(':(\w+):\s*#?(\d+)', re.U)
    62     instr_rgx = re.compile(r':(\w+):\s*#?(\d+)', re.U)
    63 
    63 
    64     def parse(self, caller, text):
    64     def parse(self, caller, text):
    65         for trname, eid in self.instr_rgx.findall(text):
    65         for trname, eid in self.instr_rgx.findall(text):
    66             try:
    66             try:
    67                 entity = self._cw.entity_from_eid(int(eid))
    67                 entity = self._cw.entity_from_eid(int(eid))