mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-22 05:26:24 +02:00
Cache for nodes; icons overlap; colors; new icons.
This commit is contained in:
parent
b976e4b5d8
commit
64aa1432ee
5 changed files with 1052 additions and 692 deletions
12
ui.py
12
ui.py
|
@ -1,3 +1,5 @@
|
|||
# -*- coding: utf-8 -*- from __future__ import unicode_literals
|
||||
|
||||
"""
|
||||
Author: Sergey Vartanov (me@enzet.ru).
|
||||
"""
|
||||
|
@ -5,12 +7,14 @@ Author: Sergey Vartanov (me@enzet.ru).
|
|||
import sys
|
||||
|
||||
def write_line(number, total):
|
||||
length = 20
|
||||
|
||||
if number == -1:
|
||||
print ('%3s' % '100') + ' %: [' + (100 * '=') + '].'
|
||||
print ('%3s' % '100') + ' % ░' + (length * '░') + '░'
|
||||
elif number % 1000 == 0:
|
||||
p = number / float(total)
|
||||
l = int(p * 100)
|
||||
print ('%3s' % str(int(p * 1000) / 10)) + ' %: [' + (l * '=') + \
|
||||
((100 - l) * ' ') + '].'
|
||||
l = int(p * length)
|
||||
print ('%3s' % str(int(p * 1000) / 10)) + ' % ░' + (l * '░') + \
|
||||
((length - l) * ' ') + '░'
|
||||
sys.stdout.write("\033[F")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue