Пример #1
0
 def  __init__(self):
     QTextEdit.__init__(self)
     self.setFocus()
     self.lastSaved = None
     self.fileName = None
     self.ensureCursorVisible()
     self.defaultWeight = self.fontWeight()
Пример #2
0
    def __init__(self, fetcher, parent):

        QTextEdit.__init__(self, parent)
        BaseFragmentView.__init__(self, fetcher)

        self.setReadOnly(True)
        self.document().setDefaultStyleSheet("""
                    table {
                        border-color: #BCBCBC;
                        border-style: solid;
                        border-collapse: collapse;
                    }
                    table td {
                        padding-top: 2px;
                        padding-bottom: 2px;
                        padding-left: 2px;
                        padding-right: 10px;
                    }

                    table th {
                        text-align: center;
                        padding-top: 5px;
                        padding-bottom: 5px;
                    }
                    """)
Пример #3
0
 def __init__(self, termwidget, *args):
     QTextEdit.__init__(self, *args)
     self.setStyleSheet("font: 9pt \"Courier\";")
     self._fittedHeight = 1
     self.textChanged.connect(self._fit_to_document)
     self._fit_to_document()
     self._termWidget = termwidget
Пример #4
0
    def __init__(self, layer, geometry, parent=None):
        GeomEditor.__init__(self, layer, geometry)
        QTextEdit.__init__(self, parent)

        self.setGeom(geometry)
        self.textChanged.connect(self.geomChanged)
        self.layerEditable()
Пример #5
0
 def __init__(self, mime, parent=None):
     QTextEdit.__init__(self, parent)
     self.setAcceptRichText(False)
     font = QFont()
     font.setFamily('Terminal [DEC]')
     self.setFont(font)
     ts = QFontMetrics(font).maxWidth()
Пример #6
0
    def __init__(self, parent=None, log=''):
        QTextEdit.__init__(self, parent)
        self.setupUi(self)
        self.name = self.windowTitle()
        self.hookTermSize()
        Console.__init__(self, sigstp=False)
        self.completion = completion.Completion(self)
        taskmanager = TaskManager()
        self.vfs = vfs.vfs()
        self.log = log or ''
        if parent is None:
            self.eofKey = Qt.Key_D
        else:
            self.eofKey = None
        self.line    = QString()
        self.lines   = []
        self.point   = 0
        self.more    = 0
        self.reading = 0
        self.pointer = 0
        self.cursor_pos   = 0

        self.fgcolor = QColor("white")
        self.selcolor = QColor("green")

        self.preloop()
        self.redirect = RedirectIO()
        self.sig = "SSputtext(QString)"
        self.connect(self, SIGNAL(self.sig), self.puttext)
        self.connect(self, SIGNAL("Sputtext(QString)"), self.puttext)
        self.redirect.addparent(self, ["dff.ui.gui.widget.shell", "dff.ui.console.console", "dff.ui.console.completion", "dff.ui.console.line_to_arguments", "dff.api.taskmanager.taskmanager", "dff.api.taskmanager.scheduler", "dff.api.taskmanager.processus"], True)
        self.writePrompt()
Пример #7
0
 def __init__(self, parent=None):
     QTextEdit.__init__(self, parent)
     BaseEditMixin.__init__(self)
     TracebackLinksMixin.__init__(self)
     InspectObjectMixin.__init__(self)
     self.calltips = False        # To not use Spyder calltips
     self.found_results = []
Пример #8
0
    def __init__(self, parent=None):
        QTextEdit.__init__(self, parent)

        #self.colorizer = SyntaxColor()

        # to exit the main interpreter by a Ctrl-D if PyCute has no parent
        if parent is None:
            self.eofKey = Qt.Key_D
        else:
            self.eofKey = None
        self.prompt = ""
        # last line + last incomplete lines
        self.line = QtCore.QString()
        self.lines = []
        # the cursor position in the last line
        self.point = 0
        # flag: the interpreter needs more input to run the last lines.
        self.more = 0
        # flag: readline() is being used for e.g. raw_input() and input()
        self.reading = 0
        # history
        self.history = []
        self.pointer = 0
        self.cursor_pos = 0

        # user interface setup
        #self.setTextFormat(Qt.PlainText)

        self.setLineWrapMode(QTextEdit.NoWrap)
