예제 #1
0
파일: messages.py 프로젝트: intfrr/Tortazo
    def __init__(self, scroll_bar, active_filter, possible):
        """
        :param scroll_bar: Gtk Vertical Scrollbar object
        :param active_filter: the filter active at startup.
        :param possible: all filter keys
        """
        gtk.TextView.__init__(self)
        MessageConsumer.__init__(self)
        
        self.set_editable(False)
        self.set_cursor_visible(False)
        self.set_wrap_mode(gtk.WRAP_WORD)
        self.textbuffer = self.get_buffer()
        self.show()
        self.possible = set(possible)
        self.active_filter = active_filter
        self.text_position = 0
        
        self.all_messages = DiskList()
        
        # scroll bar
        self.freeze_scrollbar = False
        scroll_bar.connect("value-changed", self.scroll_changed)

        # colors
        self.textbuffer.create_tag("red-fg", foreground="red")
        self.textbuffer.create_tag("blue-fg", foreground="blue")
        self.textbuffer.create_tag("brown-fg", foreground="brown")
        self.bg_colors = {
            "vulnerability": "red-fg",
            "information": "blue-fg",
            "error": "brown-fg",
        }
예제 #2
0
파일: prompt.py 프로젝트: chenbremer/w3af-1
    def __init__(self, prompt_text, procfunc):
        gtk.TextView.__init__(self)
        MessageConsumer.__init__(self)

        self.prompt_text = prompt_text
        self.procfunc = procfunc
        
        self.set_wrap_mode(gtk.WRAP_CHAR)

        # keys
        self.keys = {
            gtk.gdk.keyval_from_name("Return"): self._key_enter,
            gtk.gdk.keyval_from_name("KP_Enter"): self._key_enter,
            gtk.gdk.keyval_from_name("Up"): self._key_up,
            gtk.gdk.keyval_from_name("Down"): self._key_down,
            gtk.gdk.keyval_from_name("BackSpace"): self._key_backspace,
            gtk.gdk.keyval_from_name("Control_L"): lambda: False,
            gtk.gdk.keyval_from_name("Control_R"): lambda: False,
        }

        # mono spaced font looks more like a terminal to me =)
        # and works better with the output of some unix commands
        # that are run remotely and displayed in the console
        pangoFont = pango.FontDescription('Courier 11')
        self.modify_font(pangoFont)

        # Buttons, buffers and stuff:
        self.textbuffer = self.get_buffer()
        self.user_started = None
        self.all_lines = []
        self.cursorPosition = None
        self.historyCount = 0

        self.connect("key-press-event", self._key)
        self.connect("button-press-event", self._button_press)
        self.connect("button-release-event", self._button_release)
        self.show()
        gobject.idle_add(self._prompt)
        gobject.idle_add(self.grab_focus)
예제 #3
0
파일: graph.py 프로젝트: 3rdDegree/w3af
    def __init__(self, w3af):
        gtk.DrawingArea.__init__(self)
        MessageConsumer.__init__(self)
        
        self.w3af = w3af
        
        self.pangolayout = self.create_pango_layout("")

        # store all messages to be able to redraw
        self.all_messages = DiskList()
        self._need_redraw = 0
        
        # control variables
        self.alreadyStopped = False
        self.timeGrouping = 2
        self.timeBase = int(time.time() * 1000)
        self.realLeftMargin = MIZQ
        self.gc = None
        self._redraw_gen = None

        # Go live!
        self.connect("expose-event", self.area_expose_cb)
        gobject.timeout_add(500, self.draw_handler)
        self.show()
예제 #4
0
파일: graph.py 프로젝트: z0r1nga/w3af
    def __init__(self, w3af):
        gtk.DrawingArea.__init__(self)
        MessageConsumer.__init__(self)
        
        self.w3af = w3af
        
        self.pangolayout = self.create_pango_layout("")

        # store all messages to be able to redraw
        self.all_messages = DiskList(table_prefix='gui_graph')
        self._need_redraw = 0
        
        # control variables
        self.alreadyStopped = False
        self.timeGrouping = 2
        self.timeBase = int(time.time() * 1000)
        self.realLeftMargin = MIZQ
        self.gc = None
        self._redraw_gen = None

        # Go live!
        self.connect("expose-event", self.area_expose_cb)
        gobject.timeout_add(500, self.draw_handler)
        self.show()
예제 #5
0
파일: utils.py 프로젝트: 0x554simon/w3af
 def __init__(self, title, tabnames=(), icon=None):
     entries.TextDialog.__init__(self, title, tabnames, icon)
     MessageConsumer.__init__(self)
예제 #6
0
 def __init__(self, title, tabnames=(), icon=None):
     entries.TextDialog.__init__(self, title, tabnames, icon)
     MessageConsumer.__init__(self)