# -*- coding: utf-8 -*- # Copyright 2019 - 2022 Avram Lubkin, All Rights Reserved
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
Provides a terminal class primarily for accessing functions that depend on
a terminal which has been previously setup as well as those functions """
# Type check for term if term isnotNoneandnot isinstance(term, BASESTRING): raise TypeError('term must be a string or None, not %s' % type(term).__name__)
# Type check and default handling for fd if fd == -1: try:
self.stream_fd = sys.stdout.fileno() except (AttributeError, TypeError, io.UnsupportedOperation):
self.stream_fd = None elifnot isinstance(fd, int): raise TypeError('fd must be an integer, not %s' % type(fd).__name__) else:
self.stream_fd = fd
# Try to dynamically determine terminal type if term isNone:
term = get_term(self.stream_fd)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.