Пример #9
0
 def __init__(self, parent=None, accept_empty=False):
     QTextEdit.__init__(self, parent)
     Validable.__init__(self, accept_empty=accept_empty)
     self.setTabChangesFocus(True)
     self.setAcceptRichText(True)
     self.setWhatsThis(tr('<h3><font color="blue">IP List</font></h3>'
         'Enter a list of IP addresses separated by spaces or carriage returns.<br/>'))
Пример #10
0
 def __init__(self, disassembly):
   QTextEdit.__init__(self)
   self.disassembly = disassembly
   self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
   self.setReadOnly(1)
   self.setWordWrapMode(QTextOption.NoWrap)
   self.setFont(QFont("Courier New"))
Пример #11
0
 def __init__(self, parent=None):
     QTextEdit.__init__(self, parent)
     BaseEditMixin.__init__(self)
     TracebackLinksMixin.__init__(self)
     InspectObjectMixin.__init__(self)
     self.calltips = False  # To not use Spyder calltips
     self.found_results = []
Пример #12
0
 def __init__(self, termwidget, *args):
     QTextEdit.__init__(self, *args)
     self.setStyleSheet("font: 9pt \"Courier\";")
     self._fittedHeight = 1
     self.textChanged.connect(self._fit_to_document)
     self._fit_to_document()
     self._termWidget = termwidget
Пример #13
0
    def __init__(self, parent=None, log=''):
        QTextEdit.__init__(self, parent)
        console.__init__(self, sigstp=False)
        self.setupUi(self)
        self.name = self.windowTitle()
	self.completion = completion.Completion(self)
        self.hookTermSize()
	taskmanager = TaskManager()
        self.vfs = vfs.vfs()
        self.log = log or ''
        if parent is None:
            self.eofKey = Qt.Key_D
        else:
            self.eofKey = None
        self.line    = QString()
        self.lines   = []
        self.point   = 0
        self.more    = 0
        self.reading = 0
        self.pointer = 0
        self.cursor_pos   = 0

        self.fgcolor = QColor("white")
        self.selcolor = QColor("green")

        self.preloop()
	self.redirect = RedirectIO()
	self.sig = "Sputtext"
	self.connect(self, SIGNAL(self.sig), self.puttext)
	self.redirect.addparent(self, ["ui.gui.widget.shell", "ui.console.console", "ui.console.completion", "ui.console.line_to_arguments", "api.taskmanager.taskmanager", "api.taskmanager.scheduler", "api.taskmanager.processus"], True)
        self.writePrompt()
Пример #14
0
    def __init__(self, layer, geometry, parent=None):
        GeomEditor.__init__(self, layer, geometry)
        QTextEdit.__init__(self, parent)

        self.setGeom(geometry)
        self.cursorPositionChanged.connect(self.emitCurrentPoint)
        self.textChanged.connect(self.geomChanged)
        self.layerEditable()
Пример #15
0
  def __init__(self, cat):
    QTextEdit.__init__(self)
    self.cat = cat
    self.scroll = self.cat.scroll
    self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
    self.setReadOnly(1)

    self.setWordWrapMode(QTextOption.NoWrap)
Пример #16
0
    def __init__(self, cat):
        QTextEdit.__init__(self)
        self.cat = cat
        self.scroll = self.cat.scroll
        self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
        self.setReadOnly(1)

        self.setWordWrapMode(QTextOption.NoWrap)
Пример #17
0
 def __init__(self, proc):
     QTextEdit.__init__(self)
     self.setReadOnly(1)
     self.icon = 0
     self.name = proc.name
     self.type = "autogen"
     self.proc = proc
     proc.widget = self
     self.connect(self, SIGNAL("puttext"), self.puttext)
Пример #18
0
 def __init__(self, *args):
     QTextEdit.__init__(self, *args)
     self.setTabChangesFocus(True)
     self.setWordWrapMode(QTextOption.NoWrap)
     self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
     self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
     self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
     self.setFixedHeight(self.sizeHint().height())
     self._inlineCompletion = None
Пример #19
0
 def __init__(self, proc):
     QTextEdit.__init__(self)
     self.setReadOnly(1)
     self.icon = 0
     self.name = proc.name
     self.type = "autogen"
     self.proc = proc 
     proc.widget = self
     self.connect(self, SIGNAL("puttext"), self.puttext)
Пример #20
0
 def __init__(self, parent_frame):
     """ really dumb terminal with simple editing support """
     QTextEdit.__init__(self, parent_frame)
     self.setFontFamily("Monospace")
     self.setFontPointSize(8)
     self.setWordWrapMode(QTextOption.NoWrap)
     self.setUndoRedoEnabled(False)
     self._block = False
     self.connect(self, SIGNAL("cursorPositionChanged(int,int)"), self.onCursorPositionChanged)
Пример #21
0
 def __init__(self, installProgress, parent_frame):
     " really dumb terminal with simple editing support "
     QTextEdit.__init__(self, "", parent_frame)
     self.installProgress = installProgress
     self.setFontFamily("Monospace")
     self.setFontPointSize(8)
     self.setWordWrapMode(QTextOption.NoWrap)
     self.setUndoRedoEnabled(False)
     self.setOverwriteMode(True)
     self._block = False
 def __init__(self, parent_frame):
     """ really dumb terminal with simple editing support """
     QTextEdit.__init__(self, parent_frame)
     self.setFontFamily("Monospace")
     self.setFontPointSize(8)
     self.setWordWrapMode(QTextOption.NoWrap)
     self.setUndoRedoEnabled(False)
     self._block = False
     self.connect(self, SIGNAL("cursorPositionChanged(int,int)"),
                  self.onCursorPositionChanged)
Пример #23
0
    def __init__(self, parent):
        QTextEdit.__init__(self, parent)

        self.setStyleSheet(STYLE_SHEET)
        self.setContextMenuPolicy(Qt.CustomContextMenu)
        self.customContextMenuRequested.connect(self._on_context_menu)

        self.addAction(create_widget_action(self, "Alt+Return", self._show_article_property))

        self.article_id = None
        self.new_words = []
        self.highlight = ArticleHighlight(self)
Пример #24
0
    def __init__(self, spell_dict):
        QTextEdit.__init__(self)
        BaseEdit.__init__(self)
        self.spell_dict = spell_dict
        self.highlighter = Highlighter(self.document(), self.spell_dict)
        self.setContextMenuPolicy(Qt.CustomContextMenu)
        self.customContextMenuRequested.connect(self.customContextMenu)
        self.found = False
        self.edit_id = "spellcheck"
        self.completer = QCompleter(self.text())
        self.completer.setCompletionMode(QCompleter.PopupCompletion)

        self.setAcceptRichText(False)
Пример #25
0
    def __init__(self, parent=None, log=''):
        QTextEdit.__init__(self, parent)
        InteractiveInterpreter.__init__(self, None)
        self.setupUi(self)
        self.name = self.windowTitle()
        self.log = log or ''
        self.__canwrite = True

        if parent is None:
            self.eofKey = Qt.Key_D
        else:
            self.eofKey = None

        self.line = QString()
        self.lines = []
        self.point = 0
        self.more = 0
        self.reading = 0
        self.history = []
        self.pointer = 0
        self.cursor_pos = 0
        self.fgcolor = QColor("white")
        self.selcolor = QColor("green")
        self.strcolor = QColor("red")

        self.redirect = RedirectIO()
        self.sig = "IIputtext(QString)"
        self.connect(self, SIGNAL(self.sig),
                     self.sputtext)  #, Qt.QueuedConnection)
        self.connect(self, SIGNAL("Iputtext(QString)"), self.puttext)
        self.redirect.addparent(
            self,
            ["dff.ui.gui.widget.interpreter", "code", "__console__", "pydoc"])

        self.ps1 = ">>> "
        self.ps2 = "... "
        self.writePrompt()
        api_imports = [
            "from dff.api.types.libtypes import Variant, VList, VMap, DateTime, typeId, Argument, Parameter, ConfigManager, Constant, Config, Path",
            "from dff.api.vfs.vfs import vfs",
            "from dff.api.vfs.libvfs import VFS, FileMapping, ABSOLUTE_ATTR_NAME, RELATIVE_ATTR_NAME",
            "from dff.api.filters.libfilters import Filter",
            "from dff.api.search.libsearch import Search",
            "from dff.api.events.libevents import EventHandler, event",
            "from dff.api.datatype.libdatatype import DataTypeManager, DataTypeHandler",
            "from dff.api.loader.loader import loader",
            "from dff.api.module.module import Module, Script",
            "from dff.api.taskmanager.taskmanager import TaskManager"
        ]
        for api_import in api_imports:
            self.more = self.runsource(api_import)
