Пример #1
0
 def start_multisection(self, attrs):
     sectiontype = self.get_sectiontype(attrs)
     min, max = self.get_ordinality(attrs)
     any, name, attribute = self.get_name_info(attrs, "multisection", "*")
     if any not in ("*", "+"):
         self.error("multisection must specify '*' or '+' for the name")
     handler = self.get_handler(attrs)
     section = info.SectionInfo(any or name, sectiontype, min, max, handler,
                                attribute)
     self._stack[-1].addsection(name, section)
     self._stack.append(section)
Пример #2
0
 def start_section(self, attrs):
     sectiontype = self.get_sectiontype(attrs)
     handler = self.get_handler(attrs)
     min = self.get_required(attrs) and 1 or 0
     any, name, attribute = self.get_name_info(attrs, "section", "*")
     if any and not attribute:
         self.error(
             "attribute must be specified if section name is '*' or '+'")
     section = info.SectionInfo(any or name, sectiontype, min, 1, handler,
                                attribute)
     self._stack[-1].addsection(name, section)
     self._stack.append(section)
Пример #3
0
 def start_section(self, attrs):
     sectiontype = self.get_sectiontype(attrs)
     handler = self.get_handler(attrs)
     minOccurs = 1 if self.get_required(attrs) else 0
     any_name, name, attribute = self.get_name_info(attrs, "section", "*")
     if any_name and not attribute:  # pragma: no cover
         # It seems like this is handled by get_name_info.
         self.error(
             "attribute must be specified if section name is '*' or '+'")
     section = info.SectionInfo(any_name or name, sectiontype, minOccurs, 1,
                                handler, attribute)
     self._stack[-1].addsection(name, section)
     self._stack.append(section)