physicsLab 2.0.2__tar.gz → 2.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {physicslab-2.0.2 → physicslab-2.0.4}/PKG-INFO +4 -3
- {physicslab-2.0.2 → physicslab-2.0.4}/README.md +6 -5
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/__init__.py +4 -3
- physicslab-2.0.4/physicsLab/_colorUtils.py +184 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/_core.py +105 -85
- physicslab-2.0.4/physicsLab/_unwind.py +43 -0
- physicslab-2.0.4/physicsLab/_warn.py +21 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/celestial/_planetbase.py +28 -15
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/celestial/planets.py +459 -34
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/circuit/_circuit_core.py +33 -17
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/circuit/elements/artificialCircuit.py +515 -212
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/circuit/elements/basicCircuit.py +180 -39
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/circuit/elements/logicCircuit.py +396 -93
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/circuit/elements/otherCircuit.py +81 -3
- physicslab-2.0.4/physicsLab/circuit/elements/sensor.py +387 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/electromagnetism/_electromagnetismBase.py +21 -10
- physicslab-2.0.4/physicsLab/electromagnetism/elements.py +164 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/element.py +86 -40
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/enums.py +5 -0
- physicslab-2.0.4/physicsLab/errors.py +237 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/lib/analog_circuit/analog.py +1 -1
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/lib/logic_circuit/logic.py +64 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/lib/logic_circuit/super_logic_gate.py +5 -5
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/lib/logic_circuit/wires.py +4 -3
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/music.py +11 -12
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/savTemplate.py +6 -7
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/web/_api.py +283 -237
- physicslab-2.0.4/physicsLab/web/api.py +307 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/web/webutils.py +7 -7
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab.egg-info/PKG-INFO +4 -3
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab.egg-info/SOURCES.txt +2 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab.egg-info/requires.txt +1 -1
- {physicslab-2.0.2 → physicslab-2.0.4}/setup.py +2 -2
- physicslab-2.0.2/physicsLab/_colorUtils.py +0 -35
- physicslab-2.0.2/physicsLab/circuit/elements/sensor.py +0 -166
- physicslab-2.0.2/physicsLab/electromagnetism/elements.py +0 -69
- physicslab-2.0.2/physicsLab/errors.py +0 -117
- physicslab-2.0.2/physicsLab/web/api.py +0 -187
- {physicslab-2.0.2 → physicslab-2.0.4}/LICENSE +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/_tools.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/_typing.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/celestial/__init__.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/chart.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/circuit/__init__.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/circuit/elements/__init__.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/electromagnetism/__init__.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/lib/__init__.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/lib/analog_circuit/__init__.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/lib/logic_circuit/__init__.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/lib/logic_circuit/edge_trigger.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/__init__.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/__init__.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/frozen.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/messages/__init__.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/messages/checks.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/messages/decode.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/messages/encode.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/messages/messages.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/messages/specs.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/messages/strings.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/midifiles/__init__.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/midifiles/meta.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/midifiles/midifiles.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/midifiles/tracks.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/midifiles/units.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/parser.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/ports.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/scripts/__init__.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/scripts/mido_connect.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/scripts/mido_play.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/scripts/mido_ports.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/scripts/mido_serve.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/sockets.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/syx.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/music/mido/tokenizer.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/plAR.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/utils.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/web/__init__.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab/web/_threadpool.py +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab.egg-info/dependency_links.txt +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/physicsLab.egg-info/top_level.txt +0 -0
- {physicslab-2.0.2 → physicslab-2.0.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: physicsLab
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.4
|
|
4
4
|
Summary: Python API for Quantum-Physics App
|
|
5
5
|
Home-page: https://github.com/GoodenoughPhysicsLab/physicsLab
|
|
6
6
|
Author: Arendelle
|
|
@@ -15,7 +15,7 @@ Description-Content-Type: text/markdown
|
|
|
15
15
|
License-File: LICENSE
|
|
16
16
|
Requires-Dist: typing-extensions
|
|
17
17
|
Requires-Dist: requests==2.32.3
|
|
18
|
-
Requires-Dist:
|
|
18
|
+
Requires-Dist: executing==2.2.0
|
|
19
19
|
Dynamic: author
|
|
20
20
|
Dynamic: author-email
|
|
21
21
|
Dynamic: classifier
|
|
@@ -23,6 +23,7 @@ Dynamic: description
|
|
|
23
23
|
Dynamic: description-content-type
|
|
24
24
|
Dynamic: home-page
|
|
25
25
|
Dynamic: license
|
|
26
|
+
Dynamic: license-file
|
|
26
27
|
Dynamic: requires-dist
|
|
27
28
|
Dynamic: requires-python
|
|
28
29
|
Dynamic: summary
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](LICENSE)
|
|
6
6
|
[](https://github.com/GoodenoughPhysicsLab/physicsLab/actions)
|
|
7
|
-
|
|
7
|
+

|
|
8
8
|
|
|
9
9
|
## 介绍
|
|
10
10
|
当我们在[物理实验室AR](https://www.turtlesim.com/)纯手动做实验的时候,往往会遇到一些琐碎、麻烦但又不得不做的事情,比如:重复的搭建某些电路,调整元件的位置,电路内部结构的重复。这些问题都可以通过使用`physicsLab`生成这些电路结构来轻易解决!于是我写了`physicsLab`,让你能用`Python`在物实做实验。
|
|
@@ -27,11 +27,12 @@
|
|
|
27
27
|
* 大多数物实网络api封装的支持 (直接与物实服务器进行交互)
|
|
28
28
|
|
|
29
29
|
## 稳定&兼容
|
|
30
|
-
自版本`2.0.0`及之后, `physicsLab
|
|
30
|
+
自版本`2.0.0`及之后, `physicsLab`会逐步增加兼容的考虑与支持。宣布`stable`的api将永远不会移除,行为永远也不会改变。
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
* v2.0.
|
|
34
|
-
* v2.0.
|
|
32
|
+
* v2.0.0: 承诺`ExperimentOpenedError, ExperimentClosedError, ExperimentExistError, ExperimentNotExistError`会`stable`
|
|
33
|
+
* v2.0.1: 承诺三大实验所有元件的类名会`stable`
|
|
34
|
+
* v2.0.3: 承诺`class Experiment`会`stable`
|
|
35
|
+
* v2.0.4: 承诺`class User, anonymous_login, email_login, token_login`会`stable`
|
|
35
36
|
|
|
36
37
|
## 版本发布
|
|
37
38
|
`physicsLab`的版本发布采取快照的方式, `physicsLab`仅会维护`trunk`
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
2
2
|
''' Python API for Physics-Lab-AR '''
|
|
3
3
|
|
|
4
|
-
from ._colorUtils import close_color_print
|
|
5
4
|
# 操作实验
|
|
6
5
|
from .element import search_experiment, Experiment
|
|
7
6
|
from ._core import (
|
|
@@ -12,7 +11,7 @@ from ._core import (
|
|
|
12
11
|
ElementXYZ,
|
|
13
12
|
)
|
|
14
13
|
# 实验, 标签类型
|
|
15
|
-
from .enums import ExperimentType, Category, Tag, OpenMode, WireColor
|
|
14
|
+
from .enums import ExperimentType, Category, Tag, OpenMode, WireColor, GetUserMode
|
|
16
15
|
# 电学实验
|
|
17
16
|
from .circuit import *
|
|
18
17
|
# 天体物理实验
|
|
@@ -21,6 +20,7 @@ from .celestial import *
|
|
|
21
20
|
from .electromagnetism import *
|
|
22
21
|
# `physicsLab`自定义异常类
|
|
23
22
|
from .errors import *
|
|
23
|
+
from . import _warn
|
|
24
24
|
|
|
25
25
|
from physicsLab.plAR import *
|
|
26
26
|
from physicsLab.utils import *
|
|
@@ -34,8 +34,9 @@ import platform
|
|
|
34
34
|
|
|
35
35
|
if not os.path.exists(Experiment.SAV_PATH_DIR):
|
|
36
36
|
if platform.system() == "Windows":
|
|
37
|
-
warning("Have you installed Physics-Lab-AR?")
|
|
37
|
+
_warn.warning("Have you installed Physics-Lab-AR?")
|
|
38
38
|
os.makedirs(Experiment.SAV_PATH_DIR)
|
|
39
39
|
|
|
40
40
|
del os
|
|
41
41
|
del platform
|
|
42
|
+
del _warn
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
''' 在命令行打印出有颜色的字
|
|
3
|
+
为physicsLab最基础, 最底层的设施,
|
|
4
|
+
所以不能依赖physicsLab的任何其他设施, 包括 errors.py
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
>>> from physicsLab._colorUtils import *
|
|
8
|
+
>>> cprint(Red("test")) # 输出红色字
|
|
9
|
+
# 支持变参函数, 一次性打印多个不同颜色的Object
|
|
10
|
+
# 但不像python的print一样支持sep参数 [设计如此]
|
|
11
|
+
>>> cprint(Green("test"), "test", Yellow("test"), 1111, 3.14)
|
|
12
|
+
>>> cprint(Blue("test")) # 还支持以下颜色
|
|
13
|
+
>>> cprint(Magenta("test"))
|
|
14
|
+
>>> cprint(Cyan("test"))
|
|
15
|
+
>>> cprint(White("test"))
|
|
16
|
+
>>> cprint(Black("test"))
|
|
17
|
+
>>> cprint(Red("test"), file=sys.stderr) # 输出到stderr
|
|
18
|
+
>>> cprint(Red("test"), end='') # 支持print那样指定end
|
|
19
|
+
# 如果你不希望打印出颜色字 (即使使用了Red("xxx")之类的), 请使用python原生print
|
|
20
|
+
>>> print(Green("test"), "test", Yellow("test")) # 此时打印无颜色
|
|
21
|
+
'''
|
|
22
|
+
|
|
23
|
+
import platform
|
|
24
|
+
from physicsLab._typing import final
|
|
25
|
+
|
|
26
|
+
# 设置终端的编码为UTF-8
|
|
27
|
+
import io
|
|
28
|
+
import sys
|
|
29
|
+
sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding="utf-8")
|
|
30
|
+
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
|
|
31
|
+
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding="utf-8")
|
|
32
|
+
|
|
33
|
+
import ctypes
|
|
34
|
+
if platform.system() == "Windows":
|
|
35
|
+
from ctypes import wintypes
|
|
36
|
+
|
|
37
|
+
class _CONSOLE_SCREEN_BUFFER_INFO(ctypes.Structure):
|
|
38
|
+
_fields_ = [
|
|
39
|
+
("dwSize", wintypes._COORD),
|
|
40
|
+
("dwCursorPosition", wintypes._COORD),
|
|
41
|
+
("wAttributes", wintypes.WORD),
|
|
42
|
+
("srWindow", wintypes.SMALL_RECT),
|
|
43
|
+
("dwMaximumWindowSize", wintypes._COORD),
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
kernel32 = ctypes.windll.kernel32
|
|
47
|
+
|
|
48
|
+
_GetStdHandle = ctypes.windll.kernel32.GetStdHandle
|
|
49
|
+
_GetStdHandle.argtypes = [
|
|
50
|
+
wintypes.DWORD,
|
|
51
|
+
]
|
|
52
|
+
_GetStdHandle.restype = wintypes.HANDLE
|
|
53
|
+
|
|
54
|
+
_GetConsoleScreenBufferInfo = ctypes.windll.kernel32.GetConsoleScreenBufferInfo
|
|
55
|
+
_GetConsoleScreenBufferInfo.argtypes = [
|
|
56
|
+
wintypes.HANDLE,
|
|
57
|
+
ctypes.POINTER(_CONSOLE_SCREEN_BUFFER_INFO),
|
|
58
|
+
]
|
|
59
|
+
_GetConsoleScreenBufferInfo.restype = wintypes.BOOL
|
|
60
|
+
|
|
61
|
+
_SetConsoleTextAttribute = ctypes.windll.kernel32.SetConsoleTextAttribute
|
|
62
|
+
_SetConsoleTextAttribute.argtypes = [
|
|
63
|
+
wintypes.HANDLE,
|
|
64
|
+
wintypes.WORD,
|
|
65
|
+
]
|
|
66
|
+
_SetConsoleTextAttribute.restype = wintypes.BOOL
|
|
67
|
+
|
|
68
|
+
_stdout_handle = _GetStdHandle(-11) # STD_OUTPUT_HANDLE
|
|
69
|
+
_stderr_handle = _GetStdHandle(-12) # STD_ERROR_HANDLE
|
|
70
|
+
|
|
71
|
+
class _Color:
|
|
72
|
+
fore: int
|
|
73
|
+
|
|
74
|
+
def __init__(self, msg: str) -> None:
|
|
75
|
+
if type(self) is _Color:
|
|
76
|
+
raise NotImplementedError("_Color class can't be instantiated directly")
|
|
77
|
+
if not isinstance(msg, str):
|
|
78
|
+
raise TypeError(f"Parameter msg must be of type `str`, but got value `{msg}` of type {type(msg).__name__}")
|
|
79
|
+
|
|
80
|
+
self.msg = msg
|
|
81
|
+
|
|
82
|
+
def __repr__(self) -> str:
|
|
83
|
+
return self.msg
|
|
84
|
+
|
|
85
|
+
@final
|
|
86
|
+
def cprint(self, file):
|
|
87
|
+
if platform.system() == "Windows":
|
|
88
|
+
# 临时更改终端打印字符的属性
|
|
89
|
+
csbi = _CONSOLE_SCREEN_BUFFER_INFO()
|
|
90
|
+
if file is sys.stdout:
|
|
91
|
+
_GetConsoleScreenBufferInfo(_stdout_handle, ctypes.byref(csbi))
|
|
92
|
+
_SetConsoleTextAttribute(_stdout_handle, self.fore)
|
|
93
|
+
elif file is sys.stderr:
|
|
94
|
+
_GetConsoleScreenBufferInfo(_stderr_handle, ctypes.byref(csbi))
|
|
95
|
+
_SetConsoleTextAttribute(_stderr_handle, self.fore)
|
|
96
|
+
else:
|
|
97
|
+
assert False
|
|
98
|
+
print(self.msg, flush=True, end='', file=file)
|
|
99
|
+
# 恢复终端打印字符的属性
|
|
100
|
+
if file is sys.stdout:
|
|
101
|
+
_SetConsoleTextAttribute(_stdout_handle, csbi.wAttributes)
|
|
102
|
+
elif file is sys.stderr:
|
|
103
|
+
_SetConsoleTextAttribute(_stderr_handle, csbi.wAttributes)
|
|
104
|
+
else:
|
|
105
|
+
assert False
|
|
106
|
+
else:
|
|
107
|
+
print(f"\033[{self.fore}m{self.msg}\033[39m", end='', file=file)
|
|
108
|
+
|
|
109
|
+
class Black(_Color):
|
|
110
|
+
if platform.system() == "Windows":
|
|
111
|
+
fore = 0
|
|
112
|
+
else:
|
|
113
|
+
fore = 30
|
|
114
|
+
|
|
115
|
+
class Red(_Color):
|
|
116
|
+
if platform.system() == "Windows":
|
|
117
|
+
fore = 4
|
|
118
|
+
else:
|
|
119
|
+
fore = 31
|
|
120
|
+
|
|
121
|
+
class Green(_Color):
|
|
122
|
+
if platform.system() == "Windows":
|
|
123
|
+
fore = 2
|
|
124
|
+
else:
|
|
125
|
+
fore = 32
|
|
126
|
+
|
|
127
|
+
class Yellow(_Color):
|
|
128
|
+
if platform.system() == "Windows":
|
|
129
|
+
fore = 6
|
|
130
|
+
else:
|
|
131
|
+
fore = 33
|
|
132
|
+
|
|
133
|
+
class Blue(_Color):
|
|
134
|
+
if platform.system() == "Windows":
|
|
135
|
+
fore = 1
|
|
136
|
+
else:
|
|
137
|
+
fore = 34
|
|
138
|
+
|
|
139
|
+
class Magenta(_Color):
|
|
140
|
+
if platform.system() == "Windows":
|
|
141
|
+
fore = 5
|
|
142
|
+
else:
|
|
143
|
+
fore = 35
|
|
144
|
+
|
|
145
|
+
class Cyan(_Color):
|
|
146
|
+
if platform.system() == "Windows":
|
|
147
|
+
fore = 3
|
|
148
|
+
else:
|
|
149
|
+
fore = 36
|
|
150
|
+
|
|
151
|
+
class White(_Color):
|
|
152
|
+
if platform.system() == "Windows":
|
|
153
|
+
fore = 7
|
|
154
|
+
else:
|
|
155
|
+
fore = 37
|
|
156
|
+
|
|
157
|
+
def cprint(*args, end='\n', file = sys.stdout) -> None:
|
|
158
|
+
# 先刷新再打印, 避免在Windows下打印缓冲区的内容还未输出就被改变了Attribute
|
|
159
|
+
# e.g.
|
|
160
|
+
# print("test")
|
|
161
|
+
# _colorUtils.cprint("test")
|
|
162
|
+
if file == sys.stdout:
|
|
163
|
+
sys.stdout.flush()
|
|
164
|
+
elif file == sys.stderr:
|
|
165
|
+
sys.stderr.flush()
|
|
166
|
+
else:
|
|
167
|
+
assert False, "unreachable touched"
|
|
168
|
+
|
|
169
|
+
for arg in args:
|
|
170
|
+
if isinstance(arg, _Color):
|
|
171
|
+
arg.cprint(file=file)
|
|
172
|
+
else:
|
|
173
|
+
print(arg, end='', file=file)
|
|
174
|
+
print(end, end='', file=file)
|
|
175
|
+
# 再次刷新,确保终端的输出已经输出
|
|
176
|
+
# e.g.
|
|
177
|
+
# cprint(Green("test"), file=sys.stderr)
|
|
178
|
+
# cprint(Red("ttt"), file=sys.stdout)
|
|
179
|
+
if file == sys.stdout:
|
|
180
|
+
sys.stdout.flush()
|
|
181
|
+
elif file == sys.stderr:
|
|
182
|
+
sys.stderr.flush()
|
|
183
|
+
else:
|
|
184
|
+
assert False, "unreachable touched"
|