Пример #26
0
    def __init__(self, parent=None, log=""):
        QTextEdit.__init__(self, parent)
        InteractiveInterpreter.__init__(self, None)
        self.setupUi(self)
        self.name = self.windowTitle()
        self.log = log or ""
        self.__canwrite = True

        if parent is None:
            self.eofKey = Qt.Key_D
        else:
            self.eofKey = None

        self.line = QString()
        self.lines = []
        self.point = 0
        self.more = 0
        self.reading = 0
        self.history = []
        self.pointer = 0
        self.cursor_pos = 0
        self.fgcolor = QColor("white")
        self.selcolor = QColor("green")
        self.strcolor = QColor("red")

        self.redirect = RedirectIO()
        self.sig = "Iputtext"
        self.connect(self, SIGNAL(self.sig), self.puttext)
        self.redirect.addparent(self, ["ui.gui.widget.interpreter", "code", "__console__", "pydoc"])

        self.ps1 = ">>> "
        self.ps2 = "... "
        self.writePrompt()
        api_imports = [
            "from api.types.libtypes import Variant, VList, VMap, vtime, typeId, Argument, Parameter, ConfigManager, Constant, Config, Path",
            "from api.vfs.vfs import vfs",
            "from api.vfs.libvfs import VFS, FileMapping, ABSOLUTE_ATTR_NAME, RELATIVE_ATTR_NAME",
            "from api.filters.libfilters import Filter",
            "from api.search.libsearch import Search",
            "from api.events.libevents import EventHandler, event",
            "from api.datatype.libdatatype import DataTypeManager, DataTypeHandler",
            "from api.loader.loader import loader",
            "from api.module.module import Module, Script",
            "from api.magic.libmagichandler import MagicType, MimeType",
            "from api.taskmanager.taskmanager import TaskManager",
        ]
        for api_import in api_imports:
            self.more = self.runsource(api_import)
Пример #27
0
    def __init__(self,
                 parent,
                 completerMode=False,
                 dataCache=[],
                 dataInputs=[]):
        """
        Text raw editor 
        """
        QTextEdit.__init__(self, parent)

        self.completerMode = completerMode
        self.dataCache = dataCache
        self.dataInputs = dataInputs

        if self.completerMode:
            self.completer = MainCompleter()
            self.completer.setWidget(self)
            self.completer.setCompletionMode(QCompleter.PopupCompletion)
            self.completer.insertText.connect(self.insertCompletion)

        self.createWidget()
Пример #28
0
    def __init__ ( self, parent = None ):
        """ Initialise the instance.
        """
        if isinstance( parent, QLayout ):
            parent = None

        QTextEdit.__init__( self, parent )

        self.setAcceptDrops( True )
        self.setAcceptRichText( False )
        self.setWordWrapMode( QTextOption.WrapAnywhere )

        self.interpreter = code.InteractiveInterpreter()

        self.exec_callback = None

        self._line        = QString()
        self._lines       = []
        self._more        = False
        self.history      = []
        self.historyIndex = 0
        self._reading     = False
        self._point       = 0

        # Interpreter prompts.
        try:
            sys.ps1
        except AttributeError:
            sys.ps1 = ">>> "

        try:
            sys.ps2
        except AttributeError:
            sys.ps2 = "... "

        # Interpreter banner:
        self.write( 'Python %s on %s.\n' % ( sys.version, sys.platform ) )
        self.write( 'Type "copyright", "credits" or "license" for more '
                    'information.\n' )
        self.write( sys.ps1 )
