aboutsummaryrefslogtreecommitdiff
path: root/TermIO/__init__.py
blob: fef84d4db3a9016c17c08b2f5344b72f0a66015f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from .out import *

import os


class TermSizeSkeleton:

    def __init__(self):
        self.Update()

    def Update(self):
        self.Rows, self.Columns = map(int, os.popen('stty size', 'r').read().split())

    def Rows(self, Update=True):
        if Update: self.Update()
        return self.Rows

    def Columns(self, Update=True):
        if Update: self.Update()
        return self.Rows


TermSize = TermSizeSkeleton()