ats_utilities.splash.terminal_properties module

Module
terminal_properties.py
Copyright
Copyright (C) 2021 Vladimir Roncevic <elektron.ronca@gmail.com> ats_utilities is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ats_utilities is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
Info
Defined class TerminalProperties with attribute(s) and method(s). Defined API for getting terminal properties.
class ats_utilities.splash.terminal_properties.TerminalProperties(verbose=False)[source]

Bases: object

Defined class TerminalProperties with attribute(s) and method(s). Defined API for getting terminal properties. It defines:

attributes:
__verbose - enable/disable verbose option.
__window_size - terminal window size.
methods:
__init__ - initial constructor.
__ioctl_get_window_size - size for descriptor.
__ioctl_for_all_descriptors - size for all descriptors.
size - getting size of terminal window.
__str__ - dunder method for TerminalProperties.
VERBOSE = 'ats_utilities::splash::terminal_properties'
_TerminalProperties__ioctl_for_all_descriptors(verbose=False)

Check window size for all descriptors.

Parameters:verbose (<bool>) – enable/disable verbose option.
Returns:status true window size checked else false.
Return type:<bool>
Exceptions:None
_TerminalProperties__ioctl_get_window_size(file_descriptor, verbose=False)

Check window size for descriptor.

Parameters:
  • file_descriptor (<int>) – file descriptor.
  • verbose (<bool>) – enable/disable verbose option.
Returns:

window size of terminal.

Return type:

<tupple>

Exceptions:

ATSTypeError | ATSBadCallError

size(verbose=False)[source]

Center console line.

Parameters:verbose (<bool>) – enable/disable verbose option.
Returns:window size | None.
Return type:<tuple> | <NoneType>
Exceptions:None