Пример #29
0
    def __init__(self, parent=None, log=''):
        QTextEdit.__init__(self, parent)
        console.__init__(self)
	self.completion = completion.Completion(self)
	taskmanager = TaskManager()
        self.vfs = vfs.vfs()
        self.log = log or ''
        if parent is None:
            self.eofKey = Qt.Key_D
        else:
            self.eofKey = None
        self.line    = QString()
        self.lines   = []
        self.point   = 0
        self.more    = 0
        self.reading = 0
        self.pointer = 0
        self.cursor_pos   = 0
	font = QFont("Courier")
	font.setFixedPitch(1)
	fm = QFontMetrics(font)	
       	self.fontwidth = fm.averageCharWidth()
	self.setFont(font)
        self.bgcolor = QColor("black")
        self.fgcolor = QColor("white")
        self.selcolor = QColor("green")
        pal = QPalette()
        pal.setColor(pal.Base, self.bgcolor)
        pal.setColor(pal.Text, self.fgcolor)
        self.setPalette(pal)
        self.preloop()
        self.cwd = self.vfs.getcwd()
        self.ps1 = self.cwd.path + "/" + self.cwd.name + " > "
	self.redirect = RedirectIO()
	self.sig = "Sputtext"
	self.connect(self, SIGNAL(self.sig), self.puttext)
	self.redirect.addparent(self, ["ui.gui.widget.shell", "ui.console.console", "ui.console.completion", "ui.console.line_to_arguments", "api.taskmanager.taskmanager", "api.taskmanager.scheduler", "api.taskmanager.processus"], True)
        self.write('Welcome to dff shell\n')
        self.write(self.ps1)
Пример #30
0
    def __init__(self, parent=None):
        QTextEdit.__init__(self, parent)
        # Undo/Redo
        self.undo_available = False
        self.redo_available = False
        self.connect(self, SIGNAL("undoAvailable(bool)"), self.set_undo)
        self.connect(self, SIGNAL("redoAvailable(bool)"), self.set_redo)
        self.connect(self, SIGNAL('textChanged()'), self.changed)
        self.connect(self, SIGNAL('cursorPositionChanged()'),
                     self.cursor_position_changed)

        # Code completion / calltips
        self.completion_widget = CompletionWidget(self, parent)
        self.codecompletion = True
        self.codecompletion_enter = False
        self.calltips = True
        self.completion_text = ""
        self.calltip_position = None

        # Brace matching
        self.bracepos = None

        self.setup()
Пример #31
0
    def __init__(self, parent=None, log=''):
        QTextEdit.__init__(self, parent)
	InteractiveInterpreter.__init__(self, None)
        self.log = log or ''

        if parent is None:
            self.eofKey = Qt.Key_D
        else:
            self.eofKey = None
       
        self.line    = QString()
        self.lines   = []
        self.point   = 0
        self.more    = 0
        self.reading = 0
        self.history = []
        self.pointer = 0
        self.cursor_pos   = 0
        self.bgcolor = QColor("black")
        self.fgcolor = QColor("white")
        self.selcolor = QColor("green")
        self.strcolor = QColor("red")
        pal = QPalette()
        pal.setColor(pal.Base, self.bgcolor)
        pal.setColor(pal.Text, self.fgcolor)
        self.setPalette(pal)

	self.redirect = RedirectIO()
	self.sig = "Iputtext"
	self.connect(self, SIGNAL(self.sig), self.puttext)
	self.redirect.addparent(self, ["ui.gui.widget.interpreter", "code", "__console__", "pydoc"])

        self.ps1 = ">>> "
        self.ps2 = "... "
        self.write('Python Interpreter\n')
        self.write(self.ps1)
        self.more = self.runsource("from api.vfs import *; v = vfs.vfs()")
Пример #32
0
 def __init__(self):
     QTextEdit.__init__(self)
     self.completer = None
     self.setAcceptRichText(False)
     self.setTabChangesFocus(True)
Пример #33
0
    def __init__(self, parent=None):
        QTextEdit.__init__(self)

        self.placeholderText = None
