mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 17:12:13 -06:00
u2cli: aggressive flushing on windows
This commit is contained in:
parent
23c8d3d045
commit
1faff2a37e
17
bin/up2k.py
17
bin/up2k.py
|
@ -125,17 +125,30 @@ class FileSlice(object):
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
|
_print = print
|
||||||
|
|
||||||
|
|
||||||
def eprint(*a, **ka):
|
def eprint(*a, **ka):
|
||||||
ka["file"] = sys.stderr
|
ka["file"] = sys.stderr
|
||||||
ka["end"] = ""
|
ka["end"] = ""
|
||||||
if not PY2:
|
if not PY2:
|
||||||
ka["flush"] = True
|
ka["flush"] = True
|
||||||
|
|
||||||
print(*a, **ka)
|
_print(*a, **ka)
|
||||||
if PY2:
|
if PY2 or not VT100:
|
||||||
sys.stderr.flush()
|
sys.stderr.flush()
|
||||||
|
|
||||||
|
|
||||||
|
def flushing_print(*a, **ka):
|
||||||
|
_print(*a, **ka)
|
||||||
|
if "flush" not in ka:
|
||||||
|
sys.stdout.flush()
|
||||||
|
|
||||||
|
|
||||||
|
if not VT100:
|
||||||
|
print = flushing_print
|
||||||
|
|
||||||
|
|
||||||
def termsize():
|
def termsize():
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue