Skip to content

Commit f672f99

Browse files
author
Yuvraj Raghuvanshi
committed
Formatted using black
1 parent 209a1aa commit f672f99

File tree

2 files changed

+26
-17
lines changed

2 files changed

+26
-17
lines changed

helpers/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# For relative imports to work in Python 3.6
22
import os
33
import sys
4+
45
sys.path.append(os.path.dirname(os.path.realpath(__file__)))

helpers/custom_ci.py

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,45 @@
88
from termcolor import colored, cprint
99
except ImportError:
1010
try:
11-
os.system('pip3 install termcolor')
11+
os.system("pip3 install termcolor")
1212
except Exception:
13-
os.system('python3 -m pip install termcolor')
13+
os.system("python3 -m pip install termcolor")
1414

15-
if not (os.path.isdir('log')):
16-
os.mkdir('log')
17-
logging.basicConfig(filename='log/wa_kdbe.log', level=logging.DEBUG, format='')
15+
if not (os.path.isdir("log")):
16+
os.mkdir("log")
17+
logging.basicConfig(filename="log/wa_kdbe.log", level=logging.DEBUG, format="")
1818
masked = []
1919

2020

21-
def custom_input(text_to_input, color='green', attr=[], is_get_time=True, is_log=True):
22-
time = get_time() if is_get_time else ''
23-
data = input(colored(f'{time}{text_to_input}', color, attrs=attr))
24-
if(is_log):
25-
logging.debug(f'{time}{text_to_input}{data}')
21+
def custom_input(text_to_input, color="green", attr=[], is_get_time=True, is_log=True):
22+
time = get_time() if is_get_time else ""
23+
data = input(colored(f"{time}{text_to_input}", color, attrs=attr))
24+
if is_log:
25+
logging.debug(f"{time}{text_to_input}{data}")
2626
else:
27-
logging.debug(f'{time}{text_to_input}********')
27+
logging.debug(f"{time}{text_to_input}********")
2828
# Add that password in list, and mask that while printing also.
2929
masked.append(data)
3030
return data
3131

3232

33-
def custom_print(text_to_print, color='green', attr=[], is_get_time=True, is_log=True, is_print=True, end='\n'):
34-
time = get_time() if is_get_time else ''
33+
def custom_print(
34+
text_to_print,
35+
color="green",
36+
attr=[],
37+
is_get_time=True,
38+
is_log=True,
39+
is_print=True,
40+
end="\n",
41+
):
42+
time = get_time() if is_get_time else ""
3543
text_to_print = str(text_to_print)
36-
if(is_print):
37-
cprint(f'{time}{text_to_print}', color, attrs=attr, end=end)
44+
if is_print:
45+
cprint(f"{time}{text_to_print}", color, attrs=attr, end=end)
3846
else:
3947
pass
40-
if(is_log):
41-
logging.debug(f'{time}{text_to_print}')
48+
if is_log:
49+
logging.debug(f"{time}{text_to_print}")
4250
else:
4351
# Search for password and mask.
4452
for i in masked:

0 commit comments

Comments
 (0)