Пример #34
0
    def __init__(self, interpreter, message="", log="", parent=None):
        """Constructor.
        @param interpreter : InteractiveInterpreter in which
        the code will be executed

        @param message : welcome message string
        
        @param 'log' : specifies the file in which the
        interpreter session is to be logged.

        @param  'parent' : specifies the parent widget.
        If no parent widget has been specified, it is possible to
        exit the interpreter by Ctrl-D.
        """

        QTextEdit.__init__(self, parent)
        self.interpreter = interpreter
        self.colorizer = SyntaxColor()

        # session log
        self.log = log or ""

        # to exit the main interpreter by a Ctrl-D if PyCute has no parent
        if parent is None:
            self.eofKey = Qt.Key_D
        else:
            self.eofKey = None

        # capture all interactive input/output
        sys.stdout = self
        sys.stderr = MultipleRedirection((sys.stderr, self))
        sys.stdin = self

        # last line + last incomplete lines
        self.line = QtCore.QString()
        self.lines = []
        # the cursor position in the last line
        self.point = 0
        # flag: the interpreter needs more input to run the last lines.
        self.more = 0
        # flag: readline() is being used for e.g. raw_input() and input()
        self.reading = 0
        # history
        self.history = []
        self.pointer = 0
        self.cursor_pos = 0

        # user interface setup
        # self.setTextFormat(Qt.PlainText)
        self.setLineWrapMode(QTextEdit.NoWrap)
        # self.setCaption('Python Shell')

        #         # font
        #         if os.name == 'posix':
        #             font = QtGui.QFont("Fixed", 8)
        #         elif os.name == 'nt' or os.name == 'dos':
        #             font = QtGui.QFont("Courier New", 8)
        #         else:
        #             raise SystemExit, "FIXME for 'os2', 'mac', 'ce' or 'riscos'"
        #         font.setFixedPitch(1)
        #         self.setFont(font)

        #         # geometry
        #         height = 40*QtGui.QFontMetrics(font).lineSpacing()
        #         request = QtCore.QSize(600, height)
        #         if parent is not None:
        #             request = request.boundedTo(parent.size())
        #         self.resize(request)

        # interpreter prompt.
        try:
            sys.ps1
        except AttributeError:
            sys.ps1 = ">>> "
        try:
            sys.ps2
        except AttributeError:
            sys.ps2 = "... "

        # interpreter banner
        self.write("The shell running Python %s on %s.\n" % (sys.version, sys.platform))
        self.write('Type "copyright", "credits" or "license"' " for more information on Python.\n")
        self.write(message + "\n\n")
        self.write(
            "This is the standard Shell.\n"
            + "Autocompletion is not available unless QScintilla is installed:\n"
            + "See http://www.riverbankcomputing.co.uk/qscintilla.\n\n"
        )
        self.write(sys.ps1)
Пример #35
0
 def __init__(self, parent):
     QTextEdit.__init__(self, parent=parent)
     self.setReadOnly(True)
Пример #36
0
 def __init__(self, focusin, focusout):
     QTextEdit.__init__(self)        
     self.focusin = focusin
     self.focusout = focusout
     self.createActions()
Пример #37
0
 def __init__(self, focusin, focusout):
     QTextEdit.__init__(self)
     self.focusin = focusin
     self.focusout = focusout
     self.createActions()
Пример #38
0
    def __init__(self, do, parent=None):
        QTextEdit.__init__(self, parent)

        do.debugController.ptyhandler.dataAvailable.connect(self.outputInferiorData)
Пример #39
0
 def __init__(self, parent):
     QTextEdit.__init__(self, parent)
     self.installEventFilter(self)
     return
Пример #40
0
 def __init__(self, parent):
     QTextEdit.__init__(self, parent)
     self.text = ""
     self.filter = ""
Пример #41
0
 def __init__(self, *args):
     QTextEdit.__init__(self, *args)
     msg = 'WARNING: could not import PyQwt5\nPlease install "python-qwt5-qt4" to enable data plotting.\n\nError message:\n' + str(e)
     print msg
     self.setText(msg)
     self.setReadOnly(True)
Пример #42
0
 def __init__(self, parent):
     QTextEdit.__init__(self)
     self.initValues(parent)
     self.initFont()
Пример #43
0
 def __init__(self, parent=None):
     QTextEdit.__init__(self, parent)
     BaseEditMixin.__init__(self)
     self.found_results = []
Пример #44
0
 def __init__(self, parent = None):
     QTextEdit.__init__(self, parent)
     self._logtext = ""
Пример #45
0
 def __init__(self, layer, geometry, parent=None):
     GeomEditor.__init__(self, layer, geometry)
     QTextEdit.__init__(self, parent)
Пример #46
0
 def __init__(self):
     QTextEdit.__init__(self)
     self.setTextInteractionFlags(Qt.TextSelectableByKeyboard | Qt.TextSelectableByMouse)
Пример #47
0
 def __init__(self, termWidget, *args):
     QTextEdit.__init__(self, *args)
     self._fittedHeight = 0
     self.textChanged.connect(self._fitToDocument)
     self._fitToDocument()
     self._termWidget = termWidget
Пример #48
0
 def __init__(self, parent=None):
     QTextEdit.__init__(self, parent)
     BaseEditMixin.__init__(self)
     self.found_results = []
Пример #49
0
 def __init__(self, parent):
     QTextEdit.__init__(self)
     self.initValues(parent)
     self.initFont()
Пример #50
0
 def __init__(self, parent):
     QTextEdit.__init__(self, parent)
     self.setReadOnly(True)
     self.viewport().setMouseTracking(True)
     self.urls = []
Пример #51
0
 def __init__(self, parent):
     QTextEdit.__init__(self, parent)
     self.setTabStopWidth(32)
     self.highlighter = highlighter.MarkdownHighlighter(self)
Пример #52
0
    def __init__(self, interpreter, message="", log='', parent=None):
        """Constructor.
        @param interpreter : InteractiveInterpreter in which
        the code will be executed

        @param message : welcome message string

        @param 'log' : specifies the file in which the
        interpreter session is to be logged.

        @param  'parent' : specifies the parent widget.
        If no parent widget has been specified, it is possible to
        exit the interpreter by Ctrl-D.
        """

        QTextEdit.__init__(self, parent)

        self.interpreter = interpreter
        self.colorizer = SyntaxColor()

        # session log
        self.log = log or ''

        # to exit the main interpreter by a Ctrl-D if PyCute has no parent
        if parent is None:
            self.eofKey = Qt.Key_D
        else:
            self.eofKey = None

        # capture all interactive input/output
        sys.stdout = self
        sys.stderr = MultipleRedirection((sys.stderr, self))
        sys.stdin = self

        # last line + last incomplete lines
        self.line = QtCore.QString()
        self.lines = []
        # the cursor position in the last line
        self.point = 0
        # flag: the interpreter needs more input to run the last lines.
        self.more = 0
        # flag: readline() is being used for e.g. raw_input() and input()
        self.reading = 0
        # history
        self.history = []
        self.pointer = 0
        self.cursor_pos = 0

        # user interface setup
        #self.setTextFormat(Qt.PlainText)
        self.setLineWrapMode(QTextEdit.NoWrap)
        #self.setCaption('Python Shell')

        #         # font
        #         if os.name == 'posix':
        #             font = QtGui.QFont("Fixed", 8)
        #         elif os.name == 'nt' or os.name == 'dos':
        #             font = QtGui.QFont("Courier New", 8)
        #         else:
        #             raise SystemExit, "FIXME for 'os2', 'mac', 'ce' or 'riscos'"
        #         font.setFixedPitch(1)
        #         self.setFont(font)

        #         # geometry
        #         height = 40*QtGui.QFontMetrics(font).lineSpacing()
        #         request = QtCore.QSize(600, height)
        #         if parent is not None:
        #             request = request.boundedTo(parent.size())
        #         self.resize(request)

        # interpreter prompt.
        try:
            sys.ps1
        except AttributeError:
            sys.ps1 = ">>> "
        try:
            sys.ps2
        except AttributeError:
            sys.ps2 = "... "

        # interpreter banner
#        self.write('The shell running Python %s on %s.\n' %
#                   (sys.version, sys.platform))
#        self.write('Type "copyright", "credits" or "license"'
#                   ' for more information on Python.\n')
        self.write(message + '\n\n')
        self.write(sys.ps1)
Пример #53
0
    def __init__(self, debug_controller, parent=None):
        QTextEdit.__init__(self, parent)

        QObject.connect(debug_controller.ptyhandler, SIGNAL('dataAvailable(QString)'), self.outputInferiorData)
Пример #54
0
 def __init__(self, parent):
     """
     Text raw editor 
     """
     QTextEdit.__init__(self, parent)
     self.createWidget()