tmt/utils.py
def remove(self, section, item=None):
        """ Remove given section or section item """
        # Remove the whole section
        if item is None:
            try:
                del self._sections[section]
                del self._order[self._order.index(section)]
            except KeyError:
                raise StructuredFieldError(
                        "Section [{0}] not found".format(ascii(section)))
        # Remove only selected item from the section
        else:
            try:
                dictionary = self._read_section(self._sections[section])
                del(dictionary[item])
            except KeyError:
                raise StructuredFieldError(
                        "Unable to remove '{0}' from section '{1}'".format(
                        ascii(item), ascii(section)))
            self._sections[section] = self._write_section(dictionary)
 Remove given section or section item 
Remove given section or section item
Remove given section or section item
def remove(self, section, item=None):
        if item is None:
            try:
                del self._sections[section]
                del self._order[self._order.index(section)]
            except KeyError:
                raise StructuredFieldError(
                        "Section [{0}] not found".format(ascii(section)))
        else:
            try:
                dictionary = self._read_section(self._sections[section])
                del(dictionary[item])
            except KeyError:
                raise StructuredFieldError(
                        "Unable to remove '{0}' from section '{1}'".format(
                        ascii(item), ascii(section)))
            self._sections[section] = self._write_section(dictionary)
def remove ( self , section , item = None ) : if item is None : try : del self . _sections [ section ] del self . _order [ self . _order . index ( section ) ] except KeyError : raise StructuredFieldError ( "Section [{0}] not found" . format ( ascii ( section ) ) ) else : try : dictionary = self . _read_section ( self . _sections [ section ] ) del ( dictionary [ item ] ) except KeyError : raise StructuredFieldError ( "Unable to remove '{0}' from section '{1}'" . format ( ascii ( item ) , ascii ( section ) ) ) self . _sections [ section ] = self . _write_section ( dictionary )
Remove given section or section item
Remove given section or section item
""" Remove given section or section item """ # Remove the whole section # Remove only selected item from the section
self
section
item