-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfaker.py
More file actions
85 lines (73 loc) · 2.28 KB
/
Copy pathfaker.py
File metadata and controls
85 lines (73 loc) · 2.28 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
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
from code_reader import CodeReader as cr
from progress.bar import Bar
from fake_process import FakeSubprocess as fp
import random
import sys
import time
class Faker:
def __init__(self):
file_dir = "/src"
self.faker_controller()
def faker_controller(self):
print(f'Faker Controller')
selection_list = {
1: "process_picker",
2: "progress_bar",
3: "progress",
4: "code_reader"
}
rando_selecto = random.randint(4, 4)
selecto_presto = getattr(self, selection_list.get(rando_selecto))
return selecto_presto()
def progress(self):
def bar(count, total, status=''):
bar_len = 60
filled_len = int(round(bar_len * count / float(total)))
percents = round(100.0 * count / float(total), 1)
progress_bar = '■' * filled_len + ' ' * (bar_len - filled_len)
sys.stdout.write(f'[{progress_bar}] {percents}% ...{status}\r')
sys.stdout.flush()
rand_int = random.randint(1, 1)
if rand_int == 1:
bar_length = 100
i = 0
while i <= bar_length:
bar(i, bar_length, status="Hashing file")
time.sleep(0.005)
i += 1
#self.faker_controller()
def progress_bar(self):
bar = Bar('Loading', fill='■', suffix='%(percent)d%%')
for i in range(100):
time.sleep(0.01)
bar.next()
bar.finish()
#self.faker_controller()
def process_picker(self):
#call_num = random.randint(1, 11)
call_num = 3
count = 0
process_list = {
1: "ping",
2: "ls",
3: "nbtstat",
4: "netstat",
5: "processes",
6: "tasklist",
7: "route",
8: "system_info",
9: "tracert",
10: "nslookup",
11: "ipconfig"
}
selectorama = fp()
while count < call_num:
rando_selecto = random.randint(1, 11)
selectorama.selector(process_list.get(rando_selecto))
count += 1
#self.faker_controller()
def code_reader(self):
cr()
#self.faker_controller()
if __name__ == '__main__':
Faker()