Пример #1
0
 def awakeFromNib(self):
     self.setFont_(NSFont.userFixedPitchFontOfSize_(10))
     self.p_colors = {
         "stderr": NSColor.redColor(),
         "stdout": NSColor.blueColor(),
         "code": NSColor.blackColor(),
     }
     self.setHistoryLength_(50)
     self.setHistoryView_(0)
     self.setInteracting_(False)
     self.setAutoScroll_(True)
     self.setSingleLineInteraction_(False)
     self.p_history = [""]
     self.p_input_callbacks = []
     self.p_input_lines = []
     self.setupTextView()
     self.interpreter.connect()
Пример #2
0
 def awakeFromNib(self):
     self = super(PyInterpreter, self).init()
     self._font = NSFont.userFixedPitchFontOfSize_(10)
     self._stderrColor = NSColor.redColor()
     self._stdoutColor = NSColor.blueColor()
     self._codeColor = NSColor.blackColor()
     self._historyLength = 50
     self._history = [""]
     self._historyView = 0
     self._characterIndexForInput = 0
     self._stdin = PseudoUTF8Input(self._nestedRunLoopReaderUntilEOLchars_)
     # self._stdin = PseudoUTF8Input(self.readStdin)
     self._stderr = PseudoUTF8Output(self.writeStderr_)
     self._stdout = PseudoUTF8Output(self.writeStdout_)
     self._isInteracting = False
     self._console = AsyncInteractiveConsole()
     self._interp = self._console.asyncinteract(write=self.writeCode_).next
     self._autoscroll = True
     self.applicationDidFinishLaunching_(None)
Пример #3
0
 def awakeFromNib(self):
     self = super(PyInterpreter, self).init()
     self._font = NSFont.userFixedPitchFontOfSize_(10)
     self._stderrColor = NSColor.redColor()
     self._stdoutColor = NSColor.blueColor()
     self._codeColor = NSColor.blackColor()
     self._historyLength = 50
     self._history = ['']
     self._historyView = 0
     self._characterIndexForInput = 0
     self._stdin = PseudoUTF8Input(self._nestedRunLoopReaderUntilEOLchars_)
     #self._stdin = PseudoUTF8Input(self.readStdin)
     self._stderr = PseudoUTF8Output(self.writeStderr_)
     self._stdout = PseudoUTF8Output(self.writeStdout_)
     self._isInteracting = False
     self._console = AsyncInteractiveConsole()
     self._interp = partial(next, self._console.asyncinteract(
         write=self.writeCode_,
     ))
     self._autoscroll = True