-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSlthrChart.py
More file actions
58 lines (39 loc) · 1.57 KB
/
Copy pathSlthrChart.py
File metadata and controls
58 lines (39 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 1 14:13:30 2019
@author: Matt
"""
import shutil
class OutLiner(object):
def __init__(self):
self.center = int(shutil.get_terminal_size().columns/2)
def box(self,text, pos,):
self.text = text
space_len = (len(self.text) - len(self.text))
box = ('|' + self.text + ' '*space_len +'|')
return(box.rjust(pos + int(len(box)/2)))
def diamond(self,text, pos, optionA, optionB):
self.text = text
self.optionA = optionA
self.optionB = optionB
space_len = (len(self.text) - len(self.text))
trap = (self.optionA + '----' +'<' + self.text + ' '*space_len +'>' +'----' + self.optionB)
return(trap.rjust(pos + int(len(trap)/2)))
def trap(self,text,pos):
self.text = text
space_len = (len(self.text) - len(self.text))
trap = ('/' + self.text + ' '*space_len +'/')
return(trap.rjust(pos+int(len(trap)/2)))
def circle(self,text, pos):
self.text = text
circ = ('(' + self.text +')')
return(circ.rjust(pos + int(len(circ)/2)))
def down_arrow(self, pos):
#pos = int(len(text)/2)
return('\/'.rjust(pos + 1))
def left_arrow(self, length):
left = ('<'+'-'*length + '\/')
return(left)
def right_arrow(self, length):
right = ('\/' + '-'*length + '>')
return(right)