sys.__stdout__.write

Here are the examples of the python api sys.__stdout__.write taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

60 Examples 7

Example 1

Project: pymo
Source File: test_bsddb3.py
View license
    def testCheckElapsedTime(self):
        # Print still working message since these tests can be really slow.
        now = time.time()
        if self.next_time <= now:
            TimingCheck.next_time = now + self._PRINT_WORKING_MSG_INTERVAL
            sys.__stdout__.write('  test_bsddb3 still working, be patient...\n')
            sys.__stdout__.flush()

Example 2

Project: qtop
Source File: serialiser.py
View license
    def _process_qstat_line(self, re_search, line, re_match_positions):
        """
        extracts data from a tabular qstat-like file
        returns a list
        """
        qstat_values = dict()
        m = re.search(re_search, line.strip())

        try:
            job_id, user, job_state, queue = [m.group(x) for x in re_match_positions]
        except AttributeError:
            sys.__stdout__.write('Line: %s not properly parsed by regex expression.\n' % line.strip())
            raise
        job_id = job_id.split('.')[0]
        user = user if not self.options.ANONYMIZE else self.anonymize(user, 'users')
        for key, value in [('JobId', job_id), ('UnixAccount', user), ('S', job_state), ('Queue', queue)]:
            qstat_values[key] = value
        return qstat_values

Example 3

Project: imagrium
Source File: test_bsddb3.py
View license
    def testCheckElapsedTime(self):
        # Print still working message since these tests can be really slow.
        now = time.time()
        if self.next_time <= now:
            TimingCheck.next_time = now + self._PRINT_WORKING_MSG_INTERVAL
            sys.__stdout__.write('  test_bsddb3 still working, be patient...\n')
            sys.__stdout__.flush()

Example 4

Project: sublime-robot-plugin
Source File: logger.py
View license
def console(msg, newline=True):
    """Writes the message to the console.

    If the `newline` argument is `True`, a newline character is automatically
    added to the message.
    """
    if newline:
        msg += '\n'
    sys.__stdout__.write(msg)

Example 5

View license
    def write(self, data):
        data = data.encode('utf-8')
        sys.__stdout__.write(data)
        self.f.write(data)
        if self.fl:
            self.f.flush()

Example 6

Project: py3status
Source File: helpers.py
View license
def print_line(line):
    """
    Print given line to stdout (i3bar).
    """
    sys.__stdout__.write('{}\n'.format(line))
    sys.__stdout__.flush()

Example 7

Project: termite-data-server
Source File: widget.py
View license
    def write(self, data):
        """   """

        sys.__stdout__.write(data)
        if hasattr(self, 'callback'):
            self.callback(data)
        else:
            self.buffer.write(data)

Example 8

Project: termite-visualizations
Source File: widget.py
View license
    def write(self, data):
        """   """

        sys.__stdout__.write(data)
        if hasattr(self, 'callback'):
            self.callback(data)
        else:
            self.buffer.write(data)

Example 9

Project: tsunami
Source File: kassie.py
View license
def arreter_MUD():
    """Fonction appelée pour arrêter le MUD proprement"""
    global importeur, log
    sys.__stdout__.write("\rArrêt du MUD en cours...\n")
    sys.__stdout__.flush()
    importeur.deconnecter_joueurs()

    importeur.tout_detruire()
    importeur.tout_arreter()
    log.info("Fin de la session\n\n\n")
    sys.exit(0)

Example 10

Project: chipsec
Source File: test_bsddb3.py
View license
    def testCheckElapsedTime(self):
        # Print still working message since these tests can be really slow.
        now = time.time()
        if self.next_time <= now:
            TimingCheck.next_time = now + self._PRINT_WORKING_MSG_INTERVAL
            sys.__stdout__.write('  test_bsddb3 still working, be patient...\n')
            sys.__stdout__.flush()

Example 11

Project: green
Source File: process.py
View license
def ddebug(msg, err=None):  # pragma: no cover
    """
    err can be an instance of sys.exc_info() -- which is the latest traceback
    info
    """
    import os
    if err:
        err = ''.join(traceback.format_exception(*err))
    else:
        err = ''
    sys.__stdout__.write("({}) {} {}".format(os.getpid(), msg, err)+'\n')
    sys.__stdout__.flush()

Example 12

Project: IsisWorld
Source File: developerconsole.py
View license
  def writeOut(self, line, copy = True):
    if copy: sys.__stdout__.write(line)
    lines = line.split('\n')
    firstline = lines.pop(0)
    self.lines[-1] += firstline
    self.lines += lines
    self.frame['text'] = '\n'.join(self.lines[-9:])

Example 13

Project: datafari
Source File: test_bsddb3.py
View license
    def testCheckElapsedTime(self):
        # Print still working message since these tests can be really slow.
        now = time.time()
        if self.next_time <= now:
            TimingCheck.next_time = now + self._PRINT_WORKING_MSG_INTERVAL
            sys.__stdout__.write('  test_bsddb3 still working, be patient...\n')
            sys.__stdout__.flush()

Example 14

Project: sonospy
Source File: widget.py
View license
    def write(self, data):
        """   """

        sys.__stdout__.write(data)
        if hasattr(self, 'callback'):
            self.callback(data)
        else:
            self.buffer.write(data)

Example 15

Project: openwrt-mt7620
Source File: test_bsddb3.py
View license
    def testCheckElapsedTime(self):
        # Print still working message since these tests can be really slow.
        now = time.time()
        if self.next_time <= now:
            TimingCheck.next_time = now + self._PRINT_WORKING_MSG_INTERVAL
            sys.__stdout__.write('  test_bsddb3 still working, be patient...\n')
            sys.__stdout__.flush()

Example 16

Project: openwrt-mt7620
Source File: test_bsddb3.py
View license
    def testCheckElapsedTime(self):
        # Print still working message since these tests can be really slow.
        now = time.time()
        if self.next_time <= now:
            TimingCheck.next_time = now + self._PRINT_WORKING_MSG_INTERVAL
            sys.__stdout__.write('  test_bsddb3 still working, be patient...\n')
            sys.__stdout__.flush()

Example 17

Project: django-mmc
Source File: mixins.py
View license
    def write(self, message):
        self.data.append(message)

        try:
            sys.__stdout__.write(message)
        except Exception as err:
            sys.stderr.write("{0}".format(err))

Example 18

Project: django-mmc
Source File: mixins.py
View license
    def write(self, message):
        self.data.append(message)

        try:
            sys.__stdout__.write(message)
        except Exception as err:
            sys.stderr.write("{0}".format(err))

Example 19

Project: tmc.py
Source File: unicode_characters.py
View license
    def write(self, text):
        if len(text) == 0:
            return
        if not self.use_unicode:
            text = self.pattern.sub(lambda x: self.chars[x.group()], text)
        sys.__stdout__.write(text)

Example 20

Project: tmc.py
Source File: unicode_characters.py
View license
    def write(self, text):
        if len(text) == 0:
            return
        if not self.use_unicode:
            text = self.pattern.sub(lambda x: self.chars[x.group()], text)
        sys.__stdout__.write(text)

Example 21

Project: neuroConstruct
Source File: test_bsddb3.py
View license
    def testCheckElapsedTime(self):
        # Print still working message since these tests can be really slow.
        now = time.time()
        if self.next_time <= now:
            TimingCheck.next_time = now + self._PRINT_WORKING_MSG_INTERVAL
            sys.__stdout__.write('  test_bsddb3 still working, be patient...\n')
            sys.__stdout__.flush()

Example 22

Project: neuroConstruct
Source File: test_bsddb3.py
View license
    def testCheckElapsedTime(self):
        # Print still working message since these tests can be really slow.
        now = time.time()
        if self.next_time <= now:
            TimingCheck.next_time = now + self._PRINT_WORKING_MSG_INTERVAL
            sys.__stdout__.write('  test_bsddb3 still working, be patient...\n')
            sys.__stdout__.flush()

Example 23

Project: git-goggles
Source File: progress.py
View license
    def uncapture_stdout(self):
        sys.__stdout__.write(''.ljust(self.max_length))
        sys.__stdout__.write('\r')
        sys.stdout = self._stdout
        console(force_unicode(self._capture_stdout.getvalue()))
        self._capture_stdout = StringIO.StringIO()

Example 24

Project: git-goggles
Source File: progress.py
View license
    def emit(self, record):
        if self.msg != record.msg:
            self.msg = record.msg
            msg = ' %s   %s' % (self.spinner[0], self.msg)
            self.max_length = max(len(msg), self.max_length)
            self.spinner = self.spinner[1:] + self.spinner[:1]
            sys.__stdout__.write(force_str(msg.ljust(self.max_length)))
            sys.__stdout__.write('\r')

Example 25

Project: git-goggles
Source File: progress.py
View license
    def uncapture_stdout(self):
        sys.__stdout__.write(''.ljust(self.max_length))
        sys.__stdout__.write('\r')
        sys.stdout = self._stdout
        console(force_unicode(self._capture_stdout.getvalue()))
        self._capture_stdout = StringIO.StringIO()

Example 26

Project: git-goggles
Source File: progress.py
View license
    def emit(self, record):
        if self.msg != record.msg:
            self.msg = record.msg
            msg = ' %s   %s' % (self.spinner[0], self.msg)
            self.max_length = max(len(msg), self.max_length)
            self.spinner = self.spinner[1:] + self.spinner[:1]
            sys.__stdout__.write(force_str(msg.ljust(self.max_length)))
            sys.__stdout__.write('\r')

Example 27

Project: cg-logging
Source File: cgLogging.py
View license
	def emit(self, record):

		try:
			sys.__stdout__.write( "%s\n" %self.format(record) )
		except IOError:
			## MotionBuilder is doing something funky with python,
			## so sometimes ( not always ) is blocked from writting:
			sys.stdout.write( "%s\n" %self.format(record) )

Example 28

Project: PyAutoC
Source File: test_bsddb3.py
View license
    def testCheckElapsedTime(self):
        # Print still working message since these tests can be really slow.
        now = time.time()
        if self.next_time <= now:
            TimingCheck.next_time = now + self._PRINT_WORKING_MSG_INTERVAL
            sys.__stdout__.write('  test_bsddb3 still working, be patient...\n')
            sys.__stdout__.flush()

Example 29

Project: pymo
Source File: PyParse.py
View license
    def dump(*stuff):
        sys.__stdout__.write(" ".join(map(str, stuff)) + "\n")

Example 30

Project: peppy
Source File: PyParse.py
View license
    def dump(*stuff):
        sys.__stdout__.write(" ".join(map(str, stuff)) + "\n")

Example 31

Project: robotframework
Source File: LibUsingPyLogging.py
View license
    def emit(self, record):
        sys.__stdout__.write(record.getMessage().title() + '\n')

Example 32

Project: robotframework
Source File: Listener.py
View license
    def _log(self, message):
        sys.__stdout__.write("[{0}]\n".format(message))

Example 33

Project: qnotero
Source File: setup-windows.py
View license
	def write(self, msg):	
		if isinstance(msg, str):
			msg = msg.encode('ascii', 'ignore')
		sys.__stdout__.write(msg.decode('ascii'))

Example 34

Project: WAPT
Source File: PyParse.py
View license
    def dump(*stuff):
        sys.__stdout__.write(" ".join(map(str, stuff)) + "\n")

Example 35

Project: TrustRouter
Source File: PyParse.py
View license
    def dump(*stuff):
        sys.__stdout__.write(" ".join(map(str, stuff)) + "\n")

Example 36

Project: TrustRouter
Source File: PyParse.py
View license
    def dump(*stuff):
        sys.__stdout__.write(" ".join(map(str, stuff)) + "\n")

Example 37

Project: tsunami
Source File: __init__.py
View license
    def input(self):
        """Récupère l'input de l'utilisateur."""
        if not importeur.serveur.lance:
            return

        sys.__stdout__.write("\r" + self.prompt)
        sys.__stdout__.flush()
        try:
            code = input()
        except (KeyboardInterrupt, EOFError):
            importeur.serveur.lance = False
            return

        stdout = sys.stdout
        stderr = sys.stderr
        sys.stdout = sys.__stdout__
        sys.stderr = sys.__stderr__
        try:
            ret = self.console.push(code)
        except Exception:
            print(traceback.format_exc())
        else:
            self.prompt = "... " if ret else ">>> "
        finally:
            sys.stdout = stdout
            sys.stderr = stderr

Example 38

Project: pythonVSCode
Source File: ipythonServer.py
View license
def _debug_write(out):
    if DEBUG:
        sys.__stdout__.write(out)
        sys.__stdout__.write("\n")
        sys.__stdout__.flush()

Example 39

View license
def _debug_write(out):
    if DEBUG:
        sys.__stdout__.write(out)
        sys.__stdout__.flush()

Example 40

Project: datafari
Source File: PyParse.py
View license
    def dump(*stuff):
        sys.__stdout__.write(" ".join(map(str, stuff)) + "\n")

Example 41

Project: openwrt-mt7620
Source File: PyParse.py
View license
    def dump(*stuff):
        sys.__stdout__.write(" ".join(map(str, stuff)) + "\n")

Example 42

Project: openwrt-mt7620
Source File: PyParse.py
View license
    def dump(*stuff):
        sys.__stdout__.write(" ".join(map(str, stuff)) + "\n")

Example 43

Project: ironpython3
Source File: PyParse.py
View license
    def dump(*stuff):
        sys.__stdout__.write(" ".join(map(str, stuff)) + "\n")

Example 44

Project: kbengine
Source File: PyParse.py
View license
    def dump(*stuff):
        sys.__stdout__.write(" ".join(map(str, stuff)) + "\n")

Example 45

Project: kbengine
Source File: PyParse.py
View license
    def dump(*stuff):
        sys.__stdout__.write(" ".join(map(str, stuff)) + "\n")

Example 46

View license
def _debug_write(out):
    if DEBUG:
        sys.__stdout__.write(out)
        sys.__stdout__.flush()

Example 47

View license
def _debug_write(out):
    if DEBUG:
        sys.__stdout__.write(out)
        sys.__stdout__.flush()

Example 48

Project: iot-utilities
Source File: PyParse.py
View license
    def dump(*stuff):
        sys.__stdout__.write(" ".join(map(str, stuff)) + "\n")

Example 49

Project: iot-utilities
Source File: PyParse.py
View license
    def dump(*stuff):
        sys.__stdout__.write(" ".join(map(str, stuff)) + "\n")

Example 50

View license
def _debug_write(out):
    if DEBUG:
        sys.__stdout__.write(out)
        sys.__stdout__.flush()