Logo Search packages:      
Sourcecode: accerciser version File versions

def interface_view::_SectionText::popTextAttr (   self,
  offset = None 
)

Populate the attributes view with attributes at the given offset, or at 
the attribute mark.

@param offset: Offset of wanted attributes. If none is given, 
use attribute mark's offset.
@type offset: integer

Definition at line 1392 of file interface_view.py.

01392                                     :
    '''
    Populate the attributes view with attributes at the given offset, or at 
    the attribute mark.

    @param offset: Offset of wanted attributes. If none is given, 
    use attribute mark's offset.
    @type offset: integer
    '''
    try:
      ti = self.node.acc.queryText()
    except:
      return

    if offset is None:
      mark = self.text_buffer.get_mark('attr_mark')
      iter = self.text_buffer.get_iter_at_mark(mark)
      offset = iter.get_offset()

    show_default = self.toggle_defaults.get_active()
    attr, start, end = ti.getAttributes(offset)
    if show_default:
      def_attr = ti.getDefaultAttributes()
      attr_dict = self._attrStringToDict(def_attr)
      attr_dict.update(self._attrStringToDict(attr))
    else:
      attr_dict = self._attrStringToDict(attr)

    attr_list = attr_dict.keys()
    attr_list.sort()

    self.attr_model.clear()
    for attr in attr_list:
      self.attr_model.append([attr, attr_dict[attr]])

    self.text_buffer.remove_tag_by_name(
      'attr_region', 
      self.text_buffer.get_start_iter(),
      self.text_buffer.get_end_iter())
    self.text_buffer.apply_tag_by_name(
      'attr_region',
      self.text_buffer.get_iter_at_offset(start),
      self.text_buffer.get_iter_at_offset(end))
                                  
    self.label_start.set_markup('<i>Start: %d</i>' % start)
    self.label_end.set_markup('<i>End: %d</i>' % end)

  def _onTextViewPressed(self, widget, event):


Generated by  Doxygen 1.6.0   Back to index