def _touch_run(self):
while not self._touch_stop.wait(1):
# "touch" the screen's frame-buffer once a second. This ensures
# that the screen always updates at least once a second and works
# around the issue that screen updates can be lost due to lack of
# resolution of the file modification timestamps. Unfortunately,
# futimes(3) is not universally supported, and only available in
# Python 3.3+ so this gets a bit convoluted...
try:
if os.utime in os.supports_fd:
os.utime(self._fd.fileno())
else:
raise NotImplementedError
except (AttributeError, NotImplementedError) as e:
os.utime(self._fd.name, None)
评论列表
文章目录