(self, form)
| 2026 | self._closed = True |
| 2027 | |
| 2028 | def add_to_form(self, form): |
| 2029 | assert self._form is None or form == self._form, ( |
| 2030 | "can't add control to more than one form") |
| 2031 | self._form = form |
| 2032 | if self.name is None: |
| 2033 | # always count nameless elements as separate controls |
| 2034 | Control.add_to_form(self, form) |
| 2035 | else: |
| 2036 | for ii in xrange(len(form.controls)-1, -1, -1): |
| 2037 | control = form.controls[ii] |
| 2038 | if control.name == self.name and control.type == self.type: |
| 2039 | if control._closed: |
| 2040 | Control.add_to_form(self, form) |
| 2041 | else: |
| 2042 | control.merge_control(self) |
| 2043 | break |
| 2044 | else: |
| 2045 | Control.add_to_form(self, form) |
| 2046 | |
| 2047 | def merge_control(self, control): |
| 2048 | assert bool(control.multiple) == bool(self.multiple) |
nothing calls this directly
no test coverage detected