Exemple #1
0
 def focus(self):
     app.log.info('InteractivePrediction.focus')
     self.commandDefault = self.textBuffer.insertPrintable
     self.priorTextBuffer = self.host.textBuffer
     self.index = self.buildFileList(self.host.textBuffer.fullPath)
     self.host.setTextBuffer(text_buffer.TextBuffer())
     self.host.textBuffer.rootGrammar = app.prefs.getGrammar('_pre')
Exemple #2
0
 def focus(self):
     app.log.info('InteractiveOpener.focus\n',
                  self.host.textBuffer.fullPath)
     self.priorTextBuffer = self.host.textBuffer
     self.commandDefault = self.textBuffer.insertPrintable
     self.textBuffer.selectionAll()
     self.textBuffer.editPasteLines((self.host.textBuffer.fullPath, ))
     # Create a new text buffer to display dir listing.
     self.host.setTextBuffer(text_buffer.TextBuffer())
Exemple #3
0
 def focus(self):
     app.log.info('InteractiveOpener.focus\n',
                  self.host.textBuffer.fullPath)
     self.priorTextBuffer = self.host.textBuffer
     self.commandDefault = self.textBuffer.insertPrintable
     self.textBuffer.selectionAll()
     if len(self.host.textBuffer.fullPath) == 0:
         path = os.getcwd()
     else:
         path = os.path.dirname(self.host.textBuffer.fullPath)
     if len(path) != 0:
         path += os.path.sep
     self.textBuffer.editPasteLines((path, ))
     # Create a new text buffer to display dir listing.
     self.host.setTextBuffer(text_buffer.TextBuffer())
Exemple #4
0
 def focus(self):
   app.log.info('InteractiveOpener.focus')
   EditText.focus(self)
   # Create a new text buffer to display dir listing.
   self.host.setTextBuffer(text_buffer.TextBuffer(self.prg))
Exemple #5
0
    def __init__(self):
        Tab.__init__(self)
        self.state = 'normal'
        self.name = 'XMLTab'
        self.filters = []

        self.core_buffer = self.core.xml_buffer
        self.filtered_buffer = text_buffer.TextBuffer()

        self.info_header = windows.XMLInfoWin()
        self.text_win = windows.XMLTextWin()
        self.core_buffer.add_window(self.text_win)
        self.default_help_message = windows.HelpText("/ to enter a command")

        self.register_command('close',
                              self.close,
                              shortdesc=_("Close this tab."))
        self.register_command('clear',
                              self.command_clear,
                              shortdesc=_('Clear the current buffer.'))
        self.register_command('reset',
                              self.command_reset,
                              shortdesc=_('Reset the stanza filter.'))
        self.register_command(
            'filter_id',
            self.command_filter_id,
            usage='<id>',
            desc=_('Show only the stanzas with the id <id>.'),
            shortdesc=_('Filter by id.'))
        self.register_command(
            'filter_xpath',
            self.command_filter_xpath,
            usage='<xpath>',
            desc=_(
                'Show only the stanzas matching the xpath <xpath>.'
                ' Any occurrences of %n will be replaced by jabber:client.'),
            shortdesc=_('Filter by XPath.'))
        self.register_command(
            'filter_jid',
            self.command_filter_jid,
            usage='<jid>',
            desc=_(
                'Show only the stanzas matching the jid <jid> in from= or to=.'
            ),
            shortdesc=_('Filter by JID.'))
        self.register_command(
            'filter_from',
            self.command_filter_from,
            usage='<jid>',
            desc=_('Show only the stanzas matching the jid <jid> in from=.'),
            shortdesc=_('Filter by JID from.'))
        self.register_command(
            'filter_to',
            self.command_filter_to,
            usage='<jid>',
            desc=_('Show only the stanzas matching the jid <jid> in to=.'),
            shortdesc=_('Filter by JID to.'))
        self.register_command(
            'filter_xmlmask',
            self.command_filter_xmlmask,
            usage=_('<xml mask>'),
            desc=_('Show only the stanzas matching the given xml mask.'),
            shortdesc=_('Filter by xml mask.'))
        self.register_command(
            'dump',
            self.command_dump,
            usage=_('<filename>'),
            desc=_('Writes the content of the XML buffer into a file.'),
            shortdesc=_('Write in a file.'))
        self.input = self.default_help_message
        self.key_func['^T'] = self.close
        self.key_func['^I'] = self.completion
        self.key_func["KEY_DOWN"] = self.on_scroll_down
        self.key_func["KEY_UP"] = self.on_scroll_up
        self.key_func["^K"] = self.on_freeze
        self.key_func["/"] = self.on_slash
        self.resize()
        # Used to display the infobar
        self.filter_type = ''
        self.filter = ''
    def __init__(self, text=''):

        self._text_storage = text_buffer.TextBuffer(text)
        self._status = []
        self._current_token = None