Ejemplo n.º 1
0
import copy
import displays
import glob
import os
import pickle
import subprocess
import sys
import time
import util
from PIL import Image

ARRANGEMENT = None
DIMENSIONS = None
PREFIX = 'TILE_'
IMAGES = []
COLS, ROWS = util.getTerminalSize()


def progressbar(left,
                index,
                total,
                right=None,
                skip=False,
                charset=3,
                mid_color=None):
    if right is None:
        right = '%s/%s ' % (index + 1, total
                            )  # Because index starts at 0 by default

    barload = COLS - len(right)
    if skip:
Ejemplo n.º 2
0
 def set_term_width(self):
     if not self.term_width:
         w, _ = getTerminalSize()
         self.term_width = w
Ejemplo n.º 3
0
def stdoutCR(msg=''):
    _, width = util.getTerminalSize()
    clear = '\r{:%d}' % width
    sys.stdout.write(clear.format(' '))
    sys.stdout.write('\r{}'.format(msg))
    sys.stdout.flush()