Skip to content

Commit ab07d95

Browse files
Update scp_foundation.py
1 parent 778db63 commit ab07d95

File tree

1 file changed

+43
-11
lines changed

1 file changed

+43
-11
lines changed

scp_foundation.py

Lines changed: 43 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,18 @@ def progress(percent=0, width=30):
4141
█▄▄▄█ █▄▄█ █ █ █▄▄▄█ █▄▄█ █ ▀█ █▄▄▀ █ █ █ ▄█▄ █▄▄▄█ █ ▀█
4242
SECURE ● CONTAIN ● PROTECT''')
4343
print("")
44-
print(Back.RED + " WARNING. THE SCP FOUNDATION DATABASE IS CLASSIFIED. UNAUTHORIZED PERSONAL IS STRICTLY PROHIBITED. ".center(100))
45-
casper_speak("WARNING. THE SCP FOUNDATION DATABASE IS CLASSIFIED. UNAUTHORIZED PERSONAL IS STRICTLY PROHIBITED.")
46-
dum = input(" Enter login credentials: ")
44+
print(" ", Back.RED + " WARNING. THE SCP FOUNDATION DATABASE IS CLASSIFIED. UNAUTHORIZED PERSONAL IS STRICTLY PROHIBITED ")
45+
# casper_speak("WARNING. THEE SCP FOUNDATION DATABASE IS CLASSIFIED. UNAUTHORIZED PERSONAL IS STRICTLY PROHIBITED.")
4746

48-
print("Validating credentials...")
49-
casper_speak("Validating credentials")
50-
time.sleep(0.05)
51-
print("Clearance granted.")
52-
casper_speak("Clearance granted.")
47+
48+
# dum = input(" Enter login credentials: ")
49+
50+
# print("Verifying credentials...")
51+
# casper_speak("Verifying credentials")
52+
# time.sleep(0.05)
53+
54+
# print("Clearance granted.")
55+
# casper_speak("Clearance granted.")
5356

5457
casper_speak("Enter SCP item number.")
5558
usr = input(" Enter SCP item number: ")
@@ -81,8 +84,37 @@ def progress(percent=0, width=30):
8184

8285
try:
8386
for i in num_list:
84-
yo = f"{s.find_all('p')[i].text}\n"
85-
print(Fore.GREEN + yo.center(100))
87+
txt = f"{s.find_all('p')[i].text}"
88+
89+
90+
def format_paragraph(paragraph, length, left, right):
91+
92+
words = paragraph.split()
93+
lines = []
94+
curline = ' ' * (left - 1) # we add a space before the first word
95+
96+
while words:
97+
word = words.pop(0) # process the next word
98+
99+
# +1 in the next line is for the space.
100+
if len(curline) + 1 + len(word) > length - right:
101+
# line would have been too long, start a new line
102+
lines.append(curline)
103+
curline = ' ' * (left - 1)
104+
curline += " " + word
105+
106+
lines.append(curline)
107+
108+
return '\n'.join(lines)
109+
110+
111+
# we need to work on one paragraph at a time
112+
paragraphs = txt.split('\n\n')
113+
114+
for paragraph in paragraphs:
115+
print(format_paragraph(paragraph, 80, left=4, right=5))
116+
print() # next paragraph
117+
86118
except IndexError:
87119
print(Fore.RED + "<<< END OF DOCUMENT >>>".center(100))
88120
print(Fore.RED + "<<< END OF DOCUMENT >>>".center(100))
@@ -97,4 +129,4 @@ def progress(percent=0, width=30):
97129
casper_speak(lines)
98130

99131

100-
time.sleep(1200)
132+
time.sleep(3600)

0 commit comments

Comments
 (0)