-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.py
More file actions
38 lines (25 loc) · 862 Bytes
/
functions.py
File metadata and controls
38 lines (25 loc) · 862 Bytes
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
__author__ = 'Martin'
import os
import colorama
colorama.init()
def ensure_dir(f):
"""
create folder structure, if not exits
"""
d = os.path.dirname(f)
if not os.path.exists(f):
print "shoud make dir"
os.makedirs(f)
class style:
def h1(self):
return colorama.Back.GREEN + colorama.Fore.BLACK + colorama.Style.DIM
def h2(self):
return colorama.Back.BLUE + colorama.Fore.WHITE + colorama.Style.DIM
def h3(self):
return colorama.Back.GRAY + colorama.Fore.BLACK + colorama.Style.DIM
def error(self):
return colorama.Back.RED + colorama.Fore.WHITE + colorama.Style.DIM
def info(self):
return colorama.Back.BLACK + colorama.Fore.WHITE + colorama.Style.DIM
def normal(self):
return colorama.Back.BLACK + colorama.Fore.WHITE + colorama.Style.BRIGHT