-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_utils.py
99 lines (78 loc) · 2.06 KB
/
_utils.py
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# import bcolors
# from room import Room
# from player import Player
# from game import Game
# from bcolors import colors
#
#
# def printc(msg, color_in):
# """Pretty printing with colors"""
#
# colors = bcolors.colors
#
# print(f"{colors[color_in]}", f"{msg}", colors["g"])
# # This section is for showing example text & it's key
# if msg == "x":
# for ex_color in colors:
# print(f"{colors[ex_color]}", "EXAMPLE", "| ", ex_color, colors["g"])
#
#
# def get_colors(*args): # add args
# arr = []
# for key in colors:
# arr.append(key)
#
# for i, color in enumerate(colors):
# printc(f"{arr[i]}| EXAMPLE", color)
#
# # for color in colors:
# # printc("EXAMPLE", color)
# # if args:
# # for right in args:
# # if right == args[0]:
# # printc("EXAMPLE", arr[args[0]])
import bcolors
from room import Room
from player import Player
from game import Game
from bcolors import colors
def make_colorful(msg, color_in):
combined = ''
for color in color_in:
combined += colors[color]
return f"{combined}"+f"{msg}"+colors["g"]
def printc(msg, color_in=["c"]):
"""Pretty printing with colors"""
colors = bcolors.colors
encoded = make_colorful(msg, color_in)
print(encoded)
# This section is for showing example text & it's key
def get_colors(msg): # add args
arr = []
for key in colors:
arr.append(key)
for i, color in enumerate(colors):
printc(f"{arr[i]}| {msg}", color)
# print(get_colors("test"))
# for color in color_in:
# formatted += make_colorful(f"{msg}", color)
#
# combined_files = [
# "bcolors.py",
# "game.py",
# "globals.py",
# "player.py",
# "room.py",
# "storylines.py",
# "main.py",
# ]
#
# aggregated = ''
#
# for file in combined_files:
# with open(file, 'r') as new_data:
# aggregated+=new_data.read()
#
# with open("aggregated.py", 'w') as new_file:
# new_file.write(aggregated)
# print("Files combined", combined_files)