mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 17:59:37 +00:00
Issue #8734: Python-fu misses sys.stdout.flush.
Just add a no-op flush() as I think it's actually unneeded in the context of a GtkTextView GUI. At least it doesn't cause issues with copy-pasted code or when using external libraries using the sys.stdout.flush() interface.
This commit is contained in:
parent
bee4dd0fc3
commit
2080abf0a3
1 changed files with 8 additions and 0 deletions
|
@ -80,6 +80,14 @@ class _ReadLine(object):
|
||||||
def write(self, text):
|
def write(self, text):
|
||||||
pos = self.buffer.get_iter_at_mark(self.buffer.get_insert())
|
pos = self.buffer.get_iter_at_mark(self.buffer.get_insert())
|
||||||
self.buffer.insert_with_tags_by_name(pos, text, self.tag_name)
|
self.buffer.insert_with_tags_by_name(pos, text, self.tag_name)
|
||||||
|
def flush(self):
|
||||||
|
# The output is just a GtkTextBuffer inside a GtkTexView so I
|
||||||
|
# believe it should be always in-sync without needing to be flushed.
|
||||||
|
# Nevertheless someone might be just copy-pasting plug-in code to
|
||||||
|
# test it, for instance. So let's just add a no-op flush() method to
|
||||||
|
# get a similar interface as the real sys.stdout which we overrode.
|
||||||
|
# It avoids useless and unexpected code failure.
|
||||||
|
pass
|
||||||
|
|
||||||
class History(object):
|
class